[FFmpeg-trac] #6915(avformat:open): DASH audio segments duration doesn't match exactly with video segments duration.

FFmpeg trac at avcodec.org
Sun Dec 24 06:03:41 EET 2017


#6915: DASH audio segments duration doesn't match exactly with video segments
duration.
------------------------------------+-------------------------------------
             Reporter:  beloko      |                    Owner:  stevenliu
                 Type:  defect      |                   Status:  open
             Priority:  normal      |                Component:  avformat
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+-------------------------------------

Comment (by stevenliu):

 Replying to [comment:58 beloko]:
 > Replying to [comment:56 stevenliu]:
 > > If you don't have encoder, just remux stream or file to hls, then the
 GOP size cannot decide by you, for example, get a video from me, I ask you
 remux it to HLS,   If transcode or modify the key frame interval I need
 cost lots of CPU, but i don't have lots of CPU, only used for IO ,for
 example CDN
 > >
 > > Download some video files, and just use -c copy to make HLS, maybe you
 can understand that.
 >
 > The segmenter with -v copy cuts the content where it can. When an Iframe
 is available. It depends how the source file was encoded before. Usually
 when the video codec found a scenecut to preserve picture quality.
 >
 > If the #EXT-X-TARGETDURATION value is 2 in the audio playlist and the
 #EXT-X-TARGETDURATION value is 1 in the video playlist. Fix the
 #EXT-X-TARGETDURATION value to 2 in the video playlist could solve your
 issue.

 for example this file:

 {{{
 MacBook:xxx StevenLiu$ ffprobe -select_streams v -show_packets -of xml
 ~/Movies/objectC/facebook.mp4 |grep "flags=\"K_\""
 ffprobe version N-83894-g4e3cc4b Copyright (c) 2007-2017 the FFmpeg
 developers
   built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
   configuration: --enable-libass --enable-opengl --enable-libx264
 --enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local
 --enable-libopencv --enable-libtesseract --enable-libspeex --enable-
 libfreetype --enable-libfontconfig --enable-libfdk-aac --enable-
 videotoolbox
   libavutil      55. 48.100 / 55. 48.100
   libavcodec     57. 83.100 / 57. 83.100
   libavformat    57. 66.104 / 57. 66.104
   libavdevice    57.  3.100 / 57.  3.100
   libavfilter     6. 76.100 /  6. 76.100
   libswscale      4.  3.101 /  4.  3.101
   libswresample   2.  4.100 /  2.  4.100
   libpostproc    54.  2.100 / 54.  2.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
 '/Users/StevenLiu/Movies/objectC/facebook.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf55.22.102
     description     : This File is Created by Easy RealMedia Tools@!
   Duration: 02:00:27.85, start: 0.000000, bitrate: 893 kb/s
     Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
 640x480, 797 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
     Metadata:
       handler_name    : VideoHandler
     Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
 stereo, fltp, 87 kb/s (default)
     Metadata:
       handler_name    : SoundHandler
         <packet codec_type="video" stream_index="0" pts="0"
 pts_time="0.000000" dts="-1024" dts_time="-0.080000" duration="512"
 duration_time="0.040000" size="10821" pos="48" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="128000"
 pts_time="10.000000" dts="126976" dts_time="9.920000" duration="512"
 duration_time="0.040000" size="34124" pos="1177352" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="256000"
 pts_time="20.000000" dts="254976" dts_time="19.920000" duration="512"
 duration_time="0.040000" size="37027" pos="2131255" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="297472"
 pts_time="23.240000" dts="296448" dts_time="23.160000" duration="512"
 duration_time="0.040000" size="9976" pos="2338695" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="404992"
 pts_time="31.640000" dts="403968" dts_time="31.560000" duration="512"
 duration_time="0.040000" size="41317" pos="3409409" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="475136"
 pts_time="37.120000" dts="474112" dts_time="37.040000" duration="512"
 duration_time="0.040000" size="47757" pos="4032978" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="587264"
 pts_time="45.880000" dts="586240" dts_time="45.800000" duration="512"
 duration_time="0.040000" size="44864" pos="4963173" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="658944"
 pts_time="51.480000" dts="657920" dts_time="51.400000" duration="512"
 duration_time="0.040000" size="25596" pos="5632046" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="757760"
 pts_time="59.200000" dts="756736" dts_time="59.120000" duration="512"
 duration_time="0.040000" size="54494" pos="6509848" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="882688"
 pts_time="68.960000" dts="881664" dts_time="68.880000" duration="512"
 duration_time="0.040000" size="45282" pos="7525818" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="949760"
 pts_time="74.200000" dts="948736" dts_time="74.120000" duration="512"
 duration_time="0.040000" size="51773" pos="8221447" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="1020928"
 pts_time="79.760000" dts="1019904" dts_time="79.680000" duration="512"
 duration_time="0.040000" size="42980" pos="8792146" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="1148416"
 pts_time="89.720000" dts="1147392" dts_time="89.640000" duration="512"
 duration_time="0.040000" size="54071" pos="9916720" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="1230336"
 pts_time="96.120000" dts="1229312" dts_time="96.040000" duration="512"
 duration_time="0.040000" size="43265" pos="10585199" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="1297408"
 pts_time="101.360000" dts="1296384" dts_time="101.280000" duration="512"
 duration_time="0.040000" size="22924" pos="11117246" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="1425408"
 pts_time="111.360000" dts="1424384" dts_time="111.280000" duration="512"
 duration_time="0.040000" size="33675" pos="12221046" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="1475072"
 pts_time="115.240000" dts="1474048" dts_time="115.160000" duration="512"
 duration_time="0.040000" size="37849" pos="12739731" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="1563648"
 pts_time="122.160000" dts="1562624" dts_time="122.080000" duration="512"
 duration_time="0.040000" size="45802" pos="13507637" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="1636864"
 pts_time="127.880000" dts="1635840" dts_time="127.800000" duration="512"
 duration_time="0.040000" size="50067" pos="14127715" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="1690624"
 pts_time="132.080000" dts="1689600" dts_time="132.000000" duration="512"
 duration_time="0.040000" size="47706" pos="14746403" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="1799680"
 pts_time="140.600000" dts="1798656" dts_time="140.520000" duration="512"
 duration_time="0.040000" size="51761" pos="15657409" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="1884672"
 pts_time="147.240000" dts="1883648" dts_time="147.160000" duration="512"
 duration_time="0.040000" size="27278" pos="16287661" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="2006016"
 pts_time="156.720000" dts="2004992" dts_time="156.640000" duration="512"
 duration_time="0.040000" size="46678" pos="17366396" flags="K_"/>
         <packet codec_type="video" stream_index="0" pts="2088448"
 pts_time="163.160000" dts="2087424" dts_time="163.080000" duration="512"
 duration_time="0.040000" size="51434" pos="18099029" flags="K_"/>
 }}}


 The keyframe is not set by me, just a VOD file from internet.



 {{{
 MacBook:xxx StevenLiu$ ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -c copy
 -f dash -hls_playlist 1 -an -min_seg_duration 1000000 -window_size 99999
 -t 100 output_test.mpd
 ffmpeg version N-89577-g4c78bbd313 Copyright (c) 2000-2017 the FFmpeg
 developers
   built with Apple LLVM version 8.1.0 (clang-802.0.42)
   configuration:
   libavutil      56.  6.100 / 56.  6.100
   libavcodec     58.  8.100 / 58.  8.100
   libavformat    58.  3.100 / 58.  3.100
   libavdevice    58.  0.100 / 58.  0.100
   libavfilter     7.  7.100 /  7.  7.100
   libswscale      5.  0.101 /  5.  0.101
   libswresample   3.  0.101 /  3.  0.101
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
 '/Users/StevenLiu/Movies/objectC/facebook.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf55.22.102
     description     : This File is Created by Easy RealMedia Tools@!
   Duration: 02:00:27.85, start: 0.000000, bitrate: 893 kb/s
     Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
 640x480, 797 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
     Metadata:
       handler_name    : VideoHandler
     Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
 stereo, fltp, 87 kb/s (default)
     Metadata:
       handler_name    : SoundHandler
 [dash @ 0x7fc93f01c800] Opening 'init-stream0.m4s' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 Output #0, dash, to 'output_test.mpd':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     description     : This File is Created by Easy RealMedia Tools@!
     encoder         : Lavf58.3.100
     Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
 640x480, q=2-31, 797 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
     Metadata:
       handler_name    : VideoHandler
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
 Press [q] to stop, [?] for help
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00001.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00002.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00003.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00004.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00005.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00006.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00007.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00008.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00009.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00010.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00011.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00012.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00013.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'chunk-stream0-00014.m4s.tmp' for writing
 [dash @ 0x7fc93f01c800] Opening 'output_test.mpd.tmp' for writing
 frame= 2502 fps=0.0 q=-1.0 Lsize=N/A time=00:01:39.96 bitrate=N/A
 speed=1.17e+03x
 video:9685kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: unknown
 MacBook:xxx StevenLiu$ cat media_0.m3u8
 #EXTM3U
 #EXT-X-VERSION:6
 #EXT-X-TARGETDURATION:10
 #EXT-X-MEDIA-SEQUENCE:1
 #EXT-X-MAP:URI="init-stream0.m4s"
 #EXTINF:10.000000,
 chunk-stream0-00001.m4s
 #EXTINF:10.000000,
 chunk-stream0-00002.m4s
 #EXTINF:3.240000,
 chunk-stream0-00003.m4s
 #EXTINF:8.400000,
 chunk-stream0-00004.m4s
 #EXTINF:5.480000,
 chunk-stream0-00005.m4s
 #EXTINF:8.760000,
 chunk-stream0-00006.m4s
 #EXTINF:5.600000,
 chunk-stream0-00007.m4s
 #EXTINF:7.720000,
 chunk-stream0-00008.m4s
 #EXTINF:9.760000,
 chunk-stream0-00009.m4s
 #EXTINF:5.240000,
 chunk-stream0-00010.m4s
 #EXTINF:5.560000,
 chunk-stream0-00011.m4s
 #EXTINF:9.960000,
 chunk-stream0-00012.m4s
 #EXTINF:6.400000,
 chunk-stream0-00013.m4s
 #EXTINF:3.960000,
 chunk-stream0-00014.m4s
 #EXT-X-ENDLIST
 MacBook:xxx StevenLiu$
 }}}

 Then the duration of file is not control by myself.

 I have no question and have no problem, i just tell you, the problem is
 not EXT-X-TARGETDURATION different problem, and Pantos said is right.

 I think you can fix the problem use the
 https://trac.ffmpeg.org/ticket/6915?replyto=58#comment:57 way if you worry
 to fix it.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6915#comment:59>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list