Skip to main content

Joining Mp4 Files

The following parts are independent.

PROCEDURE 1

Try the simple one first. Just copy the video and the audio stream.

mencoder file1.mp4 file2.mp4 -ovc copy -oac copy -of lavf format=mp4 -o output.mp4

Sometimes this might not work. Many times the audio copy would fail with the errors like.


Audio format 0x4134504d is incompatible with '-oac copy', please try '-oac pcm' instead or use '-fafmttag' to override it.


In these cases it is better to re-encode the audio with lame.


mencoder file1.mp4 file2.mp4 -ovc copy -oac mp3lame -of lavf format=mp4 -o output.mp4


If we want free format encoding we could also use FAAC encoder (Freeware Advanced Audio Coder.). In this example the video codec used in also a free format to encode to H.264 HD format.

mencoder video1.mp4 video2.mp4 -o video3.mp4 -of lavf -lavfopts format=mp4 -vf harddup -oac lavc -ovc lavc -lavcopts acodec=libfaac:vcodec=libx264

PROCEDURE 2


MP4Box -add file1.mp4 -add file2.mp4 output.mp4



PROCEDURE 3


If your mp4 files are in a standard codec you might be able to get the free avidemux to join them without reencoding. To join them you open first file, then append every other file you want to join to it.
If the files are in the mkv codec, then you might need "total video converter" I had to use this program to convert the files to xvid then use avidemux to join them, but it kept the audio in sync and the quality loss was minimal.

avidemux has excellent editing and cropping tools for working on avi's.

http://fixounet.free.fr/avidemux/screenshots.html


PROCEDURE 4

To merge subtitles into an MP4 video file, you need to download two very useful tools: MP4Box and its GUI interface called Yamb.http://beans.seartipy.com/2008/01/11/step-3b-merginghardcoding-subtitles-with-mp4-files-using-yambmp4box/
I am making this post in response to one of the comments left on my previous post explaining how to hard-code (or merge) the subtitles into an AVI(DivX/XviD) video file. I was asked what tools can be used to merge subtitles with MP4 video files and below is the complete procedure to do the merging using MP4Box and Yamb.

To merge subtitles into an MP4 video file, you need to download two very useful tools: MP4Box and its GUI interface called Yamb.

Download MP4Box

Download Yamb

Both the tools can be extracted to any location of your preference. I have extracted the contents of Yamb-2.0.0.8.zip to H:\PortableApps\Yamb and have extracted and copied MP4Box.exe too to the same folder. This is how it looks on my computer:

Next thing you need to do is to tell Yamb where MP4Box is located. To do that, run Yamb from its folder, click on the Settings icon, double-click on the entry that starts with “Advanced settings for Yamb…”.

Enter the path where you have extracted the MP4Box executable in the Location: text box. In my example, it looks like this:

Click Next.

Now you are ready to try merging subtitles into an MP4 file. Select the Creation icon this time and double-click on the first entry that starts with “Click to create and MP4…”.

Click the Add button first time to add the MP4 file and then click the Add button a second time to select the subtitle file. The window should like something like this:

Remember to change the output file name(like I did) in the Output text box located at the bottom of the window if you don’t want to overwrite your input file with the merged output file. Click Next.
The following screenshot shows Yamb processing your request. It took less than 2 minutes on my computer to finish the job of merging subtitles into a 40 minute MP4 video file.

Click Finish when done to quit Yamb or click Back if you want to do more merging operations. The produced MP4 output file with merged subtitles:


End Notes

You can use the MP4Box directly from the command line if you wish: the command syntax is really very simple, and you can actually do a lot more stuff using this tool. So do explore more about it over the Internet.

PROCEDURE 5

Install gpac packages to install MP4Box tools.
sudo apt-get install gpac
Once you’ve done it, you can use the Mp4Box command to concatenate the files together:

MP4Box -cat file_01.m4v -cat file_02.m4v -cat file_03.m4v -new final.m4v

This will create a merged m4v file ready do be used.
http://ukumars.wordpress.com/2009/12/31/how-to-joinmerge-mp4-files-in-ubuntu/


PROCEDURE 6

ls -x

This will list files sequentially in a single block (which might spill over several lines depending on the size of the terminal window).

 file1.mp4 file2.mp4  file3.mp4 file4.mp4  file5.mp4 file6.mp4  file7.mp4 file8.mp4  ....

Just select and middle click paste them after the cat command.

cat file1.mp4 file2.mp4 ... > joined.mp4

The joined file would play fine in mplayer but the timeline would be all wrong and the subtitles would get screwed up. Fix this by running fix index with mencoder or vlc.


mencoder -idx joined.mp4 outpufile.mp4



See also http://kheyali.blogspot.com/2012/04/split-and-merge-files.html

Comments

keithservick said…
I use iDealshare VideoGo to join MP4 files, I like its join video without re-encoding feature.
Step by step guide at http://www.idealshare.net/mp4-joiner-merge-mp4-files-on-mac-windows.html

It also helps to:
Join other video formats like join AVI, VOB, MOV, RMVB, FLV, MKV, MPG, 3GP, MPEG, M2TS, MTS, WMV, ASF, etc as well as MP4.
Join audio files like join MP3, WMA, FLAC, AAC, OGG, WAV, M4A, AIFF, MP2 and etc

Popular posts from this blog

Fastest way to send multiple drafts from gmail

People claim that the fastest way to send multiple email drafts is to use Gmail IMAP with email client like Outlook or Evolution or Thunderbird. But I have found this is not true. Because Thunderbird and Evolution etc. email clients treats the drafts as emails still to be edited. So it is not just simple select all and hit send. Each email draft has to be opened and sent separately. That is a lot of clicks and mouse movements, wasting precious time and energy. I have a better solution which involves minimum keystrokes and mouse usage. Efficiency booster technique for sending emails. If someone is feeling adventurous and want to try it from the Gmail interface itself, here's how to do it in the fastest possible manner. It involves using the mouse once. Select the first draft. Gmail would open a new email box and put the cursor inside the box to write. Press TAB once to go the Send button. Press ENTER to send. Now Gmail sends it and the box is gone but the highlight goes to the last

LYRICS OF CHANDRABINDOO

___________________________________________________________________ SWEET HEART FROM AAR JAANI NAA(T-SERIES) -- SWEETHEART -- Pratham college-er din ta Aajo thik e mone poRey scene ta Dada didi haath dhorey siNRi tei bose poRey Aamar chokh ta ghorey bon bon bon bon Sweetheart, I am seating alone Sweetheart, for me there is none DhoNk gile chole gelo pratham maas Meye dekhlei feli deergho-shwash DhoNk gile chole gelo pratham maas Meye dekhlei othe nabhishwash Meyera bheeshan smart poRey chhoto mini-skirt Aamar e je sheet korey kon kon kon kon Sweetheart, I am seating alone Sweetheart, for me there is none Taarporey kete gelo maas chaar Fuse holo je kato future Bandhura purse khule eke oke taake tole Aamar pran ta korey chon mon chon mon Sweetheart, I am seating alone Sweetheart, for me there is none Ekdin lawn theke beriye Ek tanayaar dike taakiye Hawt korey ki je holo magaj ta ghurey gelo Taar kaaner saamne kori ghyan ghyan ghyan ghyan Sweetheart, I am seating alone Sweethea

Changing the font size of section headings in LaTex

You have several ways to do so: 1.- A direct redefinition of \section: \makeatletter \renewcommand\section{\@startsection{section}{1}{\z@}%                                   {-3.5ex \@plus -1ex \@minus -.2ex}%                                   {2.3ex \@plus.2ex}%                                   {\normalfont\large\bfseries}} \makeatother 2.- By means of the titlesec package: \usepackage{titlesec} \titleformat{\section}{\large\bfseries}{\thesection}{1em}{} 3.- By means of the sectsty package: \usepackage{sectsty} \sectionfont{\large} source : http://www.latex-community.org/forum/viewtopic.php?f=4&t=3245   Now, I would explain the titlesec package a bit more (because it seems easier to me and with more options) : To change the section fonts with this package put the following lines in the preamble - \usepackage{titlesec} \titleformat{\ section }{\ large \ bfseries }{\thesection}{1em}{} Options available are- a> Font size - \normals