[FFmpeg-trac] #8783(avformat:new): I am trying to generate an encrypted single file hls stream but the output segment is not encrypted

FFmpeg trac at avcodec.org
Thu Jul 9 12:14:51 EEST 2020


#8783: I am trying to generate an encrypted single file hls stream but the output
segment is not encrypted
-------------------------------------+-------------------------------------
             Reporter:  noobcryptor  |                     Type:  defect
               Status:  new          |                 Priority:  important
            Component:  avformat     |                  Version:  git-
             Keywords:  hls          |  master
  encryption aes-128                 |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 the output single file segment is not encrypted and when I remove the
 EXT-X-KEY tag I can play it using a normal video player.

 while previous versions of ffmpeg encrypted the single file successfully,
 but the output byte ranges were wrong.
 How to reproduce:
 {{{
 ffmpeg -i test.mp4 -hls_flags single_file -hls_key_info_file key.info
 playlist.m3u8

 ffmpeg version: latest snapshot

 }}}

 log :
 {{{
   ffmpeg -i test.mp4 -hls_flags single_file -hls_key_info_file key.info
 playlist.m3u8
 ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
   built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
   configuration: --pkgconfigdir=/home/vertexpotato/ffmpeg-build-
 script/workspace/lib/pkgconfig --prefix=/home/vertexpotato/ffmpeg-build-
 script/workspace --pkg-config-flags=--static --extra-
 cflags=-I/home/vertexpotato/ffmpeg-build-script/workspace/include --extra-
 ldflags=-L/home/vertexpotato/ffmpeg-build-script/workspace/lib --extra-
 libs='-lpthread -lm' --enable-static --disable-debug --disable-shared
 --disable-ffplay --disable-doc --enable-openssl --enable-gpl --enable-
 version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-
 libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
 --enable-libx264 --enable-libx265 --enable-runtime-cpudetect --enable-
 libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-
 libopencore_amrnb --enable-filters --enable-libvidstab --enable-libaom
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 1
     compatible_brands: mp42avc1
     creation_time   : 2011-03-16T10:41:51.000000Z
   Duration: 00:01:00.08, start: 0.000000, bitrate: 699 kb/s
     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 640x360, 633 kb/s,
 24.04 fps, 24.04 tbr, 2500 tbn, 5k tbc (default)
     Metadata:
       creation_time   : 2011-03-16T10:41:52.000000Z
       handler_name    : Apple Video Media Handler
     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono,
 fltp, 62 kb/s (default)
     Metadata:
       creation_time   : 2011-03-16T10:41:53.000000Z
       handler_name    : Apple Sound Media Handler
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
   Stream #0:1 -> #0:1 (aac (native) -> aac (native))
 Press [q] to stop, [?] for help
 [libx264 @ 0x56153359ca00] using cpu capabilities: MMX2 SSE2Fast SSSE3
 SSE4.2 AVX FMA3 BMI2 AVX2
 [libx264 @ 0x56153359ca00] profile High, level 3.0, 4:2:0, 8-bit
 [libx264 @ 0x56153359ca00] 264 - core 160 - 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=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=250 keyint_min=24
 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
 [hls @ 0x56153359bfc0] Opening 'key.info' for reading
 [hls @ 0x56153359bfc0] Opening 'file.key' for reading
 [hls @ 0x56153359bfc0] Opening 'playlist.ts' for writing
 Output #0, hls, to 'playlist.m3u8':
   Metadata:
     major_brand     : mp42
     minor_version   : 1
     compatible_brands: mp42avc1
     encoder         : Lavf58.45.100
     Stream #0:0(eng): Video: h264 (libx264), yuv420p(progressive),
 640x360, q=-1--1, 24.04 fps, 90k tbn, 24.04 tbc (default)
     Metadata:
       creation_time   : 2011-03-16T10:41:52.000000Z
       handler_name    : Apple Video Media Handler
       encoder         : Lavc58.91.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
     Stream #0:1(eng): Audio: aac (LC), 44100 Hz, mono, fltp, 69 kb/s
 (default)
     Metadata:
       creation_time   : 2011-03-16T10:41:53.000000Z
       handler_name    : Apple Sound Media Handler
       encoder         : Lavc58.91.100 aac
 [hls @ 0x56153359bfc0] Opening 'playlist.m3u8.tmp' for writing/A
 speed=12.5x
     Last message repeated 2 times
 [hls @ 0x56153359bfc0] Opening 'playlist.m3u8.tmp' for writing/A
 speed=12.4x
 [hls @ 0x56153359bfc0] Opening 'playlist.m3u8.tmp' for writing/A
 speed=12.7x
 [hls @ 0x56153359bfc0] Opening 'playlist.m3u8.tmp' for writing/A speed=
 12x
 [hls @ 0x56153359bfc0] Opening 'playlist.m3u8.tmp' for writing/A
 speed=11.7x
 [hls @ 0x56153359bfc0] Opening 'playlist.m3u8.tmp' for writing/A
 speed=11.6x
 [hls @ 0x56153359bfc0] Opening 'playlist.m3u8.tmp' for writing/A
 speed=11.8x
 frame= 1445 fps=279 q=-1.0 Lsize=N/A time=00:01:00.09 bitrate=N/A
 speed=11.6x
 video:4097kB audio:509kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: unknown
 [libx264 @ 0x56153359ca00] frame I:10    Avg QP:18.01  size: 34297
 [libx264 @ 0x56153359ca00] frame P:762   Avg QP:22.29  size:  4380
 [libx264 @ 0x56153359ca00] frame B:673   Avg QP:27.39  size:   764
 [libx264 @ 0x56153359ca00] consecutive B-frames: 34.8%  7.1%  6.6% 51.5%
 [libx264 @ 0x56153359ca00] mb I  I16..4: 16.7% 20.5% 62.8%
 [libx264 @ 0x56153359ca00] mb P  I16..4:  1.5%  3.7%  1.3%  P16..4: 31.7%
 11.0%  5.5%  0.0%  0.0%    skip:45.4%
 [libx264 @ 0x56153359ca00] mb B  I16..4:  0.6%  0.7%  0.1%  B16..8: 36.4%
 4.5%  0.9%  direct: 1.7%  skip:55.1%  L0:50.9% L1:44.9% BI: 4.2%
 [libx264 @ 0x56153359ca00] 8x8 transform intra:50.8% inter:44.8%
 [libx264 @ 0x56153359ca00] coded y,uvDC,uvAC intra: 40.3% 45.6% 17.7%
 inter: 10.0% 11.5% 1.5%
 [libx264 @ 0x56153359ca00] i16 v,h,dc,p: 38% 33% 15% 14%
 [libx264 @ 0x56153359ca00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 21% 31%  2%
 3%  3%  3%  3%  3%
 [libx264 @ 0x56153359ca00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 17% 15%  7%
 8%  7%  8%  7%  7%
 [libx264 @ 0x56153359ca00] i8c dc,h,v,p: 59% 23% 13%  5%
 [libx264 @ 0x56153359ca00] Weighted P-Frames: Y:3.7% UV:1.8%
 [libx264 @ 0x56153359ca00] ref P L0: 77.5%  9.1% 10.5%  2.6%  0.3%
 [libx264 @ 0x56153359ca00] ref B L0: 93.5%  5.9%  0.6%
 [libx264 @ 0x56153359ca00] ref B L1: 96.8%  3.2%
 [libx264 @ 0x56153359ca00] kb/s:558.25
 [aac @ 0x5615335802c0] Qavg: 227.509
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8783>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list