
Recherche avancée
Médias (91)
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Echoplex (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Discipline (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Letting you (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
999 999 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (42)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...)
Sur d’autres sites (6981)
-
ffmpeg : fps drop when one -map udp output unreachable [closed]
14 mai 2024, par user25041039I stream a video from a raspberry pi (server) to a splitscreen of 5x5 devices (clients) through an ethernet LAN.


Server


On the server side, I use the following
ffmpeg
command that :

- 

- reads a video list in loop ;
- splits it into 25 different streams ;
- maps each stream to a device through udp.








I also have several options to minimize latency and keep the different subscreens in sync.


ffmpeg -loglevel repeat+level+verbose -re -copyts -start_at_zero -rtbufsize 100000k \
 -stream_loop -1 -f concat -i stream.lst -an \
 -filter_complex "\
 [0]crop=iw/5:ih/5:0*iw/5:0*ih/5[11];
 [0]crop=iw/5:ih/5:1*iw/5:0*ih/5[12];
 [...] # truncated for readability
 [0]crop=iw/5:ih/5:4*iw/5:4*ih/5[55]" \
 -map '[11]?' -flush_packets 1 -preset ultrafast -vcodec libx264 -tune zerolatency -f mpegts "udp://100.64.0.11:1234" \
 -map '[12]?' -flush_packets 1 -preset ultrafast -vcodec libx264 -tune zerolatency -f mpegts "udp://100.64.0.12:1234" \
 [...] # truncated for readability
 -map '[55]?' -flush_packets 1 -preset ultrafast -vcodec libx264 -tune zerolatency -f mpegts "udp://100.64.0.55:1234"



Clients


On the client side, I use
mpv
to read the stream and display it. There are also options for low-latency.

mpv --no-cache --force-seekable=yes --profile=low-latency --untimed --no-audio --video-rotate=90 --fs --no-config --vo=gpu --hwdec=auto udp://100.64.0.1:1234/



My problem


When a device is unreachable through the LAN (eg : powered down), the FPS stated by
ffmpeg
drops after a short period ( 10 seconds), and the stream is laggy (= some frames, then pause for 1s, ...). What I expect is the stream to go on normally, just having one of the subscreens black.

Here is the full log of ffmpeg when I start the stream normally then power down one of the clients after 15s.


[info] ffmpeg version 5.1.4-0+rpt3+deb12u1 Copyright (c) 2000-2023 the FFmpeg developers
[info] built with gcc 12 (Debian 12.2.0-14)
[info] configuration: --prefix=/usr --extra-version=0+rpt3+deb12u1 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --disable-mmal --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-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --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-sand --enable-sdl2 --disable-sndio --enable-libjxl --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
[info] libavutil 57. 28.100 / 57. 28.100
[info] libavcodec 59. 37.100 / 59. 37.100
[info] libavformat 59. 27.100 / 59. 27.100
[info] libavdevice 59. 7.100 / 59. 7.100
[info] libavfilter 8. 44.100 / 8. 44.100
[info] libswscale 6. 7.100 / 6. 7.100
[info] libswresample 4. 7.100 / 4. 7.100
[info] libpostproc 56. 6.100 / 56. 6.100
[h264 @ 0x5555f1407de0] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5555f1407720] [info] Auto-inserting h264_mp4toannexb bitstream filter
[h264 @ 0x5555f140eca0] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[info] Input #0, concat, from 'stream.lst':
[info] Duration: N/A, start: 0.000000, bitrate: 47 kb/s
[info] Stream #0:0(und): Video: h264 (Main), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, progressive, left), 1920x1080 (1920x1088), 47 kb/s, 24 fps, 24 tbr, 12288 tbn
[info] Metadata:
[info] handler_name : Core Media Video
[info] vendor_id : [0][0][0][0]
[info] Stream mapping:
[info] Stream #0:0 (h264) -> crop:default
... truncated
[info] Stream #0:0 (h264) -> crop:default
[info] crop:default -> Stream #0:0 (libx264)
... truncated
[info] crop:default -> Stream #24:0 (libx264)
[info] Press [q] to stop, [?] for help
[h264 @ 0x5555f13fe050] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[graph 0 input from stream 0:0 @ 0x5555f1dfad40] [verbose] w:1920 h:1080 pixfmt:yuv420p tb:1/12288 fr:24/1 sar:0/1
... truncated
[graph 0 input from stream 0:0 @ 0x5555f1e01a50] [verbose] w:1920 h:1080 pixfmt:yuv420p tb:1/12288 fr:24/1 sar:0/1
[Parsed_crop_24 @ 0x5555f1dfa860] [verbose] w:1920 h:1080 sar:0/1 -> w:384 h:216 sar:0/1
... truncated
[Parsed_crop_0 @ 0x5555f1df23e0] [verbose] w:1920 h:1080 sar:0/1 -> w:384 h:216 sar:0/1
[libx264 @ 0x5555f147c220] [info] using cpu capabilities: ARMv8 NEON
[libx264 @ 0x5555f147c220] [info] profile Constrained Baseline, level 1.3, 4:2:0, 8-bit
[mpegts @ 0x5555f148ab70] [verbose] service 1 using PCR in pid=256, pcr_period=83ms
[mpegts @ 0x5555f148ab70] [verbose] muxrate VBR, sdt every 500 ms, pat/pmt every 100 ms
[info] Output #0, mpegts, to 'udp://100.64.0.11:1234':
[info] Metadata:
[info] encoder : Lavf59.27.100
[info] Stream #0:0: Video: h264, 1 reference frame, yuv420p(tv, bt709, progressive, left), 384x216 (0x0), q=2-31, 24 fps, 90k tbn
[info] Metadata:
[info] encoder : Lavc59.37.100 libx264
[info] Side data:
[info] cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
[libx264 @ 0x5555f1428760] [info] using cpu capabilities: ARMv8 NEON
[libx264 @ 0x5555f1428760] [info] profile Constrained Baseline, level 1.3, 4:2:0, 8-bit
[mpegts @ 0x5555f148b080] [verbose] service 1 using PCR in pid=256, pcr_period=83ms
[mpegts @ 0x5555f148b080] [verbose] muxrate VBR, sdt every 500 ms, pat/pmt every 100 ms

... truncated
[info] Output #24, mpegts, to 'udp://100.64.0.55:1234':
[info] Metadata:
[info] encoder : Lavf59.27.100
[info] Stream #24:0: Video: h264, 1 reference frame, yuv420p(tv, bt709, progressive, left), 384x216 (0x0), q=2-31, 24 fps, 90k tbn
[info] Metadata:
[info] encoder : Lavc59.37.100 libx264
[info] Side data:
[info] cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
[info] frame= 1 fps=0.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 size= [info] frame= 9 fps=0.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=13.0 q=12.0 size= [info] frame= 22 fps= 21 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 34 fps= 22 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 46 fps= 22 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 58 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [AVIOContext @ 0x5555f140fa70] [verbose] Statistics: 19517 bytes read, 0 seeks
[h264 @ 0x5555f1407de0] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5555f1407720] [info] Auto-inserting h264_mp4toannexb bitstream filter
[info] frame= 70 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 83 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 95 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 107 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 119 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 132 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [AVIOContext @ 0x5555f140fa70] [verbose] Statistics: 19240 bytes read, 0 seeks
[h264 @ 0x5555f1407de0] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5555f1407720] [info] Auto-inserting h264_mp4toannexb bitstream filter
[info] frame= 144 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 156 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 168 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 180 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 193 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=13.0 q=12.0 q=12.0 q=27.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 205 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=13.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [AVIOContext @ 0x5555f140fa70] [verbose] Statistics: 19218 bytes read, 0 seeks
[h264 @ 0x5555f1407de0] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5555f1407720] [info] Auto-inserting h264_mp4toannexb bitstream filter
[h264 @ 0x5555f17af150] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[concat @ 0x5555f13febf0] [warning] New audio stream 0:1 at pos:68549 and DTS:8.99977s
[info] frame= 217 fps= 24 q=14.0 q=20.0 q=14.0 q=26.0 q=25.0 q=17.0 q=19.0 q=13.0 q=25.0 q=25.0 q=22.0 q=19.0 q=14.0 q=25.0 q=22.0 q=22.0 q=19.0 q=14.0 q=22.0 q=13.0 q=23.0 q=20.0 q=13.0 q=22.0 q=14.0 size= [info] frame= 229 fps= 24 q=14.0 q=22.0 q=14.0 q=26.0 q=24.0 q=18.0 q=21.0 q=15.0 q=25.0 q=24.0 q=20.0 q=22.0 q=15.0 q=25.0 q=21.0 q=21.0 q=22.0 q=15.0 q=23.0 q=12.0 q=22.0 q=22.0 q=12.0 q=23.0 q=14.0 size= [info] frame= 241 fps= 24 q=16.0 q=22.0 q=15.0 q=26.0 q=25.0 q=17.0 q=22.0 q=18.0 q=25.0 q=24.0 q=20.0 q=22.0 q=17.0 q=25.0 q=22.0 q=21.0 q=23.0 q=17.0 q=23.0 q=15.0 q=21.0 q=23.0 q=17.0 q=23.0 q=15.0 size= [info] frame= 253 fps= 24 q=18.0 q=24.0 q=19.0 q=26.0 q=25.0 q=17.0 q=23.0 q=20.0 q=26.0 q=25.0 q=21.0 q=23.0 q=19.0 q=26.0 q=23.0 q=22.0 q=22.0 q=19.0 q=23.0 q=15.0 q=23.0 q=22.0 q=19.0 q=22.0 q=16.0 size= [info] frame= 265 fps= 24 q=20.0 q=23.0 q=19.0 q=27.0 q=26.0 q=19.0 q=25.0 q=18.0 q=27.0 q=25.0 q=23.0 q=25.0 q=18.0 q=26.0 q=22.0 q=24.0 q=23.0 q=17.0 q=22.0 q=14.0 q=16.0 q=19.0 q=14.0 q=18.0 q=14.0 size= [info] frame= 278 fps= 24 q=12.0 q=22.0 q=25.0 q=21.0 q=15.0 q=12.0 q=24.0 q=24.0 q=25.0 q=13.0 q=12.0 q=25.0 q=23.0 q=24.0 q=12.0 q=12.0 q=25.0 q=26.0 q=24.0 q=12.0 q=12.0 q=17.0 q=22.0 q=17.0 q=12.0 size= [info] frame= 290 fps= 24 q=13.0 q=22.0 q=22.0 q=22.0 q=16.0 q=18.0 q=22.0 q=22.0 q=22.0 q=18.0 q=19.0 q=22.0 q=22.0 q=21.0 q=18.0 q=16.0 q=22.0 q=21.0 q=21.0 q=17.0 q=12.0 q=22.0 q=21.0 q=22.0 q=14.0 size= [info] frame= 302 fps= 24 q=18.0 q=21.0 q=22.0 q=21.0 q=19.0 q=20.0 q=21.0 q=21.0 q=21.0 q=20.0 q=20.0 q=21.0 q=21.0 q=21.0 q=19.0 q=20.0 q=21.0 q=21.0 q=22.0 q=19.0 q=17.0 q=22.0 q=21.0 q=21.0 q=17.0 size= [info] frame= 314 fps= 24 q=19.0 q=21.0 q=21.0 q=21.0 q=20.0 q=20.0 q=21.0 q=21.0 q=21.0 q=20.0 q=20.0 q=21.0 q=21.0 q=21.0 q=20.0 q=20.0 q=21.0 q=20.0 q=21.0 q=20.0 q=19.0 q=21.0 q=21.0 q=21.0 q=19.0 size= [info] frame= 326 fps= 24 q=20.0 q=21.0 q=21.0 q=20.0 q=21.0 q=21.0 q=21.0 q=20.0 q=21.0 q=21.0 q=21.0 q=21.0 q=20.0 q=21.0 q=21.0 q=21.0 q=21.0 q=20.0 q=21.0 q=21.0 q=20.0 q=21.0 q=21.0 q=21.0 q=20.0 size= [info] frame= 339 fps= 24 q=20.0 q=20.0 q=21.0 q=20.0 q=21.0 q=21.0 q=20.0 q=19.0 q=21.0 q=21.0 q=21.0 q=21.0 q=20.0 q=20.0 q=21.0 q=20.0 q=21.0 q=20.0 q=20.0 q=21.0 q=20.0 q=21.0 q=20.0 q=21.0 q=20.0 size= [info] frame= 351 fps= 24 q=21.0 q=20.0 q=21.0 q=20.0 q=20.0 q=20.0 q=20.0 q=19.0 q=21.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=21.0 q=21.0 q=21.0 q=20.0 q=20.0 q=20.0 q=21.0 q=21.0 q=21.0 q=21.0 q=20.0 size= [info] frame= 363 fps= 24 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=19.0 q=20.0 q=20.0 q=21.0 q=20.0 q=20.0 q=20.0 q=21.0 q=21.0 q=21.0 q=20.0 q=20.0 q=21.0 q=21.0 q=21.0 q=20.0 q=21.0 q=21.0 size= [info] frame= 375 fps= 24 q=20.0 q=20.0 q=20.0 q=19.0 q=20.0 q=20.0 q=20.0 q=19.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=19.0 q=21.0 q=21.0 q=20.0 q=20.0 q=20.0 q=21.0 q=20.0 q=21.0 q=20.0 q=21.0 q=21.0 size= [info] frame= 387 fps= 24 q=20.0 q=20.0 q=20.0 q=19.0 q=20.0 q=20.0 q=19.0 q=19.0 q=20.0 q=20.0 q=20.0 q=20.0 q=20.0 q=19.0 q=21.0 q=21.0 q=20.0 q=19.0 q=19.0 q=20.0 q=21.0 q=21.0 q=19.0 q=21.0 q=20.0 size= [info] frame= 400 fps= 24 q=20.0 q=20.0 q=20.0 q=19.0 q=20.0 q=20.0 q=18.0 q=18.0 q=19.0 q=20.0 q=20.0 q=19.0 q=20.0 q=19.0 q=20.0 q=20.0 q=20.0 q=19.0 q=19.0 q=20.0 q=20.0 q=21.0 q=19.0 q=19.0 q=20.0 size= [info] frame= 412 fps= 24 q=20.0 q=19.0 q=19.0 q=19.0 q=19.0 q=20.0 q=18.0 q=18.0 q=19.0 q=19.0 q=20.0 q=19.0 q=20.0 q=19.0 q=19.0 q=20.0 q=20.0 q=19.0 q=19.0 q=19.0 q=20.0 q=21.0 q=19.0 q=19.0 q=19.0 size= [info] frame= 424 fps= 24 q=20.0 q=19.0 q=20.0 q=20.0 q=19.0 q=20.0 q=18.0 q=19.0 q=19.0 q=19.0 q=20.0 q=19.0 q=20.0 q=19.0 q=19.0 q=20.0 q=20.0 q=19.0 q=19.0 q=19.0 q=21.0 q=21.0 q=19.0 q=19.0 q=19.0 size= [info] frame= 436 fps= 24 q=20.0 q=18.0 q=19.0 q=20.0 q=18.0 q=20.0 q=18.0 q=18.0 q=19.0 q=18.0 q=20.0 q=19.0 q=20.0 q=19.0 q=19.0 q=20.0 q=19.0 q=19.0 q=19.0 q=18.0 q=21.0 q=21.0 q=19.0 q=19.0 q=19.0 size= [info] frame= 448 fps= 24 q=19.0 q=18.0 q=19.0 q=20.0 q=18.0 q=19.0 q=18.0 q=18.0 q=19.0 q=18.0 q=19.0 q=19.0 q=20.0 q=19.0 q=18.0 q=20.0 q=19.0 q=19.0 q=19.0 q=18.0 q=21.0 q=21.0 q=19.0 q=19.0 q=19.0 size= [info] frame= 460 fps= 24 q=19.0 q=18.0 q=19.0 q=20.0 q=18.0 q=19.0 q=18.0 q=18.0 q=19.0 q=18.0 q=19.0 q=19.0 q=20.0 q=19.0 q=18.0 q=20.0 q=19.0 q=19.0 q=20.0 q=18.0 q=20.0 q=21.0 q=19.0 q=19.0 q=18.0 size= [info] frame= 472 fps= 24 q=19.0 q=18.0 q=19.0 q=20.0 q=18.0 q=19.0 q=18.0 q=18.0 q=19.0 q=18.0 q=19.0 q=19.0 q=19.0 q=19.0 q=18.0 q=19.0 q=19.0 q=19.0 q=20.0 q=18.0 q=20.0 q=21.0 q=19.0 q=19.0 q=18.0 size= [info] frame= 484 fps= 24 q=19.0 q=18.0 q=19.0 q=20.0 q=18.0 q=19.0 q=18.0 q=18.0 q=19.0 q=18.0 q=19.0 q=19.0 q=19.0 q=19.0 q=18.0 q=19.0 q=19.0 q=19.0 q=19.0 q=18.0 q=20.0 q=21.0 q=19.0 q=20.0 q=18.0 size= [info] frame= 496 fps= 24 q=21.0 q=20.0 q=21.0 q=21.0 q=18.0 q=20.0 q=21.0 q=21.0 q=21.0 q=18.0 q=20.0 q=21.0 q=22.0 q=21.0 q=18.0 q=21.0 q=21.0 q=21.0 q=21.0 q=18.0 q=21.0 q=21.0 q=21.0 q=20.0 q=19.0 size= [info] frame= 509 fps= 24 q=21.0 q=20.0 q=22.0 q=21.0 q=17.0 q=21.0 q=22.0 q=22.0 q=22.0 q=18.0 q=20.0 q=22.0 q=22.0 q=22.0 q=17.0 q=21.0 q=22.0 q=22.0 q=22.0 q=18.0 q=21.0 q=22.0 q=22.0 q=20.0 q=18.0 size= [info] frame= 521 fps= 24 q=20.0 q=21.0 q=22.0 q=21.0 q=17.0 q=21.0 q=22.0 q=23.0 q=22.0 q=17.0 q=20.0 q=22.0 q=23.0 q=22.0 q=17.0 q=21.0 q=22.0 q=22.0 q=22.0 q=17.0 q=21.0 q=22.0 q=22.0 q=21.0 q=18.0 size= [info] frame= 533 fps= 24 q=20.0 q=20.0 q=22.0 q=21.0 q=15.0 q=20.0 q=22.0 q=23.0 q=22.0 q=16.0 q=19.0 q=22.0 q=23.0 q=22.0 q=16.0 q=21.0 q=22.0 q=22.0 q=22.0 q=16.0 q=21.0 q=22.0 q=22.0 q=21.0 q=17.0 size= [AVIOContext @ 0x5555f140fa70] [verbose] Statistics: 3205712 bytes read, 2 seeks
[h264 @ 0x5555f1df2c00] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5555f1407720] [info] Auto-inserting h264_mp4toannexb bitstream filter
[h264 @ 0x5555f1949030] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[info] frame= 546 fps= 24 q=16.0 q=17.0 q=18.0 q=18.0 q=13.0 q=17.0 q=18.0 q=18.0 q=18.0 q=13.0 q=16.0 q=18.0 q=19.0 q=18.0 q=14.0 q=17.0 q=19.0 q=18.0 q=18.0 q=14.0 q=18.0 q=19.0 q=18.0 q=18.0 q=14.0 size= [info] frame= 558 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=14.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 570 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 582 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 594 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 606 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 618 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 631 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 643 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 655 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [AVIOContext @ 0x5555f140fa70] [verbose] Statistics: 120365 bytes read, 2 seeks
[h264 @ 0x5555f1df2c00] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5555f1407720] [info] Auto-inserting h264_mp4toannexb bitstream filter
[h264 @ 0x5555f1949030] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[info] frame= 667 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 679 fps= 24 q=20.0 q=12.0 q=12.0 q=12.0 q=12.0 q=20.0 q=12.0 q=25.0 q=12.0 q=12.0 q=21.0 q=20.0 q=24.0 q=12.0 q=12.0 q=20.0 q=19.0 q=22.0 q=13.0 q=13.0 q=13.0 q=14.0 q=17.0 q=12.0 q=12.0 size= [info] frame= 691 fps= 24 q=17.0 q=12.0 q=21.0 q=12.0 q=12.0 q=15.0 q=13.0 q=23.0 q=12.0 q=12.0 q=16.0 q=19.0 q=21.0 q=17.0 q=12.0 q=15.0 q=12.0 q=21.0 q=13.0 q=13.0 q=12.0 q=12.0 q=13.0 q=12.0 q=12.0 size= [info] frame= 703 fps= 24 q=19.0 q=12.0 q=21.0 q=12.0 q=12.0 q=16.0 q=12.0 q=23.0 q=12.0 q=12.0 q=14.0 q=17.0 q=21.0 q=15.0 q=12.0 q=13.0 q=12.0 q=20.0 q=13.0 q=13.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 715 fps= 24 q=20.0 q=12.0 q=20.0 q=15.0 q=12.0 q=18.0 q=22.0 q=23.0 q=23.0 q=12.0 q=16.0 q=17.0 q=22.0 q=17.0 q=12.0 q=15.0 q=21.0 q=22.0 q=13.0 q=13.0 q=12.0 q=14.0 q=13.0 q=12.0 q=12.0 size= [info] frame= 728 fps= 24 q=18.0 q=12.0 q=12.0 q=12.0 q=12.0 q=16.0 q=14.0 q=23.0 q=12.0 q=12.0 q=16.0 q=19.0 q=22.0 q=13.0 q=12.0 q=15.0 q=19.0 q=21.0 q=13.0 q=12.0 q=12.0 q=12.0 q=14.0 q=12.0 q=12.0 size= [info] frame= 740 fps= 24 q=17.0 q=12.0 q=12.0 q=12.0 q=12.0 q=15.0 q=14.0 q=22.0 q=12.0 q=12.0 q=14.0 q=18.0 q=21.0 q=12.0 q=12.0 q=15.0 q=19.0 q=20.0 q=13.0 q=13.0 q=12.0 q=13.0 q=16.0 q=12.0 q=12.0 size= [info] frame= 752 fps= 24 q=23.0 q=14.0 q=14.0 q=14.0 q=14.0 q=21.0 q=16.0 q=25.0 q=14.0 q=14.0 q=21.0 q=20.0 q=23.0 q=16.0 q=20.0 q=22.0 q=21.0 q=23.0 q=22.0 q=20.0 q=22.0 q=24.0 q=24.0 q=23.0 q=23.0 size= [info] frame= 764 fps= 24 q=16.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=14.0 q=23.0 q=12.0 q=12.0 q=14.0 q=18.0 q=22.0 q=12.0 q=12.0 q=13.0 q=16.0 q=18.0 q=13.0 q=13.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 776 fps= 24 q=21.0 q=14.0 q=19.0 q=12.0 q=12.0 q=20.0 q=23.0 q=23.0 q=19.0 q=12.0 q=15.0 q=23.0 q=23.0 q=21.0 q=12.0 q=16.0 q=16.0 q=20.0 q=13.0 q=13.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 788 fps= 24 q=22.0 q=12.0 q=19.0 q=18.0 q=13.0 q=21.0 q=12.0 q=23.0 q=24.0 q=16.0 q=19.0 q=12.0 q=24.0 q=26.0 q=23.0 q=15.0 q=12.0 q=27.0 q=25.0 q=16.0 q=13.0 q=13.0 q=16.0 q=12.0 q=12.0 size= [info] frame= 800 fps= 24 q=21.0 q=12.0 q=12.0 q=12.0 q=12.0 q=18.0 q=12.0 q=12.0 q=12.0 q=12.0 q=13.0 q=12.0 q=15.0 q=15.0 q=12.0 q=13.0 q=12.0 q=14.0 q=17.0 q=13.0 q=13.0 q=12.0 q=13.0 q=12.0 q=12.0 size= [AVIOContext @ 0x5555f140fa70] [verbose] Statistics: 984786 bytes read, 2 seeks
[h264 @ 0x5555f1407de0] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5555f1407720] [info] Auto-inserting h264_mp4toannexb bitstream filter
[h264 @ 0x5555f187c0c0] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[info] frame= 812 fps= 24 q=21.0 q=12.0 q=12.0 q=12.0 q=12.0 q=18.0 q=13.0 q=12.0 q=12.0 q=12.0 q=13.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=16.0 q=15.0 q=12.0 q=12.0 q=12.0 q=13.0 q=16.0 q=12.0 size= [info] frame= 824 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 836 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 848 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 861 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=13.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=24.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 873 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 885 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=23.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=13.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 897 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 909 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=13.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=25.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 922 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 934 fps= 24 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 938 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [AVIOContext @ 0x5555f140fa70] [verbose] Statistics: 29154 bytes read, 0 seeks
[h264 @ 0x5555f1407de0] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5555f1407720] [info] Auto-inserting h264_mp4toannexb bitstream filter
[h264 @ 0x5555f17af150] [verbose] Reinit context to 1920x1088, pix_fmt: yuv420p
[info] frame= 963 fps= 23 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=15.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 967 fps= 22 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=17.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 994 fps= 22 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=15.0 q=19.0 q=12.0 q=12.0 q=12.0 q=17.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 997 fps= 21 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=15.0 q=19.0 q=12.0 q=12.0 q=12.0 q=18.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 1023 fps= 21 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=14.0 q=20.0 q=18.0 q=15.0 q=15.0 q=14.0 q=13.0 q=13.0 q=13.0 q=13.0 q=13.0 q=13.0 size= [info] frame= 1029 fps= 20 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=14.0 q=20.0 q=15.0 q=14.0 q=15.0 q=15.0 q=13.0 q=13.0 q=14.0 q=14.0 q=14.0 q=13.0 size= [info] frame= 1055 fps= 21 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=15.0 q=19.0 q=15.0 q=14.0 q=15.0 q=16.0 q=12.0 q=13.0 q=13.0 q=13.0 q=13.0 q=12.0 size= [info] frame= 1060 fps= 20 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=16.0 q=19.0 q=15.0 q=14.0 q=15.0 q=16.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size= [info] frame= 1086 fps= 20 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=13.0 q=16.0 q=15.0 q=14.0 q=14.0 q=12.0 q=13.0 q=13.0 q=13.0 q=13.0 q=12.0 size= [info] frame= 1092 fps= 19 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=13.0 q=16.0 q=13.0 q=13.0 q=13.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 q=12.0 size=



What I tried & My guesses


My best guess is that the issue comes from one of the data buffers between the two applications (
ffmpeg
->mpv
). There are several buffers and I don't know exactly which ones, but there is at least a UDP buffer at the output of the server and another one at the input of the client.

When a client is unreachable, the server's UDP buffer seems to fill up and thus don't continue streaming for other clients.


I tried to tweak several parameters of
ffmpeg
concerning buffers but without success.

- 

udp://100.64.0.32:1234?buffer_size=1024&connect=0&fifo_size=10&overrun_nonfatal=0
fps_mode
thread_queue_size








Any help is welcome !


-
Appending a list of movies MP4s causes the sound to be dropped or garbled at some point
9 février 2020, par MarieUpdate I am able to reproduce the issue by concatenating 10 Hello.mp4 clips and see the audio drop out/garbled at about 5 seconds playback. This is via VLC latest 3.0.8 on Windows7 64bit. Window Player zero sound. Media Player Classic it plays fine all 10 audio or the word "Hello". The same movie when dragged onto Whatsapp the PC app plays OK but no sound if played from the Phone Whatsapp. Perhaps its my computer too slow in the production of this clip ??? I don’t know what to trust anymore.
I copied the same ffmpeg.exe onto my kid’s Windows10 laptop and was able to produce the same behavior with sound dropping out with VLC however Windows10 media player is able to play the audio without a glitch.
You can reproduce the same on your end with this batch file
_HELLO_MP4s.CMD
rem 2:07 AM 2/8/2020
rem
rem
SET EXE="S:\_BINS\FFmpeg 4.2.1 20200112\bin\ffmpeg.exe"
SET ROOTPATH=.\
SET OUT_FILE="%ROOTPATH%HELLOs.MP4"
SET IN_FILES_LIST="%ROOTPATH%IN_FILES_LIST.TXT"
ECHO file '%ROOTPATH%HELLO.mp4' > %IN_FILES_LIST%
ECHO file '%ROOTPATH%HELLO.mp4' >> %IN_FILES_LIST%
ECHO file '%ROOTPATH%HELLO.mp4' >> %IN_FILES_LIST%
ECHO file '%ROOTPATH%HELLO.mp4' >> %IN_FILES_LIST%
ECHO file '%ROOTPATH%HELLO.mp4' >> %IN_FILES_LIST%
ECHO file '%ROOTPATH%HELLO.mp4' >> %IN_FILES_LIST%
ECHO file '%ROOTPATH%HELLO.mp4' >> %IN_FILES_LIST%
ECHO file '%ROOTPATH%HELLO.mp4' >> %IN_FILES_LIST%
ECHO file '%ROOTPATH%HELLO.mp4' >> %IN_FILES_LIST%
ECHO file '%ROOTPATH%HELLO.mp4' >> %IN_FILES_LIST%
SET OPTIONS= -f concat -safe 0 -i %IN_FILES_LIST% -c copy -y %OUT_FILE%
SET INFO_FILE="INFO.TXT"
%EXE% %OPTIONS% 1> %INFO_FILE% 2>&1
ECHO ======================== >> %INFO_FILE%
ECHO OUT_FILE=%OUT_FILE% >> %INFO_FILE%
ECHO EXE=%EXE% >> %INFO_FILE%
ECHO OPTIONS=%OPTIONS% >> %INFO_FILE%
ECHO ======================== >> %INFO_FILE%Original Post
My process is in 3 steps
Step 1) Corresponding to each bitmap I have 00.JPG ... NN.JPG I combine a list of "SOURCE" mp3 audio into a single audio mp3 to produce matching 00.MP3 ... NN.MP3I had glitch here where one my mp3 was not of the correct Sample Rate, however a kind soul in this forum helped me fix that.
You can read the details here :When I append a silent audio (mp3) to an existing list of audio it garbles the final audio ?
Step 2) combine each mp3 from previous with a the filename matching bitmap to produce a movie .MP4
IOW,
- 00.JPG + 00.MP3 >> 00.MP4
- 01.JPG + 01.MP3 >> 01.MP4
- and so on
From this run of 24 subparts, I hand tested some of these movies against Whatsapp and they are accepted fine.
However, the final MOVIE.MP4 is not.
I will list below their info from ffprobe.Step 3) combine the list of movies from previous into a final MOVIE.MP4
This is where I have been having random issues typically with audio, currently this audio drops at about 20s from start. Corresponding to roughly movies parts 04.mp4 to 07.mp4I play the videos via VLC but Windows Media Player has even worse playback.
I am able to reproduce Step3 and thus MOVIE.MP4 with following batch file
rem 10:33 PM 2/6/2020
SET EXE="S:\_BINS\FFmpeg 4.2.1 20200112\bin\ffmpeg.exe"
SET ROOTPATH=.\
SET OUT_FILE="%ROOTPATH%MOVIE.MP4"
SET IN_FILES_LIST="%ROOTPATH%IN_FILES_LIST.TXT"
SET OPTIONS= -f concat -safe 0 -i %IN_FILES_LIST% -c copy -y %OUT_FILE%
SET INFO_FILE="INFO.TXT"
%EXE% %OPTIONS% 1> %INFO_FILE% 2>&1
rem PAUSEThe content of IN_FILES_LIST.TXT
file '00.mp4'
file '01.mp4'
file '02.mp4'
...
file '23.mp4'
file '24.mp4'(Step 2) uses the following :)
The following is ffprobe on the source audio MP3s (Step 1)
MP3s_ORIGINAL.TXT
========================BEGIN
[mp3 @ 0000000000513100] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\00.mp3':
Duration: 00:00:03.36, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 00000000003f3180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\01.mp3':
Duration: 00:00:00.46, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 00000000004a3180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\02.mp3':
Duration: 00:00:00.58, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 0000000000623180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\03.mp3':
Duration: 00:00:00.84, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 00000000003a3180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\04.mp3':
Duration: 00:00:00.86, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 0000000000433180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\05.mp3':
Duration: 00:00:00.98, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 0000000000683180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\06.mp3':
Duration: 00:00:00.98, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 00000000004d3180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\07.mp3':
Duration: 00:00:00.98, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 00000000004c3180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\08.mp3':
Duration: 00:00:00.98, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 0000000000573180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\09.mp3':
Duration: 00:00:00.98, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 0000000000583180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\10.mp3':
Duration: 00:00:00.98, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 00000000005e3180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\11.mp3':
Duration: 00:00:00.98, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 0000000000553180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '.\PLAY\12.mp3':
Duration: 00:00:00.98, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
[mp3 @ 0000000000563180] Estimating duration from bitrate, this may be inaccurate
trimmed because SO limits post to 30000 charsThe following is ffprobe on the MP3s concatenated with 2second Silence. All their Sample Rate 24K and Bit Rate 32k seems OK ?? (Also Step 1)
MP3s_withSilenceAppended.TXT
========================BEGIN
Input #0, mp3, from '00.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:05.42, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '01.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:02.52, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '02.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:02.64, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '03.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:02.90, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '04.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:02.93, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '05.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.05, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '06.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.05, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '07.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.05, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '08.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.05, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '09.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.05, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '10.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.05, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '11.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.05, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '12.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.05, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '13.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:05.81, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '14.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:02.93, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '15.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:02.66, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '16.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:02.66, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '17.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:02.66, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '18.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:02.83, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '19.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:06.50, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '20.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.05, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '21.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.05, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '22.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.14, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '23.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:06.12, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Input #0, mp3, from '24.mp3':
Metadata:
encoder : Lavf58.35.101
Duration: 00:00:03.14, start: 0.046042, bitrate: 32 kb/s
Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/sThe following is ffmpeg info output during the production of final movie MOVIE.MP4
(Step 3)========================BEGIN
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\00.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:05.54, start: 0.000000, bitrate: 174 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 137 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\01.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:02.71, start: 0.000000, bitrate: 269 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 242 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\02.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:02.71, start: 0.000000, bitrate: 285 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 245 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\03.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.04, start: 0.000000, bitrate: 275 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 239 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\04.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.04, start: 0.000000, bitrate: 286 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 250 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\05.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 281 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 249 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\06.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 281 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 249 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\07.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 150 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 115 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\08.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 201 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 166 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\09.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 247 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 214 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\10.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 247 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 214 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\11.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 131 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 95 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\12.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 194 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 159 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\13.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:05.88, start: 0.000000, bitrate: 207 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 169 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\14.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.04, start: 0.000000, bitrate: 335 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 300 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\15.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:02.88, start: 0.000000, bitrate: 365 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 342 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\16.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:02.88, start: 0.000000, bitrate: 384 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 362 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\17.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:02.88, start: 0.000000, bitrate: 390 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 368 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\18.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.04, start: 0.000000, bitrate: 386 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 363 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\19.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:06.71, start: 0.000000, bitrate: 204 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 169 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\20.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 194 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 159 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\21.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 194 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 159 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\22.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 208 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 169 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\23.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:06.21, start: 0.000000, bitrate: 204 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 166 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\24.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:00:03.21, start: 0.000000, bitrate: 173 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 134 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\VID\MOVIE.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Duration: 00:01:29.05, start: 0.000000, bitrate: 239 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 203 kb/s, 23.53 fps, 24 tbr, 24k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 30 kb/s (default)
Metadata:
handler_name : SoundHandlerI have not been able yet to reproduce the issue with a smaller set of movies, in the meantime if you would to get a copy I would have to upload an archive to a link so you can have them on your side.
Alternatively, if you would like me to provide additional info from these steps let me know what commands and I will be happy to provide.
Thank you.
-
Issues with Video Recording Duration and Smooth Playback when Using v4l2 to MP4 (FFmpeg)
9 décembre 2024, par ReenaI'm trying to record a video from a USB device with v4l2 framework and save it in MP4 format using FFmpeg. My sample code successfully captures and saves the video, but I'm running into some issues :


The recorded video duration is shorter than expected. For instance :


When recording a 1-minute video at 1280x720, the output file only has 58 or 59 seconds.
For 1920x1080, the duration is even more off — only about 28 or 30 seconds, instead of the expected 1 minute.
Additionally, the video is not smooth. There are noticeable drops in frames and playback inconsistencies.


My setup :


Using a USB device with v4l2 framework
Saving the video in MP4 format
Tested with different resolutions (1280x720, 1920x1080)
I've attached my sample code below. Could someone help me figure out why I'm experiencing these issues with video duration and smooth playback ?


Any advice, fixes, or suggestions would be greatly appreciated !


#include 
#include 
#include 
#include 
#include <sys></sys>ioctl.h>
#include <sys></sys>mman.h>
#include <linux></linux>videodev2.h>
#include <libavformat></libavformat>avformat.h>
#include <libavcodec></libavcodec>avcodec.h>
#include <libavutil></libavutil>imgutils.h>
#include <libavutil></libavutil>opt.h>
#include <libswscale></libswscale>swscale.h>
#include 
#include <sys></sys>time.h>
#include 

#define WIDTH 1280
#define HEIGHT 720
#define FPS 30
#define DURATION 10 // Recording duration in seconds
#define BUFFER_COUNT 4 // Number of buffers

struct buffer {
 void *start;
 size_t length;
};

struct buffer *buffers;

void open_device(int *fd, const char *device) {
 *fd = open(device, O_RDWR | O_NONBLOCK);
 if (*fd < 0) {
 perror("Cannot open video device");
 exit(1);
 }
}

void init_mmap(int fd) {
 struct v4l2_requestbuffers req;
 memset(&req, 0, sizeof(req));
 req.count = BUFFER_COUNT;
 req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 req.memory = V4L2_MEMORY_MMAP;

 if (ioctl(fd, VIDIOC_REQBUFS, &req) < 0) {
 perror("Requesting buffer");
 exit(1);
 }

 buffers = calloc(req.count, sizeof(*buffers));
 for (size_t i = 0; i < req.count; ++i) {
 struct v4l2_buffer buf;
 memset(&buf, 0, sizeof(buf));
 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 buf.memory = V4L2_MEMORY_MMAP;
 buf.index = i;

 if (ioctl(fd, VIDIOC_QUERYBUF, &buf) < 0) {
 perror("Querying buffer");
 exit(1);
 }

 buffers[i].length = buf.length;
 buffers[i].start = mmap(NULL, buf.length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, buf.m.offset);

 if (MAP_FAILED == buffers[i].start) {
 perror("mmap");
 exit(1);
 }
 }
}

void start_capturing(int fd) {
 for (size_t i = 0; i < BUFFER_COUNT; ++i) {
 struct v4l2_buffer buf;
 memset(&buf, 0, sizeof(buf));
 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 buf.memory = V4L2_MEMORY_MMAP;
 buf.index = i;

 if (ioctl(fd, VIDIOC_QBUF, &buf) < 0) {
 perror("Queue buffer");
 exit(1);
 }
 }

 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 if (ioctl(fd, VIDIOC_STREAMON, &type) < 0) {
 perror("Start capture");
 exit(1);
 }
}

void stop_capturing(int fd) {
 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;

 if (ioctl(fd, VIDIOC_STREAMOFF, &type) < 0) {
 perror("Stop capture");
 exit(1);
 }

 printf("Video capture stopped.\n");
}

void unmap_buffers() {
 for (size_t i = 0; i < BUFFER_COUNT; ++i) {
 if (munmap(buffers[i].start, buffers[i].length) < 0) {
 perror("munmap");
 exit(1);
 }
 }

 free(buffers);
}

void initialize_ffmpeg(AVFormatContext **fmt_ctx, AVCodecContext **codec_ctx, AVStream **video_stream, const char *filename) {
 av_register_all();

 AVOutputFormat *fmt = av_guess_format(NULL, filename, NULL);
 if (!fmt) {
 fprintf(stderr, "Could not determine output format\n");
 exit(1);
 }

 if (avformat_alloc_output_context2(fmt_ctx, fmt, NULL, filename) < 0) {
 fprintf(stderr, "Could not allocate format context\n");
 exit(1);
 }

 AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_H264);
 if (!codec) {
 fprintf(stderr, "Codec not found\n");
 exit(1);
 }

 *video_stream = avformat_new_stream(*fmt_ctx, NULL);
 if (!*video_stream) {
 fprintf(stderr, "Could not create stream\n");
 exit(1);
 }

 *codec_ctx = avcodec_alloc_context3(codec);
 if (!*codec_ctx) {
 fprintf(stderr, "Could not allocate codec context\n");
 exit(1);
 }

 (*codec_ctx)->codec_type = AVMEDIA_TYPE_VIDEO;
 (*codec_ctx)->width = WIDTH;
 (*codec_ctx)->height = HEIGHT;
 (*codec_ctx)->time_base = (AVRational){1, FPS};
 (*codec_ctx)->framerate = (AVRational){FPS, 1};
 (*codec_ctx)->pix_fmt = AV_PIX_FMT_YUV420P;
 (*codec_ctx)->gop_size = 10;
 (*codec_ctx)->max_b_frames = 1;

 av_opt_set(*codec_ctx, "preset", "fast", 0);
 av_opt_set_int(*codec_ctx, "crf", 23, 0);

 (*video_stream)->time_base = (*codec_ctx)->time_base;
 (*video_stream)->codecpar->codec_id = fmt->video_codec;
 (*video_stream)->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
 (*video_stream)->codecpar->width = (*codec_ctx)->width;
 (*video_stream)->codecpar->height = (*codec_ctx)->height;
 (*video_stream)->codecpar->format = (*codec_ctx)->pix_fmt;

 if ((*fmt_ctx)->oformat->flags & AVFMT_GLOBALHEADER) {
 (*codec_ctx)->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
 }

 if (avcodec_open2(*codec_ctx, codec, NULL) < 0) {
 fprintf(stderr, "Could not open codec\n");
 exit(1);
 }

 if (avcodec_parameters_from_context((*video_stream)->codecpar, *codec_ctx) < 0) {
 fprintf(stderr, "Could not copy codec parameters\n");
 exit(1);
 }

 if (!(fmt->flags & AVFMT_NOFILE)) {
 if (avio_open(&(*fmt_ctx)->pb, filename, AVIO_FLAG_WRITE) < 0) {
 fprintf(stderr, "Could not open output file\n");
 exit(1);
 }
 }

 if (avformat_write_header(*fmt_ctx, NULL) < 0) {
 fprintf(stderr, "Could not write header\n");
 exit(1);
 }
}

void capture_and_encode(int fd, AVFormatContext *fmt_ctx, AVCodecContext *codec_ctx, struct SwsContext *sws_ctx, AVStream *video_stream, int duration) {
 struct v4l2_buffer buffer;
 AVFrame *frame = av_frame_alloc();
 AVPacket packet;
 av_init_packet(&packet);

 frame->format = codec_ctx->pix_fmt;
 frame->width = codec_ctx->width;
 frame->height = codec_ctx->height;
 av_image_alloc(frame->data, frame->linesize, codec_ctx->width, codec_ctx->height, codec_ctx->pix_fmt, 32);

 struct timespec start_time;
 clock_gettime(CLOCK_MONOTONIC, &start_time);
 double elapsed_time = 0;
 int64_t pts_counter = 0;
 int frame_count = 0;

 while (elapsed_time < duration) {
 fd_set fds;
 struct timeval tv;
 int r;

 FD_ZERO(&fds);
 FD_SET(fd, &fds);

 tv.tv_sec = 2;
 tv.tv_usec = 0;

 r = select(fd + 1, &fds, NULL, NULL, &tv);
 if (r == -1) {
 perror("select");
 exit(1);
 }

 if (r == 0) {
 fprintf(stderr, "select timeout\n");
 exit(1);
 }

 memset(&buffer, 0, sizeof(buffer));
 buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 buffer.memory = V4L2_MEMORY_MMAP;

 if (ioctl(fd, VIDIOC_DQBUF, &buffer) < 0) {
 if (errno == EAGAIN) continue;
 perror("Could not dequeue buffer");
 exit(1);
 }

 uint8_t *src_slices[1] = {buffers[buffer.index].start};
 int src_stride[1] = {WIDTH * 2}; // UYVY is 2 bytes per pixel

 sws_scale(sws_ctx, src_slices, src_stride, 0, HEIGHT, frame->data, frame->linesize);

 frame->pts = pts_counter;
 pts_counter += av_rescale_q(1, (AVRational){1, FPS}, codec_ctx->time_base);

 if (avcodec_send_frame(codec_ctx, frame) < 0) {
 fprintf(stderr, "Error sending frame\n");
 exit(1);
 }

 while (avcodec_receive_packet(codec_ctx, &packet) == 0) {
 av_packet_rescale_ts(&packet, codec_ctx->time_base, video_stream->time_base);
 packet.stream_index = video_stream->index;

 if (av_interleaved_write_frame(fmt_ctx, &packet) < 0) {
 fprintf(stderr, "Error writing frame\n");
 exit(1);
 }

 av_packet_unref(&packet);
 }
 printf("Processed frame %d\n", frame_count);

 if (ioctl(fd, VIDIOC_QBUF, &buffer) < 0) {
 perror("Could not requeue buffer");
 exit(1);
 }
 frame_count++;
 struct timespec current_time;
 clock_gettime(CLOCK_MONOTONIC, &current_time);
 elapsed_time = (current_time.tv_sec - start_time.tv_sec) + (current_time.tv_nsec - start_time.tv_nsec) / 1e9;
 printf("Elapsed time: %f seconds\n", elapsed_time);
 }

 av_freep(&frame->data[0]);
 av_frame_free(&frame);
 printf("Total frames processed: %d\n", frame_count);
}

int main(int argc, char *argv[]) {
 if (argc != 2) {
 fprintf(stderr, "Usage: %s <output file="file">\n", argv[0]);
 exit(1);
 }

 const char *output_file = argv[1];
 int fd;
 open_device(&fd, "/dev/video2");

 struct v4l2_format fmt;
 memset(&fmt, 0, sizeof(fmt));
 fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 fmt.fmt.pix.width = WIDTH;
 fmt.fmt.pix.height = HEIGHT;
 fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_UYVY;
 fmt.fmt.pix.field = V4L2_FIELD_NONE;

 if (ioctl(fd, VIDIOC_S_FMT, &fmt) < 0) {
 perror("Setting pixel format");
 exit(1);
 }

 if (fmt.fmt.pix.pixelformat != V4L2_PIX_FMT_UYVY) {
 fprintf(stderr, "Device does not support UYVY format\n");
 exit(1);
 }

 init_mmap(fd);
 start_capturing(fd);

 AVFormatContext *fmt_ctx = NULL;
 AVCodecContext *codec_ctx = NULL;
 AVStream *video_stream = NULL;

 initialize_ffmpeg(&fmt_ctx, &codec_ctx, &video_stream, output_file);

 struct SwsContext *sws_ctx = sws_getContext(WIDTH, HEIGHT, AV_PIX_FMT_UYVY422,
 WIDTH, HEIGHT, AV_PIX_FMT_YUV420P,
 SWS_BICUBIC, NULL, NULL, NULL);

 if (!sws_ctx) {
 fprintf(stderr, "Could not initialize SwsContext\n");
 exit(1);
 }

 capture_and_encode(fd, fmt_ctx, codec_ctx, sws_ctx, video_stream, DURATION);

 sws_freeContext(sws_ctx);
 av_write_trailer(fmt_ctx);
 avcodec_free_context(&codec_ctx);
 avformat_free_context(fmt_ctx);
 stop_capturing(fd);
 unmap_buffers();
 close(fd);

 return 0;
}
</output>


Thank you !