
Recherche avancée
Autres articles (26)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
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 -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (6016)
-
FFMPEG hanging on a frame while streaming to YouTube (streaming incomplete video) - no errors
12 janvier 2024, par ThePrinceI have a Flask application that is running an FFMPEG command.


- 

- I extract frames from a local video file (7 seconds long, 235 frames) and process each frame into a JPEG format. I then restream the images one by one to youtube through the pipe (stdin).
- Simultaneously, I extract the video from the original file and I use -copy to just use the audio from the original file.






Here is my command which I run in python :


command = [
 'ffmpeg',
 '-loglevel', 'trace', # detailed log level
 
 # VIDEO STREAM
 '-f', 'image2pipe',
 '-c:v', 'mjpeg',
 '-i', '-', 

 # AUDIO STREAM
 '-i', f"{input_folder}{filename}", 

 # MAPPING
 '-map', '0:v', # video from the pipe
 '-map', '1:a', # audio from original file

 # OUTPUT STREAM
 '-c:v', 'libx264', # video codec
 '-c:a', 'copy', # copy from original
 
 '-f', 'flv',
 f'{youtube_url}{stream_key}'
]



I get all the debugging info in the console.
It stops on frame 179 out of 235 frames and just hangs there.


frame= 179 fps=4.2 q=28.0 size= 1020kB time=00:00:07.08 bitrate=1180.8kbits/s speed=0.165x



Ignore the FPS and speed since these are just the effect of it hanging. The FPS and speed will decrease gradually each second that passes.


After I Ctrl+C out of it, I see that all 235 frames were encoded and only 180 were muxed.


I increased the buffer size in case that was the issue and it seemed to mux all of them, but the content was still cut short.


To be clear, in my YouTube stream I only got the first 5 out of 7 seconds of video before cutting off.


When I increased the buffer, it hung only on the very last frame... and showed no errors, but again the output video was 7 seconds and was cut short.


A typical output from the log is this :


[libx264 @ 0000021e913b67c0] frame= 233 QP=25.95 NAL=2 Slice:P Poc:106 I:21 P:310 SKIP:1289 size=3403 bytes
[mjpeg @ 0000021e913f9240] marker=d8 avail_size_in_buf=68061
[mjpeg @ 0000021e913f9240] marker parser used 0 bytes (0 bits)
[mjpeg @ 0000021e913f9240] marker=e0 avail_size_in_buf=68059
[mjpeg @ 0000021e913f9240] marker parser used 16 bytes (128 bits)
[mjpeg @ 0000021e913f9240] marker=db avail_size_in_buf=68041
[mjpeg @ 0000021e913f9240] index=0
[mjpeg @ 0000021e913f9240] qscale[0]: 3
[mjpeg @ 0000021e913f9240] marker parser used 67 bytes (536 bits)
[mjpeg @ 0000021e913f9240] marker=db avail_size_in_buf=67972
[mjpeg @ 0000021e913f9240] index=1
[mjpeg @ 0000021e913f9240] qscale[1]: 6
[mjpeg @ 0000021e913f9240] marker parser used 67 bytes (536 bits)
[mjpeg @ 0000021e913f9240] marker=c0 avail_size_in_buf=67903
[mjpeg @ 0000021e913f9240] sof0: picture: 852x480
[mjpeg @ 0000021e913f9240] component 0 2:2 id: 1 quant:0
[mjpeg @ 0000021e913f9240] component 1 1:1 id: 2 quant:1
[mjpeg @ 0000021e913f9240] component 2 1:1 id: 3 quant:1
[mjpeg @ 0000021e913f9240] pix fmt id 22111100
[mjpeg @ 0000021e913f9240] marker parser used 17 bytes (136 bits)
[mjpeg @ 0000021e913f9240] marker=c4 avail_size_in_buf=67884
[mjpeg @ 0000021e913f9240] class=0 index=0 nb_codes=12
[mjpeg @ 0000021e913f9240] marker parser used 31 bytes (248 bits)
[mjpeg @ 0000021e913f9240] marker=c4 avail_size_in_buf=67851
[mjpeg @ 0000021e913f9240] class=1 index=0 nb_codes=162
[mjpeg @ 0000021e913f9240] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0000021e913f9240] marker=c4 avail_size_in_buf=67668
[mjpeg @ 0000021e913f9240] class=0 index=1 nb_codes=12
[mjpeg @ 0000021e913f9240] marker parser used 31 bytes (248 bits)
[mjpeg @ 0000021e913f9240] marker=c4 avail_size_in_buf=67635
[mjpeg @ 0000021e913f9240] class=1 index=1 nb_codes=162
[mjpeg @ 0000021e913f9240] marker parser used 181 bytes (1448 bits)
[mjpeg @ 0000021e913f9240] escaping removed 740 bytes
[mjpeg @ 0000021e913f9240] marker=da avail_size_in_buf=67452
[mjpeg @ 0000021e913f9240] component: 1
[mjpeg @ 0000021e913f9240] component: 2
[mjpeg @ 0000021e913f9240] component: 3
[mjpeg @ 0000021e913f9240] marker parser used 66711 bytes (533681 bits)
[mjpeg @ 0000021e913f9240] marker=d9 avail_size_in_buf=0
[mjpeg @ 0000021e913f9240] decode frame unused 0 bytes
[libx264 @ 0000021e913b67c0] frame= 234 QP=26.34 NAL=2 Slice:P Poc:108 I:23 P:368 SKIP:1229 size=3545 bytes



There really are no errors other than not finding end of file when it hangs and I Ctrl+C.


I have tested the following :


- 

- I decided to loop Frame #1 repeatedly to make sure it wasn't the actual frame content that was the issue (problem still remained).
- I adjusted buffer size, fps, re, FPS on both sources and target.
- I even switched to another video and it still hung.
- When I tried a higher definition video it would hang at a later frame (since there were more frames to work with) but it still would hang close to the 5 second mark on a 7 second video.
- I also changed the audio to a silent stream and it didn't work (same issue happened).
- I even changed the output target to an actual mp4 file instead of a youtube stream, and the output video was cut off !














Note : I notice the default FPS is 25 for the video stream, yet the original FPS from video was 30 FPS so I don't know if this might be causing the issue.


Guys I'm ready to throw in the towel here. I read the ffmpeg documentation in detail and nothing helped (also the online chatrooms for ffmpeg don't work). Looked at video tutorials and learned deeply about MPEG. I am lost for what to do and ready to move on to another tool.


-
ffmpeg Output file #0 does not contain any stream during the extraction of audio from a .webm file
17 mai 2023, par Leomy objective is to extract frames and corresponding audio from a .webm file.


The problem comes when I am extracting the audio from the .webm file.


When I try to extract the audio from the .webm.
ffmpeg -i _5rNOD1nsDg.webm -vn -y -ar 44100 -ac 2 output.wav


I get something like below and there is not any .wav file generated.

ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 11 (Ubuntu 11.2.0-19ubuntu1) configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 Input #0, matroska,webm, from '_5rNOD1nsDg.webm': Metadata: encoder : google/video-file Duration: 00:10:08.96, start: 0.000000, bitrate: 18219 kb/s Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709), 3840x2160, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Output #0, wav, to 'output.wav': Output file #0 does not contain any stream


-
Added option to group files in one XHR request based on their file size and the upload file size limit
15 novembre 2013, par ottensAdded option to group files in one XHR request based on their file size and the upload file size limit
If your upload limit is say 1MB and you have 100 files of 20Kb you could set the limitMultiFileUploads to 50 to minimize requests. However is there is one 30kb file the batch containing that group will fail. So I coded an uploadSizeLimitMultiFileUploads option that will calculate the max number of files that fit in one request based on a set upload size. I added a 512 bytes overhead for each file for the calculations to be on the safe side. Hope you find these useful, it is very useful if you want to upload 1000s of small files. Thanks
Signed-off-by : Maarten Ottens <m@maartenottens.com>