问题
I have two flac audio files, I need to cut them with different timecodes and then concatenated them using one single command line with ffmpeg. Is there a way to do it? I did something like that but it's not working very well, the timestamps of the outputs file are all messed up (instead of having an output flac beginning from 00:00 I have a file beginning from 59:90!!) Also this command line is insanely slow and it works only on unix system...hope someone could help me
mkfifo temp1 temp2
ffmpeg -y -i PMM_20170116-1100_1.flac -ss 3590 -t 10 -c copy -acodec copy -f flac temp1 2> /dev/null & ffmpeg -y -i PMM_20170116-1200_1.flac -ss 0 -t 3590 -c copy -acodec copy -f flac temp2 2> /dev/null & ffmpeg -f flac -i "concat:temp1|temp2" -ac 2 -ar 48000 cutmergetest.flac
回答1:
The fast method:
Create a text file.
file file1.flac
inpoint 3590
outpoint 3600
file file2.flac
inpoint 0
outpoint 3590
Run
ffmpeg -f concat -i list.txt -c copy merged.flac
The slow method:
Run
ffmpeg -ss 3590 -t 10 -i file1.flac -ss 0 -t 3590 -i file2.flac -filter_complex "[0][1]concat=n=2:v=0:a=1" -ac 2 -ar 48000 cutmergetest.flac
来源:https://stackoverflow.com/questions/42250223/ffmpeg-cut-and-concat-single-command-line