Closed Darkness4 closed 3 months ago
Might be fixed with aac transcoding. This is working:
ffmpeg -y -f concat -i list.txt -c:v copy -c:a aac output.mp4
Doc: https://ffmpeg.org/doxygen/6.1/transcode_aac_8c-example.html
Or, it's something related with the in_codecpar
.
This is also working:
ffmpeg -y -f concat -i list.txt -c:v copy -c:a copy output.aac
Looks like the issue comes from the container. The matroska/mpeg forces the audio stream adts
(Audio Data Transport Stream, equivalent to mpegts) to be converted into asc
:
aac_adtstoasc Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
Recommended fix is to use intermediates/fifo:
mkfifo temp1.ts temp2.ts
echo temp1.ts > list.txt
echo temp2.ts >> list.txt
ffmpeg -y -i input.mp4 -c copy temp1.ts 2> /dev/null &
ffmpeg -y -i input.ts -c copy temp2.ts 2> /dev/null &
ffmpeg -f concat -i list.txt -c copy output.mp4
Closed with commit abc8639
Error happens on stream 1 (audio)
Logs:
Test cases:
Probe:
Same behavior with ffmpeg