Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any way to append one video file to another ?

I've got a very large file (2GB) to which I'm trying to append some tiny files (~4MB). They all are in the same format.

It's easy to concat several files with ffmpeg for instance, but the whole file is written everytime (i.e. 2GB+4MB are written to the disk everytime when only 4MB are added to the inital file). I'm trying to avoid all this extra disk IO by using a command that would only append the 4MB files. Any idea how to do that?

share|improve this question

migrated from stackoverflow.com Apr 29 '13 at 8:39

This question came from our site for professional and enthusiast programmers.

    
May I ask why you're in this situation? Why would you need to always append small files? –  slhck Apr 28 '13 at 21:22
    
I'm doing HLS streaming the other way : I'm trying to rebuild the video file from all the video parts. At the beginning it's okay as the file isn't that large, but after joining 400+ parts the final video file is getting very large and the disk can't keep up compared to how fast the new parts show up. –  Maxime Apr 28 '13 at 21:34
    
You MIGHT be able to just cat the small file onto the big one (according to ffmpeg-users.933282.n4.nabble.com/… this can work for some file formats). To do this you could cat FILE2.mpg >> FILE1.mpg (which will append the contents of FILE2.mpg onto the end of FILE1.mpg). Please don't try this on live files until you are happy it works. –  davidgo Apr 29 '13 at 8:47
    
You're right, reencoding the files in a format that supports the cat method is probably the best way to go. I'm giving it a try and I'll tell you if it's working. –  Maxime Apr 29 '13 at 9:35
    
...if the goal is to avoid extra files (or extra I/O), it seems to me that re-encoding or remuxing everything would be counter-productive. Just use one of ffmpeg's many concatenation options. –  evilsoup Apr 29 '13 at 10:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.