Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
As far as I know the syntax in your first example is correct, as I've had to do this once before in the past. However, I'm in the same predicament as you because now its doing the same thing to me. I've resorted to avidemux as it appends files flawlessly, depending on the codec and container.
Sorry that really doesn't answer your question , but I'm really curious about the answer as well.
I know what you mean. Ffmpeg is always changing and it sometimes break thigs that worked before.
@ Satyaveer Arya
The code you gave me works surprisingly with mpg files. Don't know why it wouldn't work with mp4 files
I think I stick with mencoder when merging files and use ffmpeg for other tasks. These two programs are powerful yet they seem to have some limitations when doing certain tasks.
Thanks to both of you for the replies.
Last edited by GrepAwkSed; 04-02-2012 at 11:41 PM.
I found something interesting at Stack Overflow (link) after doing a quick Google search. Maybe give it a try and see what happens, as I have no videos to merge at the moment. Pay careful attention to the "newaudio" and "newvideo" portion.
Quick disclaimer: The link is about a year old, so no guarantees it's current.
Quote:
You can put many streams of the same type in the output:
In addition to the first video and audio streams, the resulting
output file test12.avi will contain the second video and the second
audio stream found in the input streams list.
The "-newvideo", "-newaudio" and "-newsubtitle" options
have to be specified immediately after the name of the output file
to which you want to add them.
I did use mencoder to merge the mp4 files and it did the job quite well.
To test the code you gave me I converted two mp4 files to mpg files and then use ffmpeg to merge the mpgs files together and it work.
The only bad thing is I have to convert the mp4 files to mpg files before using the ffmpeg command to merge them.
With mencoder I don't have to do that. They are both great commands and I use them both exclusively when working with media files, but each have their ways of doing things that don't work the same way.
Last edited by GrepAwkSed; 04-03-2012 at 12:04 AM.
Well, I tried to edit my last post rather than add a new one, but LQ is being obstinate right now, so here it goes.
Again, I know this only provides a workaround rather than a solution, but have you tried using MP4Box?
Should be available in the repos, at least it's in the Debian repos. It's written specifically for handling mp4 files in a similar fashion to what you may be familiar with using mencoder or ffmpeg. The syntax gets a little clunky, but it works.
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420
Rep:
GrepAwkSed,
MP4Box is also good to merge two mp4 files directly but for that first you have to install GPAC. You can download the GPAC from here: http://gpac.wp.mines-telecom.fr/downloads/
MP4Box is also good to merge two mp4 files directly but for that first you have to install GPAC. You can download the GPAC from here: http://gpac.wp.mines-telecom.fr/downloads/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.