ffmpeg 檔案切片合併

2021-09-23 22:04:31 字數 877 閱讀 8227

mylist.txt:

file 『/path/to/file1』

file 『/path/to/file2』

file 『/path/to/file3』

ffmpeg -f concat -i mylist.txt -c copy output //這個是運用concat demux,和前面的命令有些不同,這個會把demux檔案然後re-encode切片檔案,所以只要ffmpeg支援的格式,這個命令都管用。

開始覺得這倆個命令功能是一樣的。實驗了第乙個命令 flv不管用,只輸出了第一片的flv。查了下官方文件找到這一段:

the flv container format doesn』t support file-level concatenation; only a

few container file types do. so the concat protocol won』t work on them.

the concat demuxer, as its name suggests, demuxes the input streams from

their container and then concatenates them, so it doesn』t care about what

the input container is (and if the codecs are all the same w/ similar

characteristics, you can actually concatenate files of different container

formats).

參考:how to concatenate (join, merge) media files

ffmpeg wiki

ffmpeg中合併音訊檔案

ffmpeg f concat safe 0 i printf file pwd my02.m4a nfile pwd my05.m4a n c copy output.m4a這裡的 i引數,使用的是shell的管道方式輸入。即這裡的 printf file pwd my02.m4a nfile p...

使用ffmpeg切片出hls

測試的時候經常要用到ffmpeg切hls的流 ffmpeg re i g media baifa.mp4 codec copy f hls hls list size 4 hls wrap 20 hls time 15 g media demo index.m3u8 主要是 hls wrap引數 這...

ffmpeg 合併aac格式音訊檔案

1 連線到一起 ffmpeg i concat d learn audio 1.aac d learn audio 2.aac acodec copy d learn audio out.aac 推薦用法 python執行 l1 d learn audio 1.aac d learn audio 2...