Opened 7 years ago

Last modified 6 years ago

#7021 new defect

ffmpeg with -hls_flags single_file return incorrect byterange in playlist

Reported by: loki5100 Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: hls
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Under windows with the build 20180214-dc77e64, When i run the command below (-hls_flags single_file)

ffmpeg.exe ^
-i "C:\Temp\ffmpeg\big_buck_bunny.avi" ^
-loglevel verbose ^
-an ^
-sn ^
-vcodec libx264 ^
-force_key_frames "expr:gte(t,n_forced*4)" ^
-r 25 ^
-f hls ^
-hls_time 4 ^
-hls_list_size 99999 ^
-start_number 1 ^
-hls_segment_type fmp4 ^
-hls_fmp4_init_filename "C:\Temp\ffmpeg\result_init.mp4" ^
-t 30 ^
-hls_flags single_file ^
"C:\Temp\ffmpeg\result.m3u8"

it's return this :

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-MAP:URI="C:\Temp\ffmpeg\result.m4s",BYTERANGE="819@0"
#EXTINF:4.000000,
#EXT-X-BYTERANGE:819@0
result.m4s
#EXTINF:4.000000,
#EXT-X-BYTERANGE:414913@819
result.m4s
#EXTINF:4.000000,
#EXT-X-BYTERANGE:206686@415732
result.m4s
#EXTINF:4.000000,
#EXT-X-BYTERANGE:58996@622418
result.m4s
#EXTINF:4.000000,
#EXT-X-BYTERANGE:-478619@681414
result.m4s
#EXTINF:4.000000,
#EXT-X-BYTERANGE:146546@202795
result.m4s
#EXTINF:4.000000,
#EXT-X-BYTERANGE:422670@349341
result.m4s
#EXTINF:2.000000,
#EXT-X-BYTERANGE:-771811@772011
result.m4s
#EXT-X-ENDLIST

byterange like
#EXT-X-BYTERANGE:-771811@772011
if off course not correct

source mp4: http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi

Attachments (1)

bbb.m4s (227.1 KB ) - added by loki5100 7 years ago.
m4s seam to be also broken

Download all attachments as: .zip

Change History (11)

comment:1 by Carl Eugen Hoyos, 7 years ago

Component: ffmpegundetermined
Keywords: hls added; hls_flags single_file removed
Priority: criticalnormal

Please provide the command line you tested together with the complete, uncut console output to make this a valid ticket.

comment:2 by loki5100, 7 years ago

sure find below the command line with the complete, uncut console output

ffmpeg.exe -i "http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4" -loglevel verbose -c:a aac -b:a 128k -c:v hevc -b:v 4977k -maxrate 4977k -bufsize 7466k -x265-params "keyint=60:min-keyint=60:open-gop=0:scenecut=0" -r 483570000/16117951 -t 30 -sn -movflags faststart -preset ultrafast -pix_fmt yuv420p -hls_time 4 -hls_segment_type fmp4 -hls_list_size 0 -hls_flags single_file -hls_fmp4_init_filename C:\temp\ffmpeg\bbb_init.mp4 C:\temp\ffmpeg\bbb.m3u8
C:\Temp\ffmpeg>ffmpeg.exe ^
More? -i "http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4" ^
More? -loglevel verbose ^
More? -c:a aac ^
More? -b:a 128k ^
More? -c:v hevc ^
More? -b:v 4977k -maxrate 4977k -bufsize 7466k ^
More? -x265-params "keyint=60:min-keyint=60:open-gop=0:scenecut=0" ^
More? -r 483570000/16117951 ^
More? -t 30 ^
More? -sn ^
More? -movflags faststart ^
More? -preset ultrafast ^
More? -pix_fmt yuv420p ^
More? -hls_time 4 ^
More? -hls_segment_type fmp4 ^
More? -hls_list_size 0 ^
More? -hls_flags single_file ^
More? -hls_fmp4_init_filename C:\temp\ffmpeg\bbb_init.mp4 ^
More? C:\temp\ffmpeg\bbb.m3u8
ffmpeg version N-90056-gdc77e64f2d Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libblur
ay --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enab
le-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --en
able-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enabl
e-libspeex --enable-libxvid --enable-libmfx --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth
  libavutil      56.  7.101 / 56.  7.101
  libavcodec     58. 11.101 / 58. 11.101
  libavformat    58.  9.100 / 58.  9.100
  libavdevice    58.  1.100 / 58.  1.100
  libavfilter     7. 12.100 /  7. 12.100
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
[h264 @ 0000002849eb0d40] Reinit context to 1920x1088, pix_fmt: yuv420p
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2013-12-16T17:44:39.000000Z
    title           : Big Buck Bunny, Sunflower version
    artist          : Blender Foundation 2008, Janus Bager Kristensen 2013
    comment         : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
    genre           : Animation
    composer        : Sacha Goedegebure
  Duration: 00:10:34.53, start: 0.000000, bitrate: 3481 kb/s
    Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 2998 kb/s, 30 fps, 30
tbr, 30k tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2013-12-16T17:44:39.000000Z
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 160 kb/s (default)
    Metadata:
      creation_time   : 2013-12-16T17:44:42.000000Z
      handler_name    : GPAC ISO Audio Handler
    Stream #0:2(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 320 kb/s (default)
    Metadata:
      creation_time   : 2013-12-16T17:44:42.000000Z
      handler_name    : GPAC ISO Audio Handler
    Side data:
      audio service type: main
Matched encoder 'libx265' for codec 'hevc'.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
  Stream #0:2 -> #0:1 (ac3 (native) -> aac (native))
Press [q] to stop, [?] for help
[h264 @ 0000002849e9ae80] Reinit context to 1920x1088, pix_fmt: yuv420p
[graph 0 input from stream 0:0 @ 000000284c65ee80] w:1920 h:1080 pixfmt:yuv420p tb:1/30000 fr:30/1 sar:1/1 sws_param:flags=2
x265 [info]: HEVC encoder version 2.6+37-1949157705ce
x265 [info]: build info [Windows][GCC 7.2.0][64 bit] 8bit+10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(34 rows)
x265 [info]: Coding QT: max CU size, min CU size : 32 / 16
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : dia / 57 / 0 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 60 / 60 / 0 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 5 / 3 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 0 / 0
x265 [info]: References / ref-limit  cu / depth  : 1 / off / off
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 0.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : ABR-4977 kbps / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 early-skip rskip tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock
*** 2 dup!
[graph_1_in_0_2 @ 000000284a64e880] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x60f
[aac @ 000000284a93ddc0] Using a PCE to encode channel layout
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb_init.mp4' for writing
Output #0, hls, to 'C:\temp\ffmpeg\bbb.m3u8':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    composer        : Sacha Goedegebure
    title           : Big Buck Bunny, Sunflower version
    artist          : Blender Foundation 2008, Janus Bager Kristensen 2013
    comment         : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
    genre           : Animation
    encoder         : Lavf58.9.100
    Stream #0:0(und): Video: hevc (libx265), 1 reference frame, yuv420p(progressive, left), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 4977 kb/s, 30 fps, 998795.00 t
bn, 30 tbc (default)
    Metadata:
      creation_time   : 2013-12-16T17:44:39.000000Z
      handler_name    : GPAC ISO Video Handler
      encoder         : Lavc58.11.101 libx265
    Stream #0:1(und): Audio: aac (LC), 48000 Hz, 5.1(side), fltp, delay 1024, 128 kb/s (default)
    Metadata:
      creation_time   : 2013-12-16T17:44:42.000000Z
      handler_name    : GPAC ISO Audio Handler
      encoder         : Lavc58.11.101 aac
    Side data:
      audio service type: main
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m4s' for writing2 drop=0 speed=2.06x
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m3u8.tmp' for writing
EXT-X-MEDIA-SEQUENCE:0
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m4s' for writing2 drop=0 speed=1.72x
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m3u8.tmp' for writing
EXT-X-MEDIA-SEQUENCE:0
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m4s' for writing2 drop=0 speed=1.64x
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m3u8.tmp' for writing
EXT-X-MEDIA-SEQUENCE:0
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m4s' for writing2 drop=0 speed=1.65x
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m3u8.tmp' for writing
EXT-X-MEDIA-SEQUENCE:0
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m4s' for writing2 drop=0 speed=1.65x
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m3u8.tmp' for writing
EXT-X-MEDIA-SEQUENCE:0
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m4s' for writing2 drop=0 speed=1.71x
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m3u8.tmp' for writing
EXT-X-MEDIA-SEQUENCE:0
No more output streams to write to, finishing.:29.73 bitrate=N/A dup=2 drop=0 speed=1.71x
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m4s' for writing
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m3u8.tmp' for writing
EXT-X-MEDIA-SEQUENCE:0
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m4s' for writing
[hls @ 000000284a8e2040] Opening 'C:\temp\ffmpeg\bbb.m3u8.tmp' for writing
EXT-X-MEDIA-SEQUENCE:0
frame=  901 fps= 51 q=-0.0 Lsize=N/A time=00:00:30.01 bitrate=N/A dup=2 drop=0 speed=1.68x
video:23439kB audio:470kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: unknown
Input file #0 (http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4):
  Input stream #0:0 (video): 910 packets read (11573775 bytes); 901 frames decoded;
  Input stream #0:1 (audio): 21 packets read (10080 bytes);
  Input stream #0:2 (audio): 946 packets read (1210880 bytes); 946 frames decoded (1453056 samples);
  Total: 1877 packets (12794735 bytes) demuxed
Output file #0 (C:\temp\ffmpeg\bbb.m3u8):
  Output stream #0:0 (video): 901 frames encoded; 901 packets muxed (24001991 bytes);
  Output stream #0:1 (audio): 1407 frames encoded (1440000 samples); 1408 packets muxed (481577 bytes);
  Total: 2309 packets (24483568 bytes) muxed
x265 [info]: frame I:     16, Avg QP:19.38  kb/s: 54461.61
x265 [info]: frame P:    227, Avg QP:20.80  kb/s: 15128.22
x265 [info]: frame B:    658, Avg QP:23.70  kb/s: 2210.48
x265 [info]: consecutive B-frames: 7.4% 0.8% 5.3% 86.4%

encoded 901 frames in 17.87s (50.43 fps), 6392.88 kb/s, Avg QP:22.90
[aac @ 000000284a93ddc0] Qavg: 134.647

and the content of bbb.m3u8:

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-MAP:URI="C:\temp\ffmpeg\bbb.m4s",BYTERANGE="3666@0"
#EXTINF:5.999610,
#EXT-X-BYTERANGE:3666@0
bbb.m4s
#EXTINF:3.999740,
#EXT-X-BYTERANGE:7948714@3666
bbb.m4s
#EXTINF:3.999740,
#EXT-X-BYTERANGE:-2932786@7952380
bbb.m4s
#EXTINF:3.999740,
#EXT-X-BYTERANGE:-1690139@5019594
bbb.m4s
#EXTINF:3.999740,
#EXT-X-BYTERANGE:-1355411@3329455
bbb.m4s
#EXTINF:3.999740,
#EXT-X-BYTERANGE:-1147050@1974044
bbb.m4s
#EXTINF:3.999740,
#EXT-X-BYTERANGE:1131975@826994
bbb.m4s
#EXTINF:0.033331,
#EXT-X-BYTERANGE:-1958593@1958969
bbb.m4s
#EXT-X-ENDLIST

also the bbb.mp4 is broken and can't play (file attached)

Last edited 7 years ago by loki5100 (previous) (diff)

by loki5100, 7 years ago

Attachment: bbb.m4s added

m4s seam to be also broken

comment:3 by loki5100, 7 years ago

Is everything ok with this tiket or do you need more info ?

comment:4 by Steven Liu, 7 years ago

comment:5 by loki5100, 7 years ago

thanks Steven, unfortunatly I under windows and I don't know how to compile ffmpeg and I don't have the tools to compile it... maybe i can wait the next nightly build of ffmpeg to try ?

in reply to:  5 comment:6 by Steven Liu, 7 years ago

Replying to loki5100:

thanks Steven, unfortunatly I under windows and I don't know how to compile ffmpeg and I don't have the tools to compile it... maybe i can wait the next nightly build of ffmpeg to try ?

I test it have been fixed local, so need full review.
That's ok, just wait the patch full reviewed by other guys, don't worry :D

comment:7 by loki5100, 7 years ago

thanks Steven, i fell useless that i can't compile it :( did this patch will also correct this bug: https://trac.ffmpeg.org/ticket/7023 ?

in reply to:  7 comment:8 by Steven Liu, 7 years ago

Replying to loki5100:

thanks Steven, i fell useless that i can't compile it :( did this patch will also correct this bug: https://trac.ffmpeg.org/ticket/7023 ?

no just this ticket, that ticket need new patch to fix it.

comment:9 by loki5100, 7 years ago

ok thanks Steven I hope the other ticket will also get corrected soon ...

comment:10 by loki5100, 6 years ago

Hello, is their any new about this bug? did someone succeed to compile the patch and test it ?

Note: See TracTickets for help on using tickets.