我想使用ffmpeg命令从m3u8链接下载mp4。
ffmpeg -i https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/master.m3u8 -c copy -bsf:a aac_adtstoasc output1.mp4
但是加载第一段时发生错误
https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/720/seg-1-v1-a1.ts?v=664e3521
https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/master.m3u8: Invalid data found when processing input
有人帮助我解决了我的问题。谢谢!
完整命令
ffmpeg -i https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/master.m3u8 -c copy -bsf:a aac_adtstoasc output2.mp4ffmpeg version 4.1.1-0york1~16.04 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609
configuration: --prefix=/usr --extra-version='0york1~16.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-nonfree --enable-libfdk-aac --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[hls,applehttp @ 0x56551c942500] Opening 'https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/720.m3u8?v=664e3521' for reading
[https @ 0x56551cd51280] Opening 'https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/480.m3u8?v=3f40a361' for reading
[https @ 0x56551cd51280] Opening 'https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/360.m3u8?v=aefcb682' for reading
[https @ 0x56551cd51280] Opening 'https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/240.m3u8?v=bda86a2a' for reading
[https @ 0x56551cd51280] Opening 'https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/144.m3u8?v=431e8038' for reading
[hls,applehttp @ 0x56551c942500] Opening 'https://kms.sohatv.vn/drm/55ceb3f8-4675-454a-bfc8-96cb04bbae8f.key' for reading
[hls,applehttp @ 0x56551c942500] Opening 'crypto+https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/720/seg-1-v1-a1.ts?v=664e3521' for reading
[hls,applehttp @ 0x56551c942500] Error when loading first segment 'https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/720/seg-1-v1-a1.ts?v=664e3521'
https://hls.mediacdn.vn/vtv/2019/4/7/0704sao-mai-1554652229269816114782-af6d9.mp4/master.m3u8: Invalid data found when processing input
答案 0 :(得分:3)
流已加密,并且密钥以混淆格式编码。 ffmepg将无法解密流。