
Recherche avancée
Autres articles (101)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
Configuration spécifique d’Apache
4 février 2011, parModules spécifiques
Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
Création d’un (...)
Sur d’autres sites (10960)
-
avcodec/cfhd : Require valid setup before Lowpass coefficients, BandHeader and BandSec...
3 avril 2021, par Michael Niedermayeravcodec/cfhd : Require valid setup before Lowpass coefficients, BandHeader and BandSecondPass
Previously the code skipped all security checks when these where encountered but prior data was incorrect.
Also replace an always true condition by an assertSigned-off-by : Michael Niedermayer <michael@niedermayer.cc>
-
How to Extract Video Duration from AVI Files using Apache Tika ?
29 août 2024, par smooky.secretsI've been working on a Java application where I need to extract metadata from various media files, including video files like .avi. Initially, I was using FFmpeg to handle this, but due to security concerns and known vulnerabilities, I upgraded to the latest version of FFmpeg. Unfortunately, even the latest version still had vulnerabilities.


To address this, I switched to using JAVE2, a Java-based media processing library. However, I later discovered that JAVE2 relies on FFmpeg under the hood, which didn't resolve my security concerns.


I then decided to use Apache Tika for extracting metadata. I have successfully implemented it and it works well for most formats. However, I've encountered a problem when trying to extract the duration of .avi files. The duration simply isn't present in the metadata returned by Tika for these files.


Here’s an example of what I've implemented so far :


import org.apache.tika.metadata.Metadata;
import org.apache.tika.parser.AutoDetectParser;
import org.apache.tika.parser.ParseContext;
import org.apache.tika.sax.BodyContentHandler;
import org.xml.sax.SAXException;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;

public class MediaMetadataExtractor {

 public static Integer getDuration(String filePath) {
 File source = new File(filePath);
 try (InputStream input = Files.newInputStream(source.toPath())) {
 AutoDetectParser parser = new AutoDetectParser();
 Metadata metadata = new Metadata();
 parser.parse(input, new BodyContentHandler(), metadata, new ParseContext());

 String durationStr = metadata.get("xmpDM:duration");
 if (durationStr != null) {
 long durationMs = Long.parseLong(durationStr);
 return (int) (durationMs / 1000); // Convert milliseconds to seconds
 }
 } catch (IOException | SAXException | TikaException e) {
 throw new RuntimeException("Error retrieving duration with Apache Tika", e);
 }
 return -1; // Unknown duration
 }

 public static void main(String[] args) {
 String filePath = "path/to/your/video.avi";
 Integer duration = getDuration(filePath);
 System.out.println("Duration: " + duration + " seconds");
 }
}



This code works well for other video formats like .mp4, but for .avi files, the duration is not available in the metadata extracted by Apache Tika. Below is an example of the metadata I get for an .avi file :


X-TIKA:Parsed-By -> org.apache.tika.parser.DefaultParser X-TIKA:Parsed-By-Full-Set -> org.apache.tika.parser.DefaultParser Content-Type -> video/x-msvideo

As you can see, there's no duration information.

the filetypes I am working with are :


jpeg,mp3,mp4,png,jpg,gif,mov,avi,bmp


but I am only facing this issue with .avi files, I can extract duration for .mov files, mp4 and mp3.


My Questions :


Is there a way to extract the duration of .avi files using Apache Tika ?
If Tika cannot extract this information, is there an alternative approach I can use that doesn't involve FFmpeg due to its vulnerabilities ?
Any guidance or suggestions would be greatly appreciated. Thank you !


-
Revision 1ba1871786 : Fix out of boundary memory read in fuzz test on vpxdec This commit fixes frame
12 juin 2014, par Jingning HanChanged Paths :
Modify /test/test-data.sha1
Modify /test/test.mk
Modify /test/test_vectors.cc
Modify /vp9/vp9_dx_iface.c
Fix out of boundary memory read in fuzz test on vpxdecThis commit fixes frame header decoding for superframe index, to
prevent out of boundary memory read triggered by fuzz test
vector. It resolves a chromium security violation issue
crbug.com/376802.The issue was introduced in the change :
Add VPXD_SET_DECRYPTOR support to the VP9 decoder.
cl-id I88f86c8ff9af34e0b6531028b691921b54c2fc48where the buffer was read before validation check on index offset
applied.A test vector is added accordingly.
Change-Id : I41c988e776bbdd1033312a668e03a3dbcf44ca99