Joining MP4 files

gjesion wrote on 11/25/2012, 12:17 PM
I have a JVC GY HM 750 and I am shooting in 720p MP4 35 Mbps. JVC breaks up the video into ~ 4GB clips (FAT 32 I guess). This is making multi-camera editing somewhat difficult since I have to color correct many clips in the media bin for any shoot more than ~ 12 min long. I would like to join them w/o re-encoding and have had little luck finding anything that works. Ffmpeg won't work directly. I have tried some programs suggested when searching on the web and have yet found anything suitable (freevideojoiner, ffmpeg, mp4box, etc.).

I can use VV12 to do it, but it always re-encodes. I would like to avoid this. Any suggestions??

Regards,
Jerry

Comments

Maverick wrote on 11/25/2012, 12:41 PM
Have a try with Boilsoft Video Joiner http://www.boilsoft.com
musicvid10 wrote on 11/25/2012, 2:46 PM
VideoRedo TVSuite.
PeterDuke wrote on 11/25/2012, 4:58 PM
If a single shoot is broken up into 4GB chunks or less by your camera because of the file system limitations, you can join them back together again using the concatenation feature of the Windows Copy command from a command window:

COPY /B file1+file2+file3 fullfile

This works for files from AVCHD cameras and will probably work for your MP4 files as well. Don't forget the /B switch for binary (as distinct from ASCII) files.
rs170a wrote on 11/25/2012, 5:55 PM
Use Device Explorer (built into Vegas) or do a search for XDCAM EX Clip Browser which will seamlessly join and re-wrap them in MXF format.
Make sure you get version 2.6 as it's the newest one.

Mike (an HM-750 owner)
Kevin R wrote on 11/26/2012, 1:23 AM
NO! NO! NO!

AVCHD/MPEG files cannot be simply concatenated like this. The resulting file may play, but will almost always have frame drop-outs at the concatenation point.

You must use proper concatenation software which maintains the integrity of the MPEG container! I use TSSplitter (http://www.videohelp.com/tools/TSSplitter), though there are probably better ones TSSplitter is FREE and it works (after you figure it out).
gjesion wrote on 11/26/2012, 11:05 AM
Thanks Mike! The clip browser was just the ticket. I prefer to use it since I like to just pop the SD card out of the camera, rather than connect it to the computer.

Regards,
Jerry
PeterDuke wrote on 11/26/2012, 5:20 PM
"NO! NO! NO!

>> COPY /B file1+file2+file3 fullfile

This does NOT work as expected.

AVCHD/MPEG files cannot be simply concatenated like this"



In my post I said that AVCHD single shoots that had been cut into 4GB chunks by the camera to comply with the file system limitations can be joined this way. You can also do it with the VOB files from the same set with DVDs. I agree that you shouldn't join normal MPEG files this way.

I haven't tried this with MP4 files from a camera, so I can't be sure that it would work, but it is worth trying, since the same principles probably apply. Once again, only the chunks from a single shoot should be concatenated this way, not files from separate shoots.
musicvid10 wrote on 11/26/2012, 8:58 PM
Only if the camera cuts at I-frames.
That's a big "if."

Breaking the TS stream at any other point means it will need to be reindexed, which concatenation cannot do. Just think about the mayhem that would result if it cut on a b-frame.

Bottom line, Use an import utility, as the OP has discovered.
PeterDuke wrote on 11/26/2012, 10:02 PM
The whole point of the concatenation (with AVCHD and VOB, at least) is that the full file is arbitrarily cut. The starts of the second and subsequent chunks require info contained at the ends of the previous chunks. When concatenated, you get the complete file as it would have been if not cut.

If you merely drag the chunks to the timeline in Vegas, each chunk will be read in isolation, and frames in the vicinity of the cut will be corrupted (unless the cuts just happened to be immediately before I-frames).
musicvid10 wrote on 11/26/2012, 10:07 PM
That's not our experience, Peter.
Although a joined file may play as a transport stream, the full inflation needed for nonlinear editing is dicey to say the best.

That's why we have Vegas' Device Explorer and Clip Browser, etc. They do far more than concatenate: they reindex the GOP and fix stream errors as well, both necessary for editing transport streams.

Since you said you have not actually tried this with AVCHD, we eagerly await the results of your trials.

Since MPEG-2 TS has a GOP of 15 frames, and AVCHD is easily 300-600 frames with I,P, and B frames, drawing a conclusion based on comparing the two is a bit of a red herring, I'm afraid.

YMMV
PeterDuke wrote on 11/26/2012, 10:19 PM
If cameras and DVDs didn't have old-fashioned file systems, they would do what Blu-ray discs do, namely, one file per video. Consider the complete video as a piece of paper tape that has to be laid flat into a box say only one foot long. Take a ruler and a pair of scissors and cut the tape into 12 inch or shorter chunks, without consideration of what is printed on the tape. Then, when you want to use the tape, you must take the pieces and stick them back together again (concatenate them). No reindexing is necessary.

It has always worked for me for AVCHD and VOB. I don't see why it wouldn't work for others. My only doubt is for MP4 files produced by a camera, since I have never seen such files. But I would expect them to have been produced in the same way (with arbitrary cuts) for the same reason that AVCHD cameras and DVDs cut complete videos into chunks.
rs170a wrote on 11/27/2012, 7:42 AM
Glad it worked for you Jerry.
FYI, I have used Device Explorer in conjunction with a USB card reader to accomplish the same thing but my preference is still the Clip Browser.

Mike
Chienworks wrote on 11/27/2012, 8:51 AM
The file concatenation method works perfectly fine with files from my JVC AVCHD camcorder. There is no dropout at all, with continuous complete video frames and audio. Apparently my camcorder "gets it right" when it does the cuts.

I also get better results using file concatenation on VOB files than any other method.
musicvid10 wrote on 11/27/2012, 9:44 AM
"Apparently my camcorder "gets it right" when it does the cuts."
;?)
PeterDuke wrote on 11/27/2012, 5:18 PM
There is no rocket science in the cuts! Just do a snip on the virtual file anywhere, regardless of content. Don't do any tidying up. When you concatenate, you "unsnip", as though it had never happened. It's such a simple concept, I can't fathom why people try to make this complex.
Kevin R wrote on 11/27/2012, 7:42 PM
Peter,

While it may work some of the time with files from some cameras, it does not work all the time and it is certainly not proper. I have tried dragging and dropping clips onto the timeline and discovered dropped frames at the edit point. You need to join the files with proper software or you risk losing frames.
musicvid10 wrote on 11/27/2012, 8:20 PM
Peter, do you by some chance think the P and B frames consist of image data?
Are you aware of the characteristics of transport streams?

Rather than continue ruminating, I challenged you to run your own trials. I, and I'm sure others are eagerly awaiting your results.
gjesion wrote on 11/27/2012, 8:33 PM
All,
The first thing I did to try to join the MP4 files was the DOS copy/b command. It created a file of about the right length, but it would not play in VLC. I pulled it into VV12 and the length of the video on the timeline was that of the first file. And the audio was goofed up. This method may work with some video formats, but apparently not MP4.

Regards,
Jerry
PeterDuke wrote on 11/28/2012, 12:11 AM
"I have tried dragging and dropping clips onto the timeline and discovered dropped frames at the edit point"

Precisely! That is why you must concatenate first. Please read my posts above again.
PeterDuke wrote on 11/28/2012, 12:17 AM
musicvid

I have concatenated AVCHD files (for a single scene) from my camera and VOB files from a set many times and it has always worked.

The content of the original file is irrelevant (text, video, audio, etc.) because after splitting into chunks and then concatenating them, the resulting file is identical to what the original would have been if it had not been cut.
PeterDuke wrote on 11/28/2012, 12:19 AM
gieson

Sorry, but it looks like my guess must have been wrong for your MP4 files. You will have to join them with something like VideoReDo.
Kevin R wrote on 11/28/2012, 2:00 AM
AVCHD *is* MPEG-4. AVCHD is a video codec, not a file format.

MP4 is a container file format, not a video codec. MP4 files can contain AVCHD.

AVCHD might be encapsulated as .mp4, .ts, .m2ts, .ps, or others.

It is not possible to claim AVCHD files can be concatenated because there is no such thing as an AVCHD file.

Success in concatenating container files from one device does not imply concatenation will succeed with other instances of the same container type from other devices.

How one device splits files does not assure every device behaves similarly. Moreover, limited success does not prove simple concatenation truly results in a valid file having no structural defects. Such can only be theorized. Yet, it could be equally hypothesized that the particular playback software is dealing with errors that not all playback software will handle.
PeterDuke wrote on 11/28/2012, 6:51 AM
Who said that it wasn't? Not all MPEG4 is AVCHD, however. MPEG 4 has many many parts. AVCHD is not MP4 and MP4 is not AVCHD.

But I have not been talking about just any AVCHD file either. I have only been talking about the set of AVCHD files that make up a single scene or shoot.
PeterDuke wrote on 11/28/2012, 7:46 AM
Kevin, you make it difficult to respond when you edit a small post into a big post. Editing should be reserved for minor touchups.

AVCHD is very specific because it is a creation and trade mark of Sony and Panasonic for their video cameras. The video codec is a subset of the MPEG4 Part 10. The audio is AC3 (stereo or 5.1) or linear PCM. AVCHD may also contain a subtitle stream. The container is the MPEG2 Pt 1 transport stream.

By AVCHD files, I mean the files as recorded by an AVCHD camera.

I have said before and I will repeat, that I am only talking about concatenating the set of AVCHD files which form a single scene shot with an AVCHD camera.