[FFmpeg-user] Muxing KLV encoded binary data to mpegts

Ă–mer Faruk IRMAK ppirmak at gmail.com
Sun Oct 30 14:20:24 EET 2016


Hello  everybody,

ffmpeg -re -f lavfi -i testsrc=rate=30 -re -thread_queue_size 131072
     -f data -i udp://127.0.0.1:4444 -map 0:0 -map 1:0 -c:v h264 -c:d 
copy -f mpegts test.ts

This is the output of the command above. I simply want to record the 
data coming from udp synced with video. I push some KLV encoded metadata 
from udp://127.0.0.1:4444 but recording stops at frame 51.

     ffmpeg version 3.1.5 Copyright (c) 2000-2016 the FFmpeg developers
       built with gcc 6.2.1 (GCC) 20160830
       configuration: --prefix=/usr --disable-debug --disable-static 
--disable-stripping --enable-avisynth --enable-avresample 
--enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl 
--enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype 
--enable-libfribidi --enable-libgsm --enable-libiec61883 
--enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb 
--enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus 
--enable-libpulse --enable-libschroedinger --enable-libsoxr 
--enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 
--enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp 
--enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf 
--enable-shared --enable-version3 --enable-x11grab
       libavutil      55. 28.100 / 55. 28.100
       libavcodec     57. 48.101 / 57. 48.101
       libavformat    57. 41.100 / 57. 41.100
       libavdevice    57.  0.101 / 57.  0.101
       libavfilter     6. 47.100 /  6. 47.100
       libavresample   3.  0.  0 /  3.  0.  0
       libswscale      4.  1.100 /  4.  1.100
       libswresample   2.  1.100 /  2.  1.100
       libpostproc    54.  0.100 / 54.  0.100
     Input #0, lavfi, from 'testsrc=rate=30':
       Duration: N/A, start: 0.000000, bitrate: N/A
         Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 
320x240 [SAR 1:1 DAR 4:3], 30 tbr, 30 tbn, 30 tbc
     Input #1, data, from 'udp://127.0.0.1:4444':
       Duration: N/A, start: 0.000000, bitrate: N/A
         Stream #1:0: Data: none
     File 'test.ts' already exists. Overwrite ? [y/N] y
     [mpegts @ 0x55ece57efc20] Using AVStream.codec to pass codec 
parameters to muxers is deprecated, use AVStream.codecpar instead.
         Last message repeated 1 times
     Output #0, mpegts, to 'test.ts':
       Metadata:
         encoder         : Lavf57.41.100
         Stream #0:0: Video: mpeg2video (Main), yuv420p, 320x240 [SAR 
1:1 DAR 4:3], q=2-31, 200 kb/s, 30 fps, 90k tbn, 30 tbc
         Metadata:
           encoder         : Lavc57.48.101 mpeg2video
         Side data:
           cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
         Stream #0:1: Data: none
     Stream mapping:
       Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video (native))
       Stream #1:0 -> #0:1 (copy)
     Press [q] to stop, [?] for help
     frame=    2 fps=0.0 q=4.7 size=       0kB time=00:00:00.00 
bitrate=N/A speed=   frame=    2 fps=2.0 q=4.7 size=       0kB 
time=00:00:00.00 bitrate=N/A speed=   frame=    2 fps=1.3 q=4.7 
size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=    2 
fps=1.0 q=4.7 size=       0kB time=00:00:00.00 bitrate=N/A speed=   
frame=    2 fps=0.8 q=4.7 size=       0kB time=00:00:00.00 bitrate=N/A 
speed=   frame=    2 fps=0.7 q=2.0 Lsize=      14kB time=00:00:00.00 
bitrate=10117818.2kbits/s speed=3.63e-06x
     video:12kB audio:0kB subtitle:0kB other streams:0kB global 
headers:0kB muxing overhead: 10.228984%
     [omer at OmerDesktop HDD]$ ffmpeg -re -f lavfi -i testsrc=rate=30 -re 
-thread_queue_size 131072 -f data -i udp://127.0.0.1:4444 -map 0:0 -map 
1:0 -c:v h264 -c:d copy -f mpegts test.ts
     ffmpeg version 3.1.5 Copyright (c) 2000-2016 the FFmpeg developers
       built with gcc 6.2.1 (GCC) 20160830
       configuration: --prefix=/usr --disable-debug --disable-static 
--disable-stripping --enable-avisynth --enable-avresample 
--enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl 
--enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype 
--enable-libfribidi --enable-libgsm --enable-libiec61883 
--enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb 
--enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus 
--enable-libpulse --enable-libschroedinger --enable-libsoxr 
--enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 
--enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp 
--enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf 
--enable-shared --enable-version3 --enable-x11grab
       libavutil      55. 28.100 / 55. 28.100
       libavcodec     57. 48.101 / 57. 48.101
       libavformat    57. 41.100 / 57. 41.100
       libavdevice    57.  0.101 / 57.  0.101
       libavfilter     6. 47.100 /  6. 47.100
       libavresample   3.  0.  0 /  3.  0.  0
       libswscale      4.  1.100 /  4.  1.100
       libswresample   2.  1.100 /  2.  1.100
       libpostproc    54.  0.100 / 54.  0.100
     Input #0, lavfi, from 'testsrc=rate=30':
       Duration: N/A, start: 0.000000, bitrate: N/A
         Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 
320x240 [SAR 1:1 DAR 4:3], 30 tbr, 30 tbn, 30 tbc
     Input #1, data, from 'udp://127.0.0.1:4444':
       Duration: N/A, start: 0.000000, bitrate: N/A
         Stream #1:0: Data: none
     File 'test.ts' already exists. Overwrite ? [y/N] y
     No pixel format specified, yuv444p for H.264 encoding chosen.
     Use -pix_fmt yuv420p for compatibility with outdated media players.
     [libx264 @ 0x56461eb0f500] using SAR=1/1
     [libx264 @ 0x56461eb0f500] using cpu capabilities: MMX2 SSE2Fast 
SSSE3 SSE4.2 AVX
     [libx264 @ 0x56461eb0f500] profile High 4:4:4 Predictive, level 
1.3, 4:4:4 8-bit
     [mpegts @ 0x56461eb0dc80] Using AVStream.codec to pass codec 
parameters to muxers is deprecated, use AVStream.codecpar instead.
         Last message repeated 1 times
     Output #0, mpegts, to 'test.ts':
       Metadata:
         encoder         : Lavf57.41.100
         Stream #0:0: Video: h264 (libx264), yuv444p, 320x240 [SAR 1:1 
DAR 4:3], q=-1--1, 30 fps, 90k tbn, 30 tbc
         Metadata:
           encoder         : Lavc57.48.101 libx264
         Side data:
           cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
         Stream #0:1: Data: none
     Stream mapping:
       Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
       Stream #1:0 -> #0:1 (copy)
     Press [q] to stop, [?] for help
     frame=   17 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 
bitrate=N/A speed=
     frame=   32 fps= 31 q=0.0 size=       0kB time=00:00:00.00 
bitrate=N/A speed=
     frame=   47 fps= 31 q=0.0 size=       0kB time=00:00:00.00 
bitrate=N/A speed=
     frame=   51 fps= 25 q=29.0 size=       0kB time=00:00:00.00 
bitrate=N/A speed=
     frame=   51 fps= 20 q=29.0 size=       0kB time=00:00:00.00 
bitrate=N/A speed=
     frame=   51 fps= 17 q=29.0 size=       0kB time=00:00:00.00 
bitrate=N/A speed=
     frame=   51 fps= 14 q=29.0 size=       0kB time=00:00:00.00 
bitrate=N/A speed=
     frame=   51 fps= 13 q=-1.0 Lsize=      19kB time=00:00:01.60 
bitrate=  94.9kbits/s speed=0.407x



More information about the ffmpeg-user mailing list