[FFmpeg-user] HLS noAES to HLS with AES

Zsolt zsocam at gmail.com
Mon Jun 27 16:07:44 CEST 2016


Hello Guys,
I have my HLS videos with no AES.
Can I add AES without reencoding?
This is my first try:

*ffmpeg -i input.m3u8 \*
* -map 0:0 -map 0:1 \*
* -c:v:0 copy -c:a:1 copy -hls_segment_filename ffmpeg/segment_0_%01d.ts \*
* -hls_time 10 -hls_list_size 0 -hls_key_info_file file.keyinfo
ffmpeg/index_0.m3u8 \*
* \*
* -map 0:2 -map 0:3 \*
* -c:v:2 copy -c:a:3 copy -hls_segment_filename ffmpeg/segment_1_%01d.ts \*
* -hls_time 10 -hls_list_size 0 -hls_key_info_file file.keyinfo
ffmpeg/index_1.m3u8 \*
* \*
* -map 0:4 -map 0:5 \*
* -c:v:4 copy -c:a:5 copy -hls_segment_filename ffmpeg/segment_2_%01d.ts \*
* -hls_time 10 -hls_list_size 0 -hls_key_info_file file.keyinfo
ffmpeg/index_2.m3u8 \*
* \*
* -map 0:6 -map 0:7 \*
* -c:v:6 copy -c:a:7 copy -hls_segment_filename ffmpeg/segment_3_%01d.ts \*
* -hls_time 10 -hls_list_size 0 -hls_key_info_file file.keyinfo
ffmpeg/index_3.m3u8 \*
* \*
* -map 0:8 -map 0:9 \*
* -c:v:8 copy -c:a:9 copy -hls_segment_filename ffmpeg/segment_4_%01d.ts \*
* -hls_time 10 -hls_list_size 0 -hls_key_info_file file.keyinfo
ffmpeg/index_4.m3u8 \*
* \*
* -map 0:10 -map 0:11 \*
* -c:v:10 copy -c:a:11 copy -hls_segment_filename ffmpeg/segment_5_%01d.ts
\*
* -hls_time 10 -hls_list_size 0 -hls_key_info_file file.keyinfo
ffmpeg/index_5.m3u8*

It freeze after the version numbers, then if I press exit, it shows the
output:

* ffmpeg version N-80765-ge9394ca Copyright (c) 2000-2016 the FFmpeg
developers*
*  built with gcc 4.9.2 (Debian 4.9.2-10)*
*  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static
--extra-cflags=-I/root/ffmpeg_build/include
       --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin
--enable-gpl --enable-libass --enable-libfdk-aac --enable
                    -libfreetype --enable-libmp3lame --enable-libtheora
--enable-libvorbis --enable-libx264 --enable-nonfree*
*  libavutil      55. 27.100 / 55. 27.100*
*  libavcodec     57. 48.101 / 57. 48.101*
*  libavformat    57. 40.101 / 57. 40.101*
*  libavdevice    57.  0.101 / 57.  0.101*
*  libavfilter     6. 46.102 /  6. 46.102*
*  libswscale      4.  1.100 /  4.  1.100*
*  libswresample   2.  1.100 /  2.  1.100*
*  libpostproc    54.  0.100 / 54.  0.100*
* [mpegts @ 0x3e81440] PES packet size mismatch*
* Input #0, hls,applehttp, from 'input.m3u8':*
*  Duration: 00:23:15.29, bitrate: 0 kb/s*
*  Program 0*
*    Metadata:*
*      variant_bitrate : 634047*
*    Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p,
384x216 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc*
*    Metadata:*
*      variant_bitrate : 634047*
*    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 68 kb/s*
*    Metadata:*
*      variant_bitrate : 634047*
*  Program 1*
*    Metadata:*
*      variant_bitrate : 940569*
*    Stream #0:2: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p,
480x270 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc*
*    Metadata:*
*      variant_bitrate : 940569*
*    Stream #0:3: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 68 kb/s*
*    Metadata:*
*      variant_bitrate : 940569*
*  Program 2*
*    Metadata:*
*      variant_bitrate : 1349264*
*    Stream #0:4: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p,
640x360 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc*
*    Metadata:*
*      variant_bitrate : 1349264*
*    Stream #0:5: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 68 kb/s*
*    Metadata:*
*      variant_bitrate : 1349264*
*  Program 3*
*    Metadata:*
*      variant_bitrate : 1655786*
*    Stream #0:6: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p,
640x360 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc*
*    Metadata:*
*      variant_bitrate : 1655786*
*    Stream #0:7: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 68 kb/s*
*    Metadata:*
*      variant_bitrate : 1655786*
*  Program 4*
*    Metadata:*
*      variant_bitrate : 2166656*
*    Stream #0:8: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p,
1024x576 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc*
*    Metadata:*
*      variant_bitrate : 2166656*
*    Stream #0:9: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 68 kb/s*
*    Metadata:*
*      variant_bitrate : 2166656*
*  Program 5*
*    Metadata:*
*      variant_bitrate : 2677525*
*    Stream #0:10: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p,
1280x720 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc*
*    Metadata:*
*      variant_bitrate : 2677525*
*    Stream #0:11: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 64 kb/s*
*    Metadata:*
*      variant_bitrate : 2677525*
* [hls @ 0x46a0f40] Frame rate very high for a muxer not efficiently
supporting it.*
* Please consider specifying a lower framerate, a different muxer or -vsync
2*
* [hls @ 0x491e260] Frame rate very high for a muxer not efficiently
supporting it.*
* Please consider specifying a lower framerate, a different muxer or -vsync
2*
* [hls @ 0x42aa0c0] Frame rate very high for a muxer not efficiently
supporting it.*
* Please consider specifying a lower framerate, a different muxer or -vsync
2*
* [hls @ 0x48f8040] Frame rate very high for a muxer not efficiently
supporting it.*
* Please consider specifying a lower framerate, a different muxer or -vsync
2*
* [hls @ 0x48fc440] Frame rate very high for a muxer not efficiently
supporting it.*
* Please consider specifying a lower framerate, a different muxer or -vsync
2*
* [libx264 @ 0x46a2dc0] using SAR=1/1*
* [libx264 @ 0x46a2dc0] MB rate (45900000) > level limit (2073600)*
* [libx264 @ 0x46a2dc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2*
* [libx264 @ 0x46a2dc0] profile High, level 5.2*
* [libx264 @ 0x491fe80] using SAR=1/1*
* [libx264 @ 0x491fe80] MB rate (82800000) > level limit (2073600)*
* [libx264 @ 0x491fe80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2*
* [libx264 @ 0x491fe80] profile High, level 5.2*
* [libx264 @ 0x42abcc0] using SAR=1/1*
* [libx264 @ 0x42abcc0] MB rate (82800000) > level limit (2073600)*
* [libx264 @ 0x42abcc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2*
* [libx264 @ 0x42abcc0] profile High, level 5.2*
* [libx264 @ 0x48f9920] using SAR=1/1*
* [libx264 @ 0x48f9920] MB rate (207360000) > level limit (2073600)*
* [libx264 @ 0x48f9920] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2*
* [libx264 @ 0x48f9920] profile High, level 5.2*
* [libx264 @ 0x48fe100] using SAR=1/1*
* [libx264 @ 0x48fe100] MB rate (324000000) > level limit (2073600)*
* [libx264 @ 0x48fe100] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2*
* [libx264 @ 0x48fe100] profile High, level 5.2*
* [hls @ 0x3e5e340] Using AVStream.codec to pass codec parameters to muxers
is deprecated, use AVStream.codecpar instead.*
*    Last message repeated 1 times*
* [hls muxer @ 0x3e76ea0] no key URI specified in key info file*
* Output #0, hls, to 'ffmpeg/index_0.m3u8':*
*  Metadata:*
*    encoder         : Lavf57.40.101*
*    Stream #0:0: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 384x216
[SAR 1:1 DAR 16:9], q=2-31, 90k tbr, 90k tbn, 90k tbc*
*    Metadata:*
*      variant_bitrate : 634047*
*    Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s*
*    Metadata:*
*      variant_bitrate : 634047*
*      encoder         : Lavc57.48.101 aac*
* Output #1, hls, to 'ffmpeg/index_1.m3u8':*
*    Stream #1:0: Unknown: none (libx264), SAR 1:1 DAR 0:0*
*    Metadata:*
*      variant_bitrate : 940569*
*      encoder         : Lavc57.48.101 libx264*
*    Side data:*
*      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1*
*    Stream #1:1: Unknown: none (aac)*
*    Metadata:*
*      variant_bitrate : 940569*
*      encoder         : Lavc57.48.101 aac*
* Output #2, hls, to 'ffmpeg/index_2.m3u8':*
*    Stream #2:0: Unknown: none (libx264), SAR 1:1 DAR 0:0*
*    Metadata:*
*      variant_bitrate : 1349264*
*      encoder         : Lavc57.48.101 libx264*
*    Side data:*
*      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1*
*    Stream #2:1: Unknown: none (aac)*
*    Metadata:*
*      variant_bitrate : 1349264*
*      encoder         : Lavc57.48.101 aac*
* Output #3, hls, to 'ffmpeg/index_3.m3u8':*
*    Stream #3:0: Unknown: none (libx264), SAR 1:1 DAR 0:0*
*    Metadata:*
*      variant_bitrate : 1655786*
*      encoder         : Lavc57.48.101 libx264*
*    Side data:*
*      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1*
*    Stream #3:1: Unknown: none (aac)*
*    Metadata:*
*      variant_bitrate : 1655786*
*      encoder         : Lavc57.48.101 aac*
* Output #4, hls, to 'ffmpeg/index_4.m3u8':*
*    Stream #4:0: Unknown: none (libx264), SAR 1:1 DAR 0:0*
*    Metadata:*
*      variant_bitrate : 2166656*
*      encoder         : Lavc57.48.101 libx264*
*    Side data:*
*      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1*
*    Stream #4:1: Unknown: none (aac)*
*    Metadata:*
*      variant_bitrate : 2166656*
*      encoder         : Lavc57.48.101 aac*
* Output #5, hls, to 'ffmpeg/index_5.m3u8':*
*    Stream #5:0: Unknown: none (libx264), SAR 1:1 DAR 0:0*
*    Metadata:*
*      variant_bitrate : 2677525*
*      encoder         : Lavc57.48.101 libx264*
*    Side data:*
*      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1*
*    Stream #5:1: Unknown: none (aac)*
*    Metadata:*
*      variant_bitrate : 2677525*
*      encoder         : Lavc57.48.101 aac*
* Stream mapping:*
*  Stream #0:0 -> #0:0 (copy)*
*  Stream #0:1 -> #0:1 (aac (native) -> aac (native))*
*  Stream #0:2 -> #1:0 (h264 (native) -> h264 (libx264))*
*  Stream #0:3 -> #1:1 (aac (native) -> aac (native))*
*  Stream #0:4 -> #2:0 (h264 (native) -> h264 (libx264))*
*  Stream #0:5 -> #2:1 (aac (native) -> aac (native))*
*  Stream #0:6 -> #3:0 (h264 (native) -> h264 (libx264))*
*  Stream #0:7 -> #3:1 (aac (native) -> aac (native))*
*  Stream #0:8 -> #4:0 (h264 (native) -> h264 (libx264))*
*  Stream #0:9 -> #4:1 (aac (native) -> aac (native))*
*  Stream #0:10 -> #5:0 (h264 (native) -> h264 (libx264))*
*  Stream #0:11 -> #5:1 (aac (native) -> aac (native))*
* Could not write header for output file #0 (incorrect codec parameters ?):
Invalid argument*
* [aac @ 0x46a0ac0] Qavg: -nan*
* [aac @ 0x491cba0] Qavg: -nan*
* [aac @ 0x42a9c20] Qavg: -nan*
* [aac @ 0x48f7ba0] Qavg: -nan*
* [aac @ 0x48fbfc0] Qavg: -nan*
* [aac @ 0x3f73100] Qavg: -nan*
* Exiting normally, received signal 2.*


There is a difference in the Stream mapping, however the command was the
same:
* Stream #0:0 -> #0:0 (copy)*
* Stream #0:1 -> #0:1 (aac (native) -> aac (native))*
* Stream #0:2 -> #1:0 (h264 (native) -> h264 (libx264))*

Why is it happening?

Cheers,
Zsolt


More information about the ffmpeg-user mailing list