本帖最后由 魔鬼筋肉人 于 2022-3-6 16:12 编辑
解决了老哥们 -hls_key_info_file encrypt2.keyinfo这个文件里面需要用这种格式 http://www.xxx.com/oauth/encrypt.key encrypt.key e761e8545e49d2312357550245da3 然后用这个运行:ffmpeg -y -i demo.mp4 -hls_time 4 -hls_key_info_file encrypt2.keyinfo -hls_playlist_type vod -hls_segment_filename "demo_%d.ts" index.m3u8 —————————————-
- ffmpeg -y -i test.mp4 -hls_time 4 -hls_key_info_file encrypt.keyinfo -hls_playlist_type vod -hls_segment_filename "test_%d.ts" index.m3u8
复制代码
- ffmpeg version N-93664-g1ae5a64457 Copyright (c) 2000-2019 the FFmpeg developers
- built with gcc 8.3.1 (GCC) 20190414
- configuration: –enable-gpl –enable-version3 –enable-sdl2 –enable-fontconfig –enable-gnutls –enable-iconv –enable-libass –enable-libdav1d –enable-libbluray –enable-libfreetype –enable-libmp3lame –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libopenjpeg –enable-libopus –enable-libshine –enable-libsnappy –enable-libsoxr –enable-libtheora –enable-libtwolame –enable-libvpx –enable-libwavpack –enable-libwebp –enable-libx264 –enable-libx265 –enable-libxml2 –enable-libzimg –enable-lzma –enable-zlib –enable-gmp –enable-libvidstab –enable-libvorbis –enable-libvo-amrwbenc –enable-libmysofa –enable-libspeex –enable-libxvid –enable-libaom –enable-libmfx –enable-amf –enable-ffnvcodec –enable-cuvid –enable-d3d11va –enable-nvenc –enable-nvdec –enable-dxva2 –enable-avisynth –enable-libopenmpt
- libavutil 56. 26.100 / 56. 26.100
- libavcodec 58. 52.100 / 58. 52.100
- libavformat 58. 27.103 / 58. 27.103
- libavdevice 58. 7.100 / 58. 7.100
- libavfilter 7. 49.100 / 7. 49.100
- libswscale 5. 4.100 / 5. 4.100
- libswresample 3. 4.100 / 3. 4.100
- libpostproc 55. 4.100 / 55. 4.100
- Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘test.mp4’:
- Metadata:
- major_brand : isom
- minor_version : 512
- compatible_brands: mp41
- creation_time : 2022-03-06T06:26:45.000000Z
- encoder : Bandicam 4.3.3.1498 / GDI / Intel Quick Sync Video
- encoder-eng : Bandicam 4.3.3.1498 / GDI / Intel Quick Sync Video
- Duration: 00:00:49.25, start: 0.000000, bitrate: 1608 kb/s
- Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 2856×1552 [SAR 1:1 DAR 357:194], 1406 kb/s, 25.30 fps, 29.97 tbr, 29970 tbn, 59.94 tbc (default)
- Metadata:
- creation_time : 2022-03-06T06:26:45.000000Z
- handler_name : VideoHandler
- Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 195 kb/s (default)
- Metadata:
- creation_time : 2022-03-06T06:26:45.000000Z
- handler_name : SoundHandler
- 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 @ 000001e55cee2580] using SAR=1/1
- [libx264 @ 000001e55cee2580] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
- [libx264 @ 000001e55cee2580] profile Progressive High, level 5.0, 4:2:0, 8-bit
- [libx264 @ 000001e55cee2580] 264 – core 157 r2970 5493be8 – H.264/MPEG-4 AVC codec – Copyleft 2003-2019 – 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=12 lookahead_threads=2 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=25 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 @ 000001e55cee1f40] Opening ‘encrypt.keyinfo’ for reading
- [hls muxer @ 000001e55d5900c0] error opening key info file encrypt.keyinfo
- Could not write header for output file #0 (incorrect codec parameters ?): No such file or directory
- Error initializing output stream 0:0 —
- [aac @ 000001e55cf2db00] Qavg: 4106.622
- [aac @ 000001e55cf2db00] 2 frames left in the queue on closing
- Conversion failed!
复制代码
|