
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (69)
-
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 -
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. -
MediaSPIP Init et Diogène : types de publications de MediaSPIP
11 novembre 2010, parÀ l’installation d’un site MediaSPIP, le plugin MediaSPIP Init réalise certaines opérations dont la principale consiste à créer quatre rubriques principales dans le site et de créer cinq templates de formulaire pour Diogène.
Ces quatre rubriques principales (aussi appelées secteurs) sont : Medias ; Sites ; Editos ; Actualités ;
Pour chacune de ces rubriques est créé un template de formulaire spécifique éponyme. Pour la rubrique "Medias" un second template "catégorie" est créé permettant d’ajouter (...)
Sur d’autres sites (10607)
-
ffmpeg : corrupt audio in usage of avfoundation
3 janvier 2016, par AndyI am trying to record my desktop screen (MacBook Pro (Retina, 15-inch, Mid 2014), OSX 10.10.5) with audio. First, I have to find the devices for recording, video:1 and audio:0 in my case.
User@User-MacBook-Pro:~/test$ ffmpeg -hide_banner -f avfoundation -list_devices true -i ""
[AVFoundation input device @ 0x7ff19a422320] AVFoundation video devices:
[AVFoundation input device @ 0x7ff19a422320] [0] FaceTime HD Camera
[AVFoundation input device @ 0x7ff19a422320] [1] Capture screen 0
[AVFoundation input device @ 0x7ff4b9c22320] [2] Capture screen 1
[AVFoundation input device @ 0x7ff19a422320] AVFoundation audio devices:
[AVFoundation input device @ 0x7ff19a422320] [0] Soundflower (2ch)
[AVFoundation input device @ 0x7ff19a422320] [1] Built-in Microphone
[AVFoundation input device @ 0x7ff19a422320] [2] Soundflower (64ch)
: Input/output errorThen I run to capture the screen :
ffmpeg -f avfoundation -i "1:0" out_desktop.mkv
and the audio of the output stutters terribly.
But if I use the second external screen (which is connect via HDMI) :ffmpeg -f avfoundation -i "2:0" out_ext.mkv
Then I have no audio problems.
So, what could be the cause of this behaviour ? Somehow the video device "Capture screen 0" causes the audio stutter.
Here are the full outputs of the two commands above, Screen 0 :
User@User-MacBook-Pro:~/test$ ffmpeg -f avfoundation -i "1:0" out.mkv
ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[avfoundation @ 0x7fca1200da00] Selected pixel format (yuv420p) is not supported by the input device.
[avfoundation @ 0x7fca1200da00] Supported pixel formats:
[avfoundation @ 0x7fca1200da00] uyvy422
[avfoundation @ 0x7fca1200da00] yuyv422
[avfoundation @ 0x7fca1200da00] nv12
[avfoundation @ 0x7fca1200da00] 0rgb
[avfoundation @ 0x7fca1200da00] bgr0
[avfoundation @ 0x7fca1200da00] Overriding selected pixel format to use uyvy422 instead.
[avfoundation @ 0x7fca1200da00] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, avfoundation, from '1:0':
Duration: N/A, start: 11734.092500, bitrate: 2822 kb/s
Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 2880x1800, 1000k tbr, 1000k tbn, 1000k tbc
Stream #0:1: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
File 'out.mkv' already exists. Overwrite ? [y/N] y
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7fca1390e000] MB rate (20340000000) > level limit (2073600)
[libx264 @ 0x7fca1390e000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7fca1390e000] profile High 4:2:2, level 5.2, 4:2:2 8-bit
[libx264 @ 0x7fca1390e000] 264 - core 148 r2601 a0cd7d3 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'out.mkv':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv422p, 2880x1800, q=-1--1, 1000k fps, 1k tbn, 1000k tbc
Metadata:
encoder : Lavc56.60.100 libx264
Stream #0:1: Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 44100 Hz, stereo, fltp
Metadata:
encoder : Lavc56.60.100 libvorbis
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (pcm_f32le (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
frame= 969 fps= 29 q=-1.0 Lsize= 6911kB time=00:00:34.80 bitrate=1626.8kbits/s
video:6475kB audio:396kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 0.591309%
[libx264 @ 0x7fca1390e000] frame I:4 Avg QP:15.77 size:1461092
[libx264 @ 0x7fca1390e000] frame P:246 Avg QP:16.00 size: 2608
[libx264 @ 0x7fca1390e000] frame B:719 Avg QP:13.91 size: 200
[libx264 @ 0x7fca1390e000] consecutive B-frames: 0.9% 0.4% 0.0% 98.7%
[libx264 @ 0x7fca1390e000] mb I I16..4: 11.6% 43.3% 45.2%
[libx264 @ 0x7fca1390e000] mb P I16..4: 0.0% 0.0% 0.1% P16..4: 0.4% 0.0% 0.0% 0.0% 0.0% skip:99.5%
[libx264 @ 0x7fca1390e000] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.2% 0.0% 0.0% direct: 0.0% skip:99.8% L0:39.9% L1:60.0% BI: 0.1%
[libx264 @ 0x7fca1390e000] 8x8 transform intra:41.6% inter:38.8%
[libx264 @ 0x7fca1390e000] coded y,uvDC,uvAC intra: 76.9% 77.9% 75.5% inter: 0.0% 0.1% 0.0%
[libx264 @ 0x7fca1390e000] i16 v,h,dc,p: 51% 34% 11% 4%
[libx264 @ 0x7fca1390e000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 17% 19% 7% 4% 3% 8% 5% 16%
[libx264 @ 0x7fca1390e000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 24% 10% 7% 6% 5% 8% 7% 12%
[libx264 @ 0x7fca1390e000] i8c dc,h,v,p: 59% 14% 18% 9%
[libx264 @ 0x7fca1390e000] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fca1390e000] ref P L0: 71.5% 3.4% 13.0% 12.1%
[libx264 @ 0x7fca1390e000] ref B L0: 46.6% 52.3% 1.1%
[libx264 @ 0x7fca1390e000] ref B L1: 95.1% 4.9%
[libx264 @ 0x7fca1390e000] kb/s:1525.48and Screen 1 :
User@User-MacBook-Pro:~/test$ ffmpeg -f avfoundation -i "2:0" out.mkv
ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[avfoundation @ 0x7fc2e900da00] Selected pixel format (yuv420p) is not supported by the input device.
[avfoundation @ 0x7fc2e900da00] Supported pixel formats:
[avfoundation @ 0x7fc2e900da00] uyvy422
[avfoundation @ 0x7fc2e900da00] yuyv422
[avfoundation @ 0x7fc2e900da00] nv12
[avfoundation @ 0x7fc2e900da00] 0rgb
[avfoundation @ 0x7fc2e900da00] bgr0
[avfoundation @ 0x7fc2e900da00] Overriding selected pixel format to use uyvy422 instead.
[avfoundation @ 0x7fc2e900da00] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, avfoundation, from '2:0':
Duration: N/A, start: 11809.126333, bitrate: 2822 kb/s
Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 2560x1080, 1000k tbr, 1000k tbn, 1000k tbc
Stream #0:1: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
File 'out.mkv' already exists. Overwrite ? [y/N] y
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7fc2ea82ac00] MB rate (10880000000) > level limit (2073600)
[libx264 @ 0x7fc2ea82ac00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7fc2ea82ac00] profile High 4:2:2, level 5.2, 4:2:2 8-bit
[libx264 @ 0x7fc2ea82ac00] 264 - core 148 r2601 a0cd7d3 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'out.mkv':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv422p, 2560x1080, q=-1--1, 1000k fps, 1k tbn, 1000k tbc
Metadata:
encoder : Lavc56.60.100 libx264
Stream #0:1: Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 44100 Hz, stereo, fltp
Metadata:
encoder : Lavc56.60.100 libvorbis
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (pcm_f32le (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
frame= 755 fps= 30 q=-1.0 Lsize= 1025kB time=00:00:26.65 bitrate= 315.1kbits/s
video:680kB audio:326kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 2.003084%
[libx264 @ 0x7fc2ea82ac00] frame I:4 Avg QP:13.22 size:145661
[libx264 @ 0x7fc2ea82ac00] frame P:191 Avg QP:19.87 size: 250
[libx264 @ 0x7fc2ea82ac00] frame B:560 Avg QP:28.31 size: 116
[libx264 @ 0x7fc2ea82ac00] consecutive B-frames: 1.1% 0.0% 0.4% 98.5%
[libx264 @ 0x7fc2ea82ac00] mb I I16..4: 54.5% 29.2% 16.2%
[libx264 @ 0x7fc2ea82ac00] mb P I16..4: 0.2% 0.1% 0.0% P16..4: 0.1% 0.0% 0.0% 0.0% 0.0% skip:99.6%
[libx264 @ 0x7fc2ea82ac00] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.3% 0.0% 0.0% direct: 0.0% skip:99.7% L0:69.2% L1:30.8% BI: 0.0%
[libx264 @ 0x7fc2ea82ac00] 8x8 transform intra:31.7% inter:13.1%
[libx264 @ 0x7fc2ea82ac00] coded y,uvDC,uvAC intra: 10.9% 8.8% 8.5% inter: 0.0% 0.0% 0.0%
[libx264 @ 0x7fc2ea82ac00] i16 v,h,dc,p: 69% 31% 0% 0%
[libx264 @ 0x7fc2ea82ac00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 5% 67% 0% 0% 0% 0% 0% 0%
[libx264 @ 0x7fc2ea82ac00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38% 25% 14% 3% 3% 4% 5% 4% 5%
[libx264 @ 0x7fc2ea82ac00] i8c dc,h,v,p: 92% 3% 4% 0%
[libx264 @ 0x7fc2ea82ac00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fc2ea82ac00] ref P L0: 76.3% 1.7% 16.8% 5.2%
[libx264 @ 0x7fc2ea82ac00] ref B L0: 38.9% 56.9% 4.2%
[libx264 @ 0x7fc2ea82ac00] ref B L1: 97.3% 2.7%
[libx264 @ 0x7fc2ea82ac00] kb/s:208.84EDIT
The main differences between the two (lengthy) outputs above via
wdiff -n output1 output2 |colordiff
is the resolution (
[-2880x1800,-] {+2560x1080,+}
) and the resulting MB rate ([-(20340000000)-] {+(10880000000)+}
). So, what could increase the performance offfmpeg
? -
i use vitamio-ffmpeg achieve filters function,who can help me to see [on hold]
30 décembre 2015, par 陈腾明my cmd is :
ffmpeg -y -i /storage/emulated/0/Foream/a.mp4 -i /storage/emulated/0/Foream/q.jpg -filter_complex [0:v][1:v]overlay=main_w-overlay_w-10:main_h-overlay_h-10[out] -map [out] -map 0:a -codec:a copy /storage/test.mp4-
ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers
built on Dec 30 2015 17:40:40 with gcc 4.8 (GCC)
configuration: --arch=arm --disable-runtime-cpudetect --target-os=linux --enable-cross-compile --cross-prefix=arm-linux-androideabi- --enable-version3 --enable-optimizations --enable-shared --disable-fast-unaligned --disable-static --disable-symver --disable-programs --disable-doc --disable-avdevice --disable-postproc --disable-encoders --disable-muxers --enable-muxer=mp4 --disable-devices --disable-demuxer=sbg --disable-demuxer=dts --disable-parser=dca --disable-decoder=dca --disable-decoder=svq3 --disable-debug --enable-network --enable-asm --prefix=/var/vitamio/FFmpeg-Vitamio-vitamio/build/android/armv6 --extra-cflags='-mthumb -std=c99 -O3 -Wall -pipe -fpic -fasm -finline-limit=300 -ffast-math -fstrict-aliasing -Werror=strict-aliasing -Wno-psabi -Wa,--noexecstack -fdiagnostics-color=always -DANDROID -DNDEBUG -I/var/openssl/OpenSSL-Vitamio-master/include -D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ -march=armv6 -msoft-float' --extra-ldflags='-lm -lz -Wl,--no-undefined -Wl,-z,no WARNING: library configuration mismatch
avutil configuration: --arch=arm --disable-runtime-cpudetect --target-os=linux --cross-prefix=arm-linux-androideabi- --enable-cross-compile --enable-version3 --enable-shared --disable-static --disable-symver --disable-programs --disable-doc --disable-avdevice --disable-encoders --disable-muxers --disable-devices --disable-everything --disable-protocols --disable-demuxers --disable-decoders --disable-bsfs --disable-debug --enable-optimizations --enable-filters --enable-parsers --disable-parser=hevc --enable-swscale --enable-network --enable-protocol=file --enable-protocol=http --enable-protocol=rtmp --enable-protocol=rtp --enable-protocol=mmst --enable-protocol=mmsh --enable-protocol=crypto --enable-protocol=hls --enable-demuxer=hls --enable-demuxer=mpegts --enable-demuxer=mpegtsraw --enable-demuxer=mpegvideo --enable-demuxer=concat --enable-demuxer=mov --enable-demuxer=flv --enable-demuxer=rtsp --enable-demuxer=mp3 --enable-demuxer=matroska --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-de avcodec configuration: --arch=arm --disable-runtime-cpudetect—target-os=linux —cross-prefix=arm-linux-androideabi- —enable-cross-compile —enable-version3 —enable-shared —disable-static —disable-symver —disable-programs —disable-doc —disable-avdevice —disable-encoders —disable-muxers —disable-devices —disable-everything —disable-protocols —disable-demuxers —disable-decoders —disable-bsfs —disable-debug —enable-optimizations —enable-filters —enable-parsers —disable-parser=hevc —enable-swscale —enable-network —enable-protocol=file —enable-protocol=http —enable-protocol=rtmp —enable-protocol=rtp —enable-protocol=mmst —enable-protocol=mmsh —enable-protocol=crypto —enable-protocol=hls —enable-demuxer=hls —enable-demuxer=mpegts —enable-demuxer=mpegtsraw —enable-demuxer=mpegvideo —enable-demuxer=concat —enable-demuxer=mov —enable-demuxer=flv —enable-demuxer=rtsp —enable-demuxer=mp3 —enable-demuxer=matroska —enable-decoder=mpeg4 —enable-decoder=mpegvideo —enable-de avformat configuration : —arch=arm —disable-runtime-cpudetect
— target-os=linux —cross-prefix=arm-linux-androideabi- —enable-cross-compile —enable-version3 —enable-shared —disable-static —disable-symver —disable-programs —disable-doc —disable-avdevice —disable-encoders —disable-muxers —disable-devices —disable-everything —disable-protocols —disable-demuxers —disable-decoders —disable-bsfs —disable-debug —enable-optimizations —enable-filters —enable-parsers —disable-parser=hevc —enable-swscale —enable-network —enable-protocol=file —enable-protocol=http —enable-protocol=rtmp —enable-protocol=rtp —enable-protocol=mmst —enable-protocol=mmsh —enable-protocol=crypto —enable-protocol=hls —enable-demuxer=hls —enable-demuxer=mpegts —enable-demuxer=mpegtsraw —enable-demuxer=mpegvideo —enable-demuxer=concat —enable-demuxer=mov —enable-demuxer=flv —enable-demuxer=rtsp —enable-demuxer=mp3 —enable-demuxer=matroska —enable-decoder=mpeg4 —enable-decoder=mpegvideo —enable-de avfilter configuration : —arch=arm —disable-runtime-cpudetect
— target-os=linux —cross-prefix=arm-linux-androideabi- —enable-cross-compile —enable-version3 —enable-shared —disable-static —disable-symver —disable-programs —disable-doc —disable-avdevice —disable-encoders —disable-muxers —disable-devices —disable-everything —disable-protocols —disable-demuxers —disable-decoders —disable-bsfs —disable-debug —enable-optimizations —enable-filters —enable-parsers —disable-parser=hevc —enable-swscale —enable-network —enable-protocol=file —enable-protocol=http —enable-protocol=rtmp —enable-protocol=rtp —enable-protocol=mmst —enable-protocol=mmsh —enable-protocol=crypto —enable-protocol=hls —enable-demuxer=hls —enable-demuxer=mpegts —enable-demuxer=mpegtsraw —enable-demuxer=mpegvideo —enable-demuxer=concat —enable-demuxer=mov —enable-demuxer=flv —enable-demuxer=rtsp —enable-demuxer=mp3 —enable-demuxer=matroska —enable-decoder=mpeg4 —enable-decoder=mpegvideo —enable-de swscale configuration : —arch=arm —disable-runtime-cpudetect
— target-os=linux —cross-prefix=arm-linux-androideabi- —enable-cross-compile —enable-version3 —enable-shared —disable-static —disable-symver —disable-programs —disable-doc —disable-avdevice —disable-encoders —disable-muxers —disable-devices —disable-everything —disable-protocols —disable-demuxers —disable-decoders —disable-bsfs —disable-debug —enable-optimizations —enable-filters —enable-parsers —disable-parser=hevc —enable-swscale —enable-network —enable-protocol=file —enable-protocol=http —enable-protocol=rtmp —enable-protocol=rtp —enable-protocol=mmst —enable-protocol=mmsh —enable-protocol=crypto —enable-protocol=hls —enable-demuxer=hls —enable-demuxer=mpegts —enable-demuxer=mpegtsraw —enable-demuxer=mpegvideo —enable-demuxer=concat —enable-demuxer=mov —enable-demuxer=flv —enable-demuxer=rtsp —enable-demuxer=mp3 —enable-demuxer=matroska —enable-decoder=mpeg4 —enable-decoder=mpegvideo —enable-de swresample configuration : —arch=arm —disable-runtime-cpudetect
— target-os=linux —cross-prefix=arm-linux-androideabi- —enable-cross-compile —enable-version3 —enable-shared —disable-static —disable-symver —disable-programs —disable-doc —disable-avdevice —disable-encoders —disable-muxers —disable-devices —disable-everything —disable-protocols —disable-demuxers —disable-decoders —disable-bsfs —disable-debug —enable-optimizations —enable-filters —enable-parsers —disable-parser=hevc —enable-swscale —enable-network —enable-protocol=file —enable-protocol=http —enable-protocol=rtmp —enable-protocol=rtp —enable-protocol=mmst —enable-protocol=mmsh —enable-protocol=crypto —enable-protocol=hls —enable-demuxer=hls —enable-demuxer=mpegts —enable-demuxer=mpegtsraw —enable-demuxer=mpegvideo —enable-demuxer=concat —enable-demuxer=mov —enable-demuxer=flv —enable-demuxer=rtsp —enable-demuxer=mp3 —enable-demuxer=matroska —enable-decoder=mpeg4 —enable-decoder=mpegvideo —enable-de libavutil 52. 48.100 / 52. 48.100
libavcodec 55. 39.100 / 55. 39.100
libavformat 55. 19.104 / 55. 19.104
libavfilter 3. 90.100 / 3. 90.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
Splitting the commandline.
Reading option ’-y’ ... matched as option ’y’ (overwrite output files) with argument ’1’.
Reading option ’-i’ ... matched as input file with argument ’/storage/emulated/0/Foream/a.mp4’.
Reading option ’-i’ ... matched as input file with argument ’/storage/emulated/0/Foream/q.jpg’.
Reading option ’-filter_complex’ ... matched as option ’filter_complex’ (create a complex filtergraph) with argument
’[0:v][1:v]overlay=main_w-overlay_w-10:main_h-overlay_h-10[out]’.
Reading option ’-map’ ... matched as option ’map’ (set input stream mapping) with argument ’[out]’.
Reading option ’-map’ ... matched as option ’map’ (set input stream mapping) with argument ’0:a’.
Reading option ’-codec:a’ ... matched as option ’codec’ (codec name) with argument ’copy’.
Reading option ’/storage/emulated/0/Foream/test.mp4’ ... matched as output file.
Finished splitting the commandline.
Parsing a group of options : global .
Applying option y (overwrite output files) with argument 1.
Applying option filter_complex (create a complex filtergraph) with argument
[0:v][1:v]overlay=main_w-overlay_w-10:main_h-overlay_h-10[out].
Successfully parsed a group of options.
Parsing a group of options : input file /storage/emulated/0/Foream/a.mp4.
Successfully parsed a group of options.
Opening an input file : /storage/emulated/0/Foream/a.mp4.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9270990] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9270990] ISO : File Type Major Brand : mp42
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9270990] File position before avformat_find_stream_info() is 810040
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9270990] All info found
rfps : 29.416667 0.016512
rfps : 29.416667 0.016512
rfps : 29.500000 0.012847
rfps : 29.500000 0.012847
rfps : 29.583333 0.009693
rfps : 29.666667 0.007050
rfps : 29.750000 0.004918
rfps : 29.833333 0.003298
rfps : 29.916667 0.002188
rfps : 30.000000 0.001590
rfps : 30.083333 0.001503
rfps : 30.166667 0.001928
rfps : 30.250000 0.002863
rfps : 30.333333 0.004310
rfps : 30.333333 0.004310
rfps : 30.416667 0.006268
rfps : 30.416667 0.006268
rfps : 30.500000 0.008737
rfps : 30.500000 0.008737
rfps : 30.583333 0.011717
rfps : 30.583333 0.011717
rfps : 30.666667 0.015208
rfps : 30.666667 0.015208
rfps : 30.750000 0.019211
rfps : 30.750000 0.019211
rfps : 59.500000 0.019673
rfps : 59.583333 0.016176
rfps : 59.666667 0.013191
rfps : 59.750000 0.010716
rfps : 59.833333 0.008753
rfps : 59.916667 0.007302
rfps : 60.000000 0.006361
rfps : 29.970030 0.001747
rfps : 59.940060 0.006986
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9270990] File position after avformat_find_stream_info() is 1684954
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ’/storage/emulated/0/Foream/a.mp4’ :
Metadata :
major_brand : mp42minor_version : 0
compatible_brands: isommp42
creation_time : 2015-11-07 12:30:11
location : +22.5935+113.8685/
location-eng : +22.5935+113.8685/
Duration: 00:00:17.24 , start:0.000000 , bitrate : 9934 kb/s
Stream #0:0 (eng) , 21, 1/90000 : Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 9488 kb/s , SAR
65536:65536 DAR 16:9 , 29.61 fps , 30.08 tbr , 90k tbn , 50 tbc
(default)Metadata:
rotate : 90
creation_time : 2015-11-07 12:30:11
handler_name : VideoHandle
Stream #0:1 (eng) , 49, 1/48000 : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
Metadata:
creation_time : 2015-11-07 12:30:11
handler_name : SoundHandle
Successfully opened the file.
Parsing a group of options: input file /storage/emulated/0/Foream/q.jpg.
Successfully parsed a group of options.
Opening an input file: /storage/emulated/0/Foream/q.jpg.
[mp3 @ 0xb924f040] Format mp3 detected only with low score of 1, misdetection possible!
[mp3 @ 0xb924f040] File position before avformat_find_stream_info() is 0
[mp3 @ 0xb9216ef0] Header missing
[mp3 @ 0xb9216ef0] Header missing
[mp3 @ 0xb9216ef0] Header missing
[mp3 @ 0xb924f040] decoding for stream 0 failed
[mp3 @ 0xb924f040] Could not find codec parameters for stream 0 (Audio: mp1, 0 channels, s16p): unspecified frame size Considerincreasing the value for the ’analyzeduration’ and ’probesize’
options
[mp3 @ 0xb924f040] File position after avformat_find_stream_info() is 9590
/storage/emulated/0/Foream/q.jpg : could not find codec parameters
[AVIOContext @ 0xb9251990] Statistics : 9590 bytes read, 0 seeks
[AVIOContext @ 0xb923e090] Statistics : 907698 bytes read, 1 seeks
-
-
How to pipe sequence of thumbnails/screenshots from ffmpeg to nodejs for further processing ?
30 décembre 2015, par Dmitry IvanovWhat I want to achieve is to take screenshots continuously and pass them to nodejs application in order to process each one separately and do some other stuff. I need this for Linux environment only. I picked
ffmpeg
withx11grab
as a screenshots provider. The following command works just fine :ffmpeg -t 10 -s 1366x768 -f x11grab -i :0.0+0,0 -vf fps=30 output_%d.png -y
It creates 300 consequent frames of my screen during 10 seconds period. Then I want to redirect the output to my nodejs app rather than just to write files on the hard drive. So I’m calling
ffmpeg
from node :var spawn = require('child_process').spawn,
fps = 30,
duration = 10,
screenSize = {w: 1366, h: 768},
args = [
'-t',
duration,
'-s',
screenSize.w + 'x' + screenSize.h,
'-f',
'x11grab',
'-i',
':0.0',
'-vf',
'fps=' + fps,
'-f',
'mjpeg',
'pipe:1'
],
ff = spawn('ffmpeg', args);
ff.stdout.on('data', function (data) {
console.log('Data size: ' + data.length);
});
ff.stdout.on('end', function (data) {
console.log('Stream end');
});
ff.stderr.on('data', function (data) {
console.log('ff error: ' + data);
});I apologize for a long log, but it’s important :
ff error: ffmpeg version N-77455-g4707497 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
libavutil 55. 11.100 / 55. 11.100
libavcodec 57. 20.100 / 57. 20.100
libavformat 57. 20.100 / 57. 20.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 21.101 / 6. 21.101
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
ff error: Input #0, x11grab, from ':0.0':
Duration: N/A, start: 1451414448.216650, bitrate: N/A
Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1366x768, 29.97 fps, 29.97 tbr, 1000k tbn,
ff error: 29.97 tbc
ff error: [swscaler @ 0x34238a0] deprecated pixel format used, make sure you did set range correctly
ff error: Output #0, mjpeg, to 'pipe:1':
Metadata:
encoder :
ff error: Lavf57.20.100
Stream #0:0: Video: mjpeg, yuvj444p(pc), 1366x768, q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc
Metadata:
encoder : Lavc57.20.100 mjpeg
Side data:
unknown side data type 10 (24 bytes)
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
ff error: [swscaler @ 0x34238a0] Warning: data is not aligned! This can lead to a speedloss
Data size: 65536
Data size: 65536
Data size: 21413
Data size: 65536
Data size: 65536
Data size: 45581
Data size: 65536
Data size: 65536
Data size: 62377
Data size: 65536
Data size: 65536
Data size: 45581
Data size: 65536
Data size: 65536
Data size: 21413
Data size: 65536
Data size: 60933
Data size: 65536
Data size: 49550
Data size: 65536
Data size: 36709
Data size: 65536
Data size: 27035
Data size: 65536
Data size: 20131
Data size: 65536
Data size: 15887
Data size: 65536
Data size: 15887
Data size: 65536
Data size: 15887
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15911
ff error: frame= 16 fps=0.0 q=24.8 size= 1819kB time=00:00:00.53 bitrate=27935.6kbits/s speed=1.04x
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15919
Data size: 65536
Data size: 15919
Data size: 65536
Data size: 15919
Data size: 65536
Data size: 15919
Data size: 65536
Data size: 15919
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15906
Data size: 65536
Data size: 15906
Data size: 65536
Data size: 15917
Data size: 65536
Data size: 15999
Data size: 65536
Data size: 15949
Data size: 65536
Data size: 15997
Data size: 65536
Data size: 15965
ff error: frame= 32 fps= 30 q=24.8 size= 3092kB time=00:00:01.06 bitrate=23743.7kbits/s speed=1.01x
Data size: 65536
Data size: 16025
Data size: 65536
Data size: 15978
Data size: 65536
Data size: 15963
Data size: 65536
Data size: 16028
Data size: 65536
Data size: 15976
Data size: 65536
Data size: 15958
Data size: 65536
Data size: 15940
Data size: 65536
Data size: 15992
Data size: 65536
Data size: 15962
Data size: 65536
Data size: 16010
Data size: 65536
Data size: 15941
Data size: 65536
Data size: 15941
Data size: 65536
Data size: 15973
Data size: 65536
Data size: 15943
Data size: 65536
Data size: 15947
Data size: 65536
Data size: 15947
ff error: frame= 48 fps= 30 q=24.8 size= 4365kB time=00:00:01.60 bitrate=22349.6kbits/s speed=1.01x
Data size: 65536
Data size: 15982
Data size: 65536
Data size: 15982
Data size: 65536
Data size: 15956
Data size: 65536
Data size: 15956
Data size: 65536
Data size: 15956
Data size: 65536
Data size: 16001
Data size: 65536
Data size: 15930
Data size: 65536
Data size: 15922
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15985
Data size: 65536
Data size: 15985
ff error: frame= 64 fps= 30 q=24.8 size= 5638kB time=00:00:02.13 bitrate=21651.3kbits/s speed=1.01x
Data size: 65536
Data size: 15985
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15976
Data size: 65536
Data size: 15976
Data size: 65536
Data size: 15958
Data size: 65536
Data size: 16319
Data size: 65536
Data size: 16558
Data size: 65536
Data size: 16576
Data size: 65536
Data size: 16564
Data size: 65536
Data size: 16582
Data size: 65536
Data size: 16589
Data size: 65536
Data size: 16587
Data size: 65536
Data size: 16446
Data size: 65536
Data size: 16450
Data size: 65536
Data size: 16450
Data size: 65536
Data size: 16450
ff error: frame= 80 fps= 30 q=24.8 size= 6918kB time=00:00:02.66 bitrate=21251.0kbits/s speed=1.01x
Data size: 65536
Data size: 16568
Data size: 65536
Data size: 16575
Data size: 65536
Data size: 16585
Data size: 65536
Data size: 18182
Data size: 65536
Data size: 17203
Data size: 65536
Data size: 16769
Data size: 65536
Data size: 16734
Data size: 65536
Data size: 16823
Data size: 65536
Data size: 16338
Data size: 65536
Data size: 16455
Data size: 65536
Data size: 16406
Data size: 65536
Data size: 16645
Data size: 65536
Data size: 16800
Data size: 65536
Data size: 16800
Data size: 65536
Data size: 16800
Data size: 65536
Data size: 16806
ff error: frame= 96 fps= 30 q=24.8 size= 8204kB time=00:00:03.20 bitrate=21001.8kbits/s speed= 1x
Data size: 65536
Data size: 16795
Data size: 65536
Data size: 16804
Data size: 65536
Data size: 16770
Data size: 65536
Data size: 16760
Data size: 65536
Data size: 16813
Data size: 65536
Data size: 16445
Data size: 65536
Data size: 16259
Data size: 65536
Data size: 16260
Data size: 65536
Data size: 16265
Data size: 65536
Data size: 16284
Data size: 65536
Data size: 16233
Data size: 65536
Data size: 16233
Data size: 65536
Data size: 16182
Data size: 65536
Data size: 16058
Data size: 60561
ff error: frame= 111 fps= 30 q=24.8 size= 9384kB time=00:00:03.70 bitrate=20776.1kbits/s speed= 1x
Data size: 61813
Data size: 61813
Data size: 61813
Data size: 61813
Data size: 61813
Data size: 61781
Data size: 61784
Data size: 61796
Data size: 61842
Data size: 61839
Data size: 61793
Data size: 61810
Data size: 61844
Data size: 61844
Data size: 61850
Data size: 61841
ff error: frame= 127 fps= 30 q=24.8 size= 10350kB time=00:00:04.23 bitrate=20027.8kbits/s speed= 1x
Data size: 61858
Data size: 61853
Data size: 61833
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
ff error: frame= 142 fps= 30 q=24.8 size= 11256kB time=00:00:04.73 bitrate=19480.5kbits/s speed= 1x
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
ff error: frame= 158 fps= 30 q=24.8 size= 12223kB time=00:00:05.26 bitrate=19011.4kbits/s speed= 1x
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 173 fps= 30 q=24.8 size= 13129kB time=00:00:05.76 bitrate=18650.3kbits/s speed= 1x
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 188 fps= 30 q=24.8 size= 14035kB time=00:00:06.26 bitrate=18346.6kbits/s speed= 1x
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 203 fps= 30 q=24.8 size= 14941kB time=00:00:06.76 bitrate=18087.8kbits/s speed= 1x
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 219 fps= 30 q=24.8 size= 15907kB time=00:00:07.30 bitrate=17850.8kbits/s speed= 1x
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 234 fps= 30 q=24.8 size= 16813kB time=00:00:07.80 bitrate=17658.1kbits/s speed= 1x
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 250 fps= 30 q=24.8 size= 17780kB time=00:00:08.33 bitrate=17478.0kbits/s speed= 1x
Data size: 61850
Data size: 61712
Data size: 61712
Data size: 61712
Data size: 61712
Data size: 61712
Data size: 61712
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
ff error: frame= 265 fps= 30 q=24.8 size= 18675kB time=00:00:08.83 bitrate=17319.4kbits/s speed= 1x
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
ff error: frame= 280 fps= 30 q=24.8 size= 19563kB time=00:00:09.33 bitrate=17171.2kbits/s speed= 1x
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
ff error: frame= 295 fps= 30 q=24.8 size= 20452kB time=00:00:09.83 bitrate=17038.0kbits/s speed= 1x
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
ff error: frame= 300 fps= 30 q=24.8 Lsize= 20748kB time=00:00:10.00 bitrate=16996.6kbits/s speed=0.998x
video:20748kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Stream endThe error messages are weird too, but not the biggest problem for now, so let’s omit them.
Looking at all the data coming from
ffmpeg
I assume that the images are coming as a single stream without any separation. I don’t think that looking into binary data and seeking for certain flag bytes is a good idea to solve the problem and separate the images. The command line I mentioned in the top of the post does separate writes to hard drive that means it produces separate writable streams per each screenshot. And it doesn’t do so for a spawned process from nodejs.What am I missing ?