通常这对于 ffmpeg 来说是一个简单的任务,但我有这个链接:
https://nana10-hdv-uk-sw.ctedgecdn.net/Nana10-Vod/_definst_/amlst:mediaroot/nana10/media/iiscdn/2018/04/kvarnitim230418_,500,700,1000,1400,1800,.mp4/playlist.m3u8?btoken=26b11ccee70374a261182857501b7fa673123f13f75735f97a2abfa6052dd060&str=1527695859&exp=1527697059
我正尝试使用以下简单的方法将其下载到我的电脑上:
ffmpeg -i input -c copy output.mp4
然而,尽管 VLC 播放器可以毫无问题地加载它,但它并没有成功并且卡住了。
MacBook-Pro:downloads$ ffmpeg -i https://nana10-hdv-uk-sw.ctedgecdn.net/Nana10-Vod/_definst_/amlst:mediaroot/nana10/media/iiscdn/2018/04/kvarnitim230418_,500,700,1000,1400,1800,.mp4/playlist.m3u8?btoken=26b11ccee70374a261182857501b7fa673123f13f75735f97a2abfa6052dd060&str=1527695859&exp=1527697059 -c copy b.mp4
[3] 14301
[4] 14302
-bash: -c: command not found
[4] Done str=1527695859
MacBook-Pro:downloads$ ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags=-I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/ --host-ldflags= --enable-gpl --enable-chromaprint --enable-ffplay --enable-frei0r --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopus --enable-librsvg --enable-librtmp --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-libzmq --enable-opencl --enable-videotoolbox --enable-openssl --enable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/2.3.0/include/openjpeg-2.3 --enable-nonfree
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
我认为这与链接的读取方式有关,因为它有“。”,这使得 ffmpeg 可能将其读取为文件并认为该行的其余部分是一个命令。
答案1
好的,我找到了我的问题的解决方案。我只需要“在链接之前和之后,ffmpeg 就知道链接在哪里结束。
ffmpeg -i "https://nana10-hdv-uk-sw.ctedgecdn.net/Nana10-Vod/_definst_/amlst:mediaroot/nana10/media/iiscdn/2018/04/kvarnitim230418_,500,700,1000,1400,1800,.mp4/playlist.m3u8?btoken=26b11ccee70374a261182857501b7fa673123f13f75735f97a2abfa6052dd060&str=1527695859&exp=1527697059" -c copy b.mp4