
Recherche avancée
Autres articles (53)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (6926)
-
Anomalie #4128 (En cours) : Bug de génération de boucle avec les modèles Spip
11 avril 2018, par Julien PORIAUDans les modèles personnalisés Spip, les images (boucle documents ou logos) sont mal générées et provoque un bug d’encodage visible dans le front-end lors du passage dans une autre langue (balises multi).
Nous n’avons pas trouvé où était le souci dans Spip, mais les caractères qui remontent dans le code source, ressemblent aux octets qui composent le fichier binaire d’une image.
Voir en live ici : http://spip-dev.nidecker.com/probleme-de-langue.html?lang=ca.Pour essayer d’isoler cette anomalie, nous avons procédé de la sorte avec l’aide de mon développeur :
1. Nous sommes reparti d’un SPIP 3.1.7 entièrement neuf (minimal), avec deux modèles Spip, rien d’autre.
Le bug se reproduit, ce qui exclus un problème lié aux squelettes ou autres plugins.Nous n’avons pas réussi a déterminer précisément ce qui génère ce bug, à part que c’est dans un contexte où on appelle une langue pas définie dans le multi.
En fonction du contenu de l’article, du nombre de modèles dans l’article, en fonction des boucles dans les inclure, le bug n’arrive pas au même endroit...Le problème vient de la génération des logos ou documents : si on supprime les balises
#LOGO_*
ou si on renommeIMG
enIMG_
, plus d’erreur.
Même sans traitements, avec juste[(#LOGO_*)]
, rien à faire.2. Nous avons pensé que c’était peut être une image au mauvais format : On a alors tenté de passer
ImageOptim
sur tout le répertoire/IMG
, redimensionné tous les logos en vignettes png de 320x240, rien à faire...3. On a fini par passer ce site de test en 3.2, pas mieux.
4. Nous avons épluché les caches générés dans
/tmp/cache
et/tmp/cache/skel
, tout paraît normal de ce côté là..5. On a ensuite un peu avancé en enlevant dans
mes_options.php
la variable$GLOBALS['forcer_lang'] = true
".
Sur la version minimal, plus de bug. Mais sur le site de production, le problème réside toujours.
Mais en faisant des tests avec et sans (et en supprimant bien/tmp/cache/
à chaque fois), ça se confirme pour la version minimal.6. A partir d’une copie de la version production, nous avons désactivé tout les plugins, passer
ImageOptim
sur/IMG
et rien a faire.. Impossible de déterminé d’où vient le problème :(7. Nous avons essayé d’écrire comme ceci :
[<img src="http://core.spip.org/projects/spip/(#LOGO_MOT|image_reduire{50,*}|extraire_attribut{src})" alt="" style='max-width: 300px; max-height: 300px' />]
Cela fonctionne sur la version minimal mais pas sur la version production.8. Dans la version minimal, j’ai encore récemment testé une dernière chose. J’ai supprimé les documents non sollicités sur ma page de teste (spip.php ?article1441&lang=ca).
Avec la requête SQL suivante :DELETE FROM jones_documents WHERE id_document NOT IN (1948,1949,2534,2535,630,631,1783,1784,1785,1786,1787,1788,1781,1782)
Le bug n’apparait plus..Je sèche..
Vous trouverez ici en téléchargement une archive de la version minimal (Spip 3.1.7) : https://www.dropbox.com/s/dek0zg7jafl8uxe/jones.zip?dl=0] ( 20mo)
Pour reproduire le bug, il suffit de passer la variable "&lang=ca" dans l’article 1441 (localhost/spip.php ?article1441&lang=ca).Je donne volontiers un accès à la version production si besoin.
-
Can I know which byte range to read from a remote mp4 file for FFMpeg to decode a keyframe ?
12 octobre 2023, par db9117I need to decode a of keyframe of a video file (mp4, h264 encoded). I know the timestamp of the keyframe I want to extract/decode. I want to minimize amount of data being read in memory. For this, I need to know beforehand exactly the minimal byte range I would require that encompasses this keyframe. How do I know what is the minimal byte range in the whole mp4 byte stream I need to read in order to be able to decode the keyframe ?


I currently find the appropriate keyframe in the
index_entries
contained in the header. I get its byte position (pos
attribute) and timestamp (timestamp
attribute). I calculate the range as follows :

startBytes
: minimum of :

- 

- the
pos
of the keyframe - the
pos
of the nearest index entry in the audio stream happening at or before the keyframe's timestamp.






This way when it's decoding the frame, if it also needs the audio content for demuxing, it would have it.


endBytes
: maximum of :

- 

- the
pos
of the next frame in the video stream's index, after the keyframe - the
pos
of the next frame in the audio stream's index after the timestamp of the wished keyframe.






This way I know that I have everything up until the next frame in the index, which theoretically should be enough to decode the keyframe only.


I then read the appropriate byte range.


When I try to decode the frame, I run in a loop until I succeed :


- 

avcodec_read_frame
avcodec_send_packet
avcodec_receive_frame








I ignore
AVERROR(EAGAIN)
errors.

avcodec_receive_frame
fails multiple times with errorAVERROR(EAGAIN)
which I ignore, until it fails saying that the memory it wants to read isn't available (wants to read afterendBytes
). I explicitly tell it to fail if it wants to read more than it has already read.

Note : for other keyframes at other positions in other videos, it sometimes succeeds (probably because the range is big enough by chance), but it fails more often than not.


My question is : Why is the end of the range not enough to be able to decode only the one keyframe ? Is there any way to more precisely calculate the exact range in bytes I would need in order to decode a particular keyframe ?


- the
-
ffmpeg ProcessBuilder No such file or directory
24 avril 2020, par silentsudoI am trying to get media duration using ffmpeg command from a java program. I am calling this method from within spring boot application.
I am using
ProcessBuilder
.


File object is valid and exists for privacy I have replaced file path in error logs.



My Code is as below :



private String getMediaDuration(File file) {
 final String command = "/usr/bin/ffmpeg -version";//-i " + file.getAbsolutePath() + " 2>&1 | grep Duration | cut -c 13-20";
 try {
 ProcessBuilder builder = new ProcessBuilder("/usr/bin/ffmpeg",
 "-version");
 builder.directory(file.getParentFile());

 System.out.println("Directory : " + builder.directory().exists());
 System.out.println("Directory : " + builder.directory().getAbsolutePath());
 final Process process = builder.start();
 final InputStream is = process.getInputStream();
 final InputStreamReader isr = new InputStreamReader(is);
 final BufferedReader br = new BufferedReader(isr);
 String line;
 while ((line = br.readLine()) != null) {
 System.out.println(line);
 }
 return line;
 } catch (Exception e) {
 e.printStackTrace();
 }
 return null;
 }




Unfortunately nothing seems to be working
Error below :



java.io.IOException: Cannot run program "/usr/bin/ffmpeg -version" (in directory "/abc/xyz"): error=2, No such file or directory
 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
 at ....getMediaDuration(FFmpegRunner.java:208)
 at ....ffmpegprocessor.FFmpegRunner.run(FFmpegRunner.java:61)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: error=2, No such file or directory
 at java.lang.UNIXProcess.forkAndExec(Native Method)
 at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
 at java.lang.ProcessImpl.start(ProcessImpl.java:134)
 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
 ... 5 more
</init>



Output for
whereis ffmpeg



ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz




Please help me understand where it is going wrong. Thank you.