[FFmpeg-user] FFMPEG DASH with KLV metadata

Mar Andrés López mar.andres.l at gmv.com
Thu Oct 15 13:11:08 EEST 2020


Dear all,


I am trying to generate dash content with klv metadata, I tried several combinations for that, the last one it seems to have more sense to me is:


ffmpeg -i videompeg -r 25 -c:v libx264 -c:a aac -b:a 128k -ac 1 -ar 44100 -b:d 2M -map v:0 -b:v:0 2M -map v:0 -b:v:1 145k -map v:0 -b:v:2 365k -map 0:a? -map 0:d? -b:d 2M -dcodec copy -f dash dash.mpd


It seems that klv codec is not supported by ffmpeg that is why I am trying to do '-dcodec copy'. But for dash is not working. Here is the output:


Input #0, mpegts, from 'video.mpeg':
  Duration: 00:01:30.80, start: 0.500000, bitrate: 1347 kb/s
  Program 1
    Stream #0:0[0x3e8]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt470bg, progressive), 640x480 [SAR 1:1 DAR 4:3], 30 fps, 30 tbr, 90k tbn, 60 tbc
    Side data:
      cpb: bitrate max/min/avg: 1000000/0/0 buffer size: 1835008 vbv_delay: N/A
    Stream #0:1[0x90]: Data: klv (KLVA / 0x41564C4B)
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (mpeg2video (native) -> h264 (libx264))
  Stream #0:0 -> #0:2 (mpeg2video (native) -> h264 (libx264))
  Stream #0:1 -> #0:3 (copy)
Press [q] to stop, [?] for help
[libx264 @ 00000218065a6580] using SAR=1/1
[libx264 @ 00000218065a6580] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000218065a6580] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 00000218065a6580] 264 - core 161 r3018 db0d417 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - 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=abr mbtree=1 bitrate=2000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[libx264 @ 00000218065a2c40] using SAR=1/1
[libx264 @ 00000218065a2c40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000218065a2c40] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 00000218065a2c40] 264 - core 161 r3018 db0d417 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - 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=abr mbtree=1 bitrate=145 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[libx264 @ 00000218065a8380] using SAR=1/1
[libx264 @ 00000218065a8380] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000218065a8380] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 00000218065a8380] 264 - core 161 r3018 db0d417 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - 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=abr mbtree=1 bitrate=365 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[dash @ 00000218065a9640] Opening 'init-stream0.m4s' for writing
[dash @ 00000218065a9640] Opening 'init-stream1.m4s' for writing
[dash @ 00000218065a9640] Opening 'init-stream2.m4s' for writing
[dash @ 00000218065a9640] Opening 'init-stream3.m4s' for writing
[mp4 @ 0000021810ef1100] Could not find tag for codec klv in stream #0, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:2 --
[libx264 @ 00000218065a6580] final ratefactor: 17.61
[libx264 @ 00000218065a2c40] final ratefactor: 40.32
[libx264 @ 00000218065a8380] final ratefactor: 32.33
Conversion failed!
###############################################################

For me it does not make that much sense because when I do this:


ffmpeg -i video.mpg -map 0:d -codec copy -f data output.klv


It works, but i need that my mpeg dash chunks to have the klv content.


Is there any help?

Thanks

P Please consider the environment before printing this e-mail.


More information about the ffmpeg-user mailing list