[FFmpeg-devel] [PATCH] avformat/hlsenc: creation of hls variant streams with master playlist in a single hlsenc instance

Steven Liu lingjiujianke at gmail.com
Wed Nov 8 04:58:52 EET 2017


2017-11-07 21:32 GMT+08:00 Dixit, Vishwanath <vdixit at akamai.com>:
>
>
>>On 11/3/17, 8:31 PM, "刘歧" <lq at chinaffmpeg.org> wrote:
>>look at your mail title please!
>>    and read the test case which i write for the fate-filter-hls-append
>
> Thanks for your clarification on sample HLS encoder test.  I have referred to the test fate-filter-hls-append and added one more test with name filter-hls-vs-with-master. This new test verifies HLS variant stream creation and master playlist creation.
> Apart from this, I have made a minor snprintf related update, based on the comment by Michael Niedermayer and also have re-based the earlier patches. Please find the updated patches in the attachment and let us know if they are fine.
>
> Thanks & Regards,
> Vishwanath
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


There have no master playlist after use patchset:

test command line at bellow:


liuqideMBP:xxx liuqi$ ./ffmpeg -f lavfi -i color=red -f lavfi -i
anullsrc -g 25 -r 25 -b:v:0 1000k -b:v:1 256k -b:a:1 64k -b:a:1 32k
-map 0:v -map 1:a -map 0:v -map 1:a -f hls -var_stream_map "v:0,a:0
v:1,a:1" -t 10 -hls_time 2 output_sl.m3u8
ffmpeg version N-88638-gc72abbd0dc Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.1.0 (clang-802.0.42)
  configuration: --enable-fontconfig --enable-gpl --enable-libass
--enable-libbluray --enable-libfreetype --enable-libmp3lame
--enable-libspeex --enable-libx264 --enable-libx265
--enable-libfdk-aac --enable-version3 --cc='ccache gcc'
--enable-nonfree --enable-videotoolbox
  libavutil      56.  0.100 / 56.  0.100
  libavcodec     58.  1.100 / 58.  1.100
  libavformat    58.  2.102 / 58.  2.102
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7.  0.101 /  7.  0.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Input #0, lavfi, from 'color=red':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240
[SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #1, lavfi, from 'anullsrc':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_u8 (native) -> aac (native))
  Stream #0:0 -> #0:2 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:3 (pcm_u8 (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x7fdf7e040c00] using SAR=1/1
[libx264 @ 0x7fdf7e040c00] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX
[libx264 @ 0x7fdf7e040c00] profile High, level 2.0
[libx264 @ 0x7fdf7e040c00] 264 - core 148 r2694 3b70645 - H.264/MPEG-4
AVC codec - Copyleft 2003-2016 - 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=6 lookahead_threads=1 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=25
keyint_min=2 scenecut=40 intra_refresh=0 rc_lookahead=25 rc=abr
mbtree=1 bitrate=1000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4
ip_ratio=1.40 aq=1:1.00
[libx264 @ 0x7fdf7e043600] using SAR=1/1
[libx264 @ 0x7fdf7e043600] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX
[libx264 @ 0x7fdf7e043600] profile High, level 1.3
[libx264 @ 0x7fdf7e043600] 264 - core 148 r2694 3b70645 - H.264/MPEG-4
AVC codec - Copyleft 2003-2016 - 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=6 lookahead_threads=1 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=25
keyint_min=2 scenecut=40 intra_refresh=0 rc_lookahead=25 rc=abr
mbtree=1 bitrate=256 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4
ip_ratio=1.40 aq=1:1.00
[hls @ 0x7fdf7e03f000] Opening 'output_sl0_0.ts' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl0_1.ts' for writing
Output #0, hls, to 'output_sl.m3u8':
  Metadata:
    encoder         : Lavf58.2.102
    Stream #0:0: Video: h264 (libx264), yuv420p(progressive), 320x240
[SAR 1:1 DAR 4:3], q=-1--1, 1000 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.1.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/1000000 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.1.100 aac
    Stream #0:2: Video: h264 (libx264), yuv420p(progressive), 320x240
[SAR 1:1 DAR 4:3], q=-1--1, 256 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.1.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/256000 buffer size: 0 vbv_delay: -1
    Stream #0:3: Audio: aac (LC), 44100 Hz, stereo, fltp, 32 kb/s
    Metadata:
      encoder         : Lavc58.1.100 aac
[hls @ 0x7fdf7e03f000] Opening 'output_sl1_0.ts' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl_0.m3u8.tmp' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl1_1.ts' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl_1.m3u8.tmp' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl2_0.ts' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl_0.m3u8.tmp' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl2_1.ts' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl_1.m3u8.tmp' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl3_0.ts' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl_0.m3u8.tmp' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl3_1.ts' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl_1.m3u8.tmp' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl4_0.ts' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl_0.m3u8.tmp' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl4_1.ts' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl_1.m3u8.tmp' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl_0.m3u8.tmp' for writing
[hls @ 0x7fdf7e03f000] Opening 'output_sl_1.m3u8.tmp' for writing
frame=  250 fps=0.0 q=-1.0 Lq=-1.0 size=N/A time=00:00:10.00
bitrate=N/A speed=  28x
video:11kB audio:5kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
[libx264 @ 0x7fdf7e040c00] frame I:10    Avg QP: 0.40  size:    72
[libx264 @ 0x7fdf7e040c00] frame P:60    Avg QP: 0.12  size:    22
[libx264 @ 0x7fdf7e040c00] frame B:180   Avg QP: 0.29  size:    16
[libx264 @ 0x7fdf7e040c00] consecutive B-frames:  4.0%  0.0%  0.0% 96.0%
[libx264 @ 0x7fdf7e040c00] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x7fdf7e040c00] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:
0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
[libx264 @ 0x7fdf7e040c00] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:
0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%
[libx264 @ 0x7fdf7e040c00] final ratefactor: -29.28
[libx264 @ 0x7fdf7e040c00] 8x8 transform intra:0.0%
[libx264 @ 0x7fdf7e040c00] coded y,uvDC,uvAC intra: 0.0% 0.3% 0.0%
inter: 0.0% 0.0% 0.0%
[libx264 @ 0x7fdf7e040c00] i16 v,h,dc,p: 93%  0%  7%  0%
[libx264 @ 0x7fdf7e040c00] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 0x7fdf7e040c00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fdf7e040c00] kb/s:4.00
[aac @ 0x7fdf7e042400] Qavg: 65536.000
[libx264 @ 0x7fdf7e043600] frame I:10    Avg QP: 1.50  size:    71
[libx264 @ 0x7fdf7e043600] frame P:60    Avg QP: 0.62  size:    22
[libx264 @ 0x7fdf7e043600] frame B:180   Avg QP: 0.99  size:    16
[libx264 @ 0x7fdf7e043600] consecutive B-frames:  4.0%  0.0%  0.0% 96.0%
[libx264 @ 0x7fdf7e043600] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x7fdf7e043600] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:
0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
[libx264 @ 0x7fdf7e043600] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:
0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%
[libx264 @ 0x7fdf7e043600] final ratefactor: -16.46
[libx264 @ 0x7fdf7e043600] 8x8 transform intra:0.0%
[libx264 @ 0x7fdf7e043600] coded y,uvDC,uvAC intra: 0.0% 0.3% 0.0%
inter: 0.0% 0.0% 0.0%
[libx264 @ 0x7fdf7e043600] i16 v,h,dc,p: 93%  0%  7%  0%
[libx264 @ 0x7fdf7e043600] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 0x7fdf7e043600] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fdf7e043600] kb/s:3.98
[aac @ 0x7fdf7e044e00] Qavg: 65396.809
liuqideMBP:xxx liuqi$ ls -l *.m3u8 *.ts
-rw-r--r--  1 liuqi  staff  12596 11  8 10:57 output_sl0_0.ts
-rw-r--r--  1 liuqi  staff  12596 11  8 10:57 output_sl0_1.ts
-rw-r--r--  1 liuqi  staff  11844 11  8 10:57 output_sl1_0.ts
-rw-r--r--  1 liuqi  staff  11844 11  8 10:57 output_sl1_1.ts
-rw-r--r--  1 liuqi  staff  11844 11  8 10:57 output_sl2_0.ts
-rw-r--r--  1 liuqi  staff  11844 11  8 10:57 output_sl2_1.ts
-rw-r--r--  1 liuqi  staff  11844 11  8 10:57 output_sl3_0.ts
-rw-r--r--  1 liuqi  staff  11844 11  8 10:57 output_sl3_1.ts
-rw-r--r--  1 liuqi  staff  11844 11  8 10:57 output_sl4_0.ts
-rw-r--r--  1 liuqi  staff  11844 11  8 10:57 output_sl4_1.ts
-rw-r--r--  1 liuqi  staff    258 11  8 10:57 output_sl_0.m3u8
-rw-r--r--  1 liuqi  staff    258 11  8 10:57 output_sl_1.m3u8
liuqideMBP:xxx liuqi$


More information about the ffmpeg-devel mailing list