
Recherche avancée
Autres articles (11)
-
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...) -
Les statuts des instances de mutualisation
13 mars 2010, parPour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...) -
Problèmes fréquents
10 mars 2010, parPHP et safe_mode activé
Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site
Sur d’autres sites (2606)
-
ffmpeg : Concatenating webm files - output file shows first video only
12 juillet 2016, par Bora B.I have 6 webm files (video/audio) which I captured through WebRTC (web browser getUserMedia API). Individually they all play fine. They’re all 15 seconds in length and 2MB in size each.
When I concatenate them with ffmpeg using concat demuxer (documentation), the resulting output file is 12MB (wchich I expect), but when I play it , it only plays the first video and then it stops after 15 seconds. Tried playing it with Google Chrome as well as VLC.
This is the ffmpeg command I am using :
ffmpeg -f concat -i mylist.txt -c copy output3.webm
And here is mylist.txt :
file 'tmpD08D.webm'
file 'tmpD08E.webm'
file 'tmpD08F.webm'
file 'tmpD090.webm'
file 'tmpD091.webm'
file 'tmpD0A1.webm'Here is the ffmpeg output :
c:\Temp\files>ffmpeg -f concat -i mylist.txt -c copy output4.webm
ffmpeg version N-72383-g7206b94 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopenc
ore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --ena
ble-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable
-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enabl
e-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable
-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --e
nable-lzma --enable-decklink --enable-zlib
libavutil 54. 26.100 / 54. 26.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 33.101 / 56. 33.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, concat, from 'mylist.txt':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Audio: opus, 48000 Hz, mono, fltp
Stream #0:1: Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 30 fps, 30 tbr,
1k tbn, 1k tbc
[webm @ 00000000003a5fe0] Codec for stream 0 does not use global headers but con
tainer format requires global headers
[webm @ 00000000003a5fe0] Codec for stream 1 does not use global headers but con
tainer format requires global headers
Output #0, webm, to 'output4.webm':
Metadata:
encoder : Lavf56.33.101
Stream #0:0: Video: vp8, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 30 fps,
30 tbr, 1k tbn, 1k tbc
Stream #0:1: Audio: opus, 48000 Hz, mono
Stream mapping:
Stream #0:1 -> #0:0 (copy)
Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[concat @ 0000000000361e20] DTS 0 < 14911 out of order
[webm @ 00000000003a5fe0] Non-monotonous DTS in output stream 0:0; previous: 149
11, current: 0; changing to 14911. This may result in incorrect timestamps in th
e output file.
[webm @ 00000000003a5fe0] Non-monotonous DTS in output stream 0:0; previous: 149
11, current: 48; changing to 14911. This may result in incorrect timestamps in t
he output file.
[webm @ 00000000003a5fe0] Non-monotonous DTS in output stream 0:1; previous: 148
69, current: 59; changing to 14869. This may result in incorrect timestamps in t
he output file.Note that I see a lot of "Non-monotonous DTS in output stream " errors in the ffmpeg output.
What am I doing wrong here ?
-
Extracting each individual frame from an H264 stream for real-time analysis with OpenCV
5 mai 2017, par exclmtnptProblem Outline
I have an h264 real-time video stream (I’ll call this "the stream") being captured in Process1. My goal is to extract each frame from the stream as it comes through and use Process2 to analyze it with OpenCV. (Process1 is nodejs, Process2 is Python)
Things I’ve tried, and their failure modes :
- Send the stream directly from one Process1 to Process2 over a named fifo pipe :
I succeeded in directing the stream from Process1 into the pipe. However, in Process2 (which is Python) I could not (a) extract individual frames from the stream, and (b) convert any extracted data from h264 into an OpenCV format (e.g. JPEG, numpy array).
I had hoped to use OpenCV’s VideoCapture() method, but it does not allow you to pass a FIFO pipe as an input. I was able to use VideoCapture by saving the h264 stream to a .h264 file, and then passing that as the file path. This doesn’t help me, because I need to do my analysis in real time (i.e. I can’t save the stream to a file before reading it in to OpenCV).
- Pipe the stream from Process1 to FFMPEG, use FFMPEG to change the stream format from h264 to MJPEG, then pipe the output to Process2 :
I attempted this using the command :
cat pipeFromProcess1.fifo | ffmpeg -i pipe:0 -f h264 -f mjpeg pipe:1 | cat > pipeToProcess2.fifo
The biggest issue with this approach is that FFMPEG takes inputs from Process1 until Process1 is killed, and only then does Process2 begin to receive the data.
Additionally, on the Process2 side, I still don’t understand how to extract individual frames from the data coming over the pipe. I open the pipe for reading (as "f") and then execute data = f.readline(). The size of data varies drastically (some reads have length on the order of 100, others length on the order of 1,000). When I use f.read() instead of f.readline(), the length is much larger, on the order of 100,000.
If I were to know that I was getting the correct size chunk of data, I would still not know how to transform it into an OpenCV-compatible array because I don’t understand the format it’s coming over in. It’s a string, but when I print it out it looks like this :
��_M 0A0����tQ,\%��e���f/�H�#Y�p�f#�Kus�} F����ʳa�G������+$x�%V�� }[����Wo �1’̶A���c����*�&=Z^�o’��Ͽ� SX-ԁ涶V&H|��$
��<�E�� ��>�����u���7�����cR� �f�=�9 ��fs�q�ڄߧ�9v�]�Ӷ���& gr]�n�IRܜ�檯����
� ����+ �I��w�}� ��9�o��� �w��M�m���IJ ��� �m�=�Soՙ}S �>j �,�ƙ�’���tad =i ��WY�FeC֓z �2�g� ;EXX��S��Ҁ*, ���w� _|�&�y��H��=��)� ���Ɗ3@ �h���Ѻ�Ɋ��ZzR`��)�y�� c�ڋ.��v� !u���� �S�I#�$9R�Ԯ0py z ��8 #��A�q�� �͕� ijc �bp=��۹ c SqHConverting from base64 doesn’t seem to help. I also tried :
array = np.fromstring(data, dtype=np.uint8)
which does convert to an array, but not one of a size that makes sense based on the 640x368x3 dimensions of the frames I’m trying to decode.
- Using decoders such as Broadway.js to convert the h264 stream :
These seem to be focused on streaming to a website, and I did not have success trying to re-purpose them for my goal.
Clarification about what I’m NOT trying to do :
I’ve found many related questions about streaming h264 video to a website. This is a solved problem, but none of the solutions help me extract individual frames and put them in an OpenCV-compatible format.
Also, I need to use the extracted frames in real time on a continual basis. So saving each frame as a .jpg is not helpful.
System Specs
Raspberry Pi 3 running Raspian Jessie
Additional Detail
I’ve tried to generalize the problem I’m having in my question. If it’s useful to know, Process1 is using the node-bebop package to pull down the h264 stream (using drone.getVideoStream()) from a Parrot Bebop 2.0. I tried using the other video stream available through node-bebop (getMjpegStream()). This worked, but was not nearly real-time ; I was getting very intermittent data streams. I’ve entered that specific problem as an Issue in the node-bebop repository.
Thanks for reading ; I really appreciate any help anyone can give !
-
Why ffmpeg shows 2 bitrates ? How to change the second one ?
31 juillet 2016, par 5argonI was comparing why my video plays poorly in my application. So I would like to compare with the video that works fine with
ffmpeg -i file
The one that is working
Duration: 00:02:19.96, start: 0.540000, bitrate: 1159 kb/s
Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p(tv), 640x480 [SAR 1:1 DAR 4:3], 1150 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbcThis one does not work fine
Duration: 00:02:15.24, start: 0.533367, bitrate: 980 kb/s
Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p(tv), 256x256 [SAR 1:1 DAR 1:1], 104857 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbcI notice
104857 kb/s
in my video which probably cause the performance problem but what is it ? I could not find information about how to read this output. Bitrate seems to be 980 kb/s, so what is this another kb/s ? When I specify bitrate using-vb
it seems to affect only the first one.