
Recherche avancée
Médias (2)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (64)
-
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.
Sur d’autres sites (9472)
-
Node.js - Buffer Data to Ffmpeg
24 septembre 2017, par user8568709I used Node.js and Ffmpeg to create animations. Because I was trying to avoid third-party avi/mp4 parsers, I decided to output the animation as raw rgb24 data file and then use some program to convert it to mp4 file.
I found that Ffmpeg is free and open source which can do exactly it. So, I made a Node.js application which allocates a
Buffer
of size1920 x 1080 x 3
(width times height times number of bytes per pixel), then I created a rendering context library, and finally I animated frame by frame and saved each frame consecutivelly in a binary file (usingfs
module).Then I invoked Ffmpeg to convert it to mp4 file and it works very good. Animations are pretty easy to make and Ffmpeg does its job correctly.
However, the only problem is because it is very slow and eats space on hard disk. I want to create very long animations (more than a hour). The final mp4 file is relativelly small, but raw video file is extremelly big. About ninety percents of each frame are black pixels, so Ffmpeg comress it very good, but raw file cannot be compressed and it takes sometimes mor ethan 100 Gigabytes. Also, there is very unnecessary double processing same data. Firstly I process it in Node.js to save data to file, and then Ffmpeg reads it to convert it to mp4. There is a lot of unnecessary work.
So, I’m looking for a way (and I’m pretty sure it is possible, but I didn’t find a way to do it yet) to output raw video data (one frame at a time) to Ffmpeg process (without saving anything to the hard disk).
My goal is to do the following :
- Open Ffmpeg process
- Render a frame in Node.js
- Output raw byte stream to Ffmpeg
- Wait for Ffmpeg to encode it and append to mp4 file
- Let Ffmpeg wait for my Node.js process to render next frame
Is there a way to achieve it ? I really don’t see a reason to post code, because my current code has nothing to do with the question I’m asking here. I don’t struggle with syntax errors or implementation problems. No, instead I just don’t know which parameters to pass to Ffmpeg process in order to achieve what I’ve already explained.
I’ve searched in documentation to find out which parameters I need to pass to Ffmpeg process in order to let it read raw data from stdin instead from file, and also to wait until my Node.js process render next frame (so to disable time limit) because rendering a frame may take more than 24 hours. Therefore, Ffmpeg process should wait without time limit. However, I didn’t find anything about it in documentation.
I know how to write to stdin from Node.js and similar technical stuff, so no need to explain it. The only question(s) here :
- Which parameters to pass to Ffmpeg ?
- Do I need to create Ffmpeg process (using
child_process
) with some special options ?
Thank you in advance. Please, take it easy, this is my first question ! :)
-
Anomalie #3227 : Bug date de publication
17 septembre 2014, par 毎日 erational -quelqu’un sur le forum http://forum.spip.net/fr_258722.html signale une erreur de type avec le mktime
-
ffmpeg video duration is not equal to duration after hls process
9 décembre 2022, par Timur KhazhievProblem


For videofile input I preprocess/encode it to
libx264
. Then I'm trying to cut video into 2 second chunks except last one (last one being < 2 seconds) using hls processing

ffmpeg -v error -i video.mp4 -x264-params "keyint=60:min-keyint=60:scenecut=0" 
-hls_time 2 -hls_list_size 0 -hls_segment_filename chunk%03d.ts index.m3u8



which follows this problem


then looking into
index.m3u8
file reveals that sum of all chunks' durations does not add up to original video duration :

% ffprobe -loglevel quiet -print_format flat -show_entries format=duration index.m3u8 

format.duration="204.880000"

% ffprobe -loglevel quiet -print_format flat -show_entries format=duration video.mp4 

format.duration="204.892813"



Moreover duration of a chunk in
index.m3u8
is not the same as in chunk file.

% ffprobe -loglevel quiet -print_format flat -show_entries format=duration chunk000.ts

format.duration="2.023222"

% cat index.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:2.000000,
chunk000.ts
#EXTINF:2.000000,
chunk001.ts
#EXTINF:2.000000,
chunk002.ts
...



Misc


Used these videos : Me at the zoo and I finally found a useful monorail.


OS : macos Monterey 12.3.1 (21E258)


ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
built with Apple clang version 14.0.0 (clang-1400.0.29.102)
configuration: --prefix=/usr/local/Cellar/ffmpeg/5.1.2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100



What I tried


- 

- Preprocess/transcode video before proceeding with hls
- Force keyframes before proceeding with hls
- Use 1, 3, 4 seconds chunks
- Use different GOP sizes
-hls_flags split_by_time












but it leads to same result or very unequal chunks


Questions


- 

- Is it ok or I'm missing something ?
- If not, what parameters/options should I use to force chunks to be precisely 2 seconds ?