俩种方法都试了
第一种: ffmpeg -i "concat:1.flv|2.flv|3.flv|4.flv" -c copy all.flv
结果输出的视频里面只包含 1.flv 的内容
第二种: ffmpeg -y -f concat -i mylist.txt -c copy all.flv
直接报“ mylist.txt: Invalid argument ” 错误
cat mylist.txt
file './1.flv'
file './2.flv'
file './3.flv'
file './4.flv'ffmpeg -f concat -i mylist.txt -c:v copy all.flv
ffmpeg version 2.8 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 7.0.0 (clang-700.0.72)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[flv @ 0x7fd484000600] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'mylist.txt':
Duration: N/A, bitrate: 1564 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 1280x720, 1433 kb/s, 30 fps, 30 tbr, 1k tbn, 2k tbc
Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp, 131 kb/s
File 'all.flv' already exists. Overwrite ? [y/N] y
[flv @ 0x7fd483821200] Codec for stream 0 does not use global headers but container format requires global headers
Output #0, flv, to 'all.flv':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 1280x720, q=2-31, 1433 kb/s, 30 fps, 30 tbr, 1k tbn, 1k tbc
Stream #0:1: Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 44100 Hz, stereo, fltp
Metadata:
encoder : Lavc56.60.100 libmp3lame
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[libmp3lame @ 0x7fd483822a00] Queue input is backward in time
[flv @ 0x7fd484000600] Stream discovered after head already parsed
[concat @ 0x7fd482008000] New subtitle stream 0:2 at pos:3248009 and DTS:16.55s
mylist.txt: Invalid argument
frame= 195 fps=0.0 q=-1.0 Lsize= 1401kB time=00:00:16.58 bitrate= 692.5kbits/s
video:1128kB audio:259kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.016911%
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.