分兩種狀況linux
某些視頻同時支持m3u8和mp4視頻文件,將m3u8改爲mp4後直接:web
wget -c http://www.xxx.com/xxxx.mp4
能夠用ffmpeg下載合併成mp4文件shell
ffmpeg -i "m3u8列表url" -c copy "存儲視頻名字.mp4"
其中-i
表示輸入,-c copy
表示和源視頻採用相同的音視頻編碼ubuntu
樣例:服務器
➜ ~ ffmpeg -i "http://vod.mudu.tv/media-join-slice/9592hz24y6zqcqm54qncz3osv.m3u8" -c copy "深度學習服務器配置.mp4" ffmpeg version 3.3.4-2 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 7 (Ubuntu 7.2.0-8ubuntu2) configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libavresample 3. 5. 0 / 3. 5. 0 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 libpostproc 54. 5.100 / 54. 5.100 [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/162.ts' for reading Input #0, hls,applehttp, from 'http://vod.mudu.tv/media-join-slice/9592hz24y6zqcqm54qncz3osv.m3u8': Duration: 01:13:36.83, start: 1972.540522, bitrate: 0 kb/s Program 0 Metadata: variant_bitrate : 0 Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 852x480, 30 tbr, 90k tbn, 60 tbc Metadata: variant_bitrate : 0 Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp Metadata: variant_bitrate : 0 Output #0, mp4, to '深度學習服務器配置.mp4': Metadata: encoder : Lavf57.71.100 Stream #0:0: Video: h264 (High) ([33][0][0][0] / 0x0021), yuv420p, 852x480, q=2-31, 30 tbr, 90k tbn, 90k tbc Metadata: variant_bitrate : 0 Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp Metadata: variant_bitrate : 0 Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/163.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/164.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/165.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/166.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/167.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/168.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/169.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/170.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/171.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/172.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/173.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/174.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/175.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/176.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/177.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/178.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/179.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/180.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/181.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/182.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/183.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/184.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/185.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/186.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/187.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/188.ts' for reading [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/189.ts' for reading ...... [hls,applehttp @ 0x5594afe3b880] Opening 'http://vod.mudu.tv/watch/2018-07-25/g3ov35/429.ts' for reading frame=132505 fps=669 q=-1.0 Lsize= 1434228kB time=01:13:36.82 bitrate=2660.1kbits/s speed=22.3x video:1348706kB audio:80736kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.334827%