FORUMS: list search recent posts

How do you concatenate two files, copying ALL streams, and not re-encoding

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Jimmy See
How do you concatenate two files, copying ALL streams, and not re-encoding
on Jun 21, 2015 at 5:55:55 am

I want to stick a title card, that I forgot to add to a sequence in an NLE prior to exporting it, to the beginning of what was exported - thus creating a new, single, continuous file of identical codec and container. In this way, I would hope to avoid having to wait for a re-encode of the entire 30 minute sequence by exporting only the title as an individual file with exactly the same settings and concatenating that file with the already exported file that is missing the title card. I realise that the process of figuring this out is way slower than just re-exporting but this is a circumstance I think I will likely find myself in in future.

I was able to do this successfully using the concat -demuxer method as described here https://trac.ffmpeg.org/wiki/Concatenate#samecodec but because the default option for the copy command is to select one video and one audio stream, my output file of course contains only one video and one audio stream. My input files have 1 video channel and 8 audio channels and I need the concatenated output file to be identical in this respect and also in the mapping of those channels which must be exactly the same order.

The documentation describes using the map command of stream copy to specify any options beyond the default behaviour but unfortunately the documentation for the map command is a bit opaque for me. I also wonder if there's not something simpler than grappling with map command since my desired outcome is so simple given I only want to copy everything and have no desire to remap or re-encode any channels.

Anyone know what I need to do to make that happen?


Return to posts index

Lou Logan
Re: How do you concatenate two files, copying ALL streams, and not re-encoding
on Jun 22, 2015 at 6:21:28 pm

Please show the complete output of:

ffmpeg -i title -i main

Don't forget to format it with the code button.


Return to posts index

Jimmy See
Re: How do you concatenate two files, copying ALL streams, and not re-encoding
on Jun 23, 2015 at 5:54:46 am

Hi mate, thanks for helping out. Unfortunately the files are no longer on my testbed machine.

I cleared them because I stumbled on to the solution myself. Perhaps there's a more elegant way, but this works quite well.

I found the ability to select all streams via the map command in the map documentation that I'd managed to miss before because it's buried in an example of how to do something quite different to what I was attempting to do.

My solution looks like this:

ffmpeg -f concat -i mylist.txt -map 0 -c copy testoutput.mxf

where the mylist.txt document contains the files I wanted to concatenate with their absolute paths listed after file at the start of each line. This seems to do exactly what I want it to do.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]