16

I create a lot of these small clips on my digital camera. These are in .mpg format and before I share them with others, I would love to just join, clip a few seconds here and there.

I use Google Picassa to create new start and end points, but I dont know a good way to join mpgs yet.

Whats the best free software i can use for this?

Kapsh
  • 417

7 Answers7

27

mpg files are the easiest to join. You can actually copy them together. In Windows you use

copy/b file1.mpg+file2.mpg+file3.mpg newfile.mpg

In Linux, I use cat:

cat file1.mpg file2.mpg file3.mpg >> newfile.mpg
Glorfindel
  • 4,158
Joshua K
  • 855
9

Recent versions of ffmpeg can do this via its concat demuxer, which should be more reliable than using cat or copy. First, create a file called inputs.txt, containing

file /path/to/input1.mpg
file /path/to/input2.mpg
file /path/to/input3.mpg

Then use the following ffmpeg command:

ffmpeg -f concat -i inputs.txt -c copy output.mpg

See here for more information.

evilsoup
  • 14,056
2

For Linux Avidemux is quite good:

For Windows there is

There are also more low level tools that work directly on the MPEG stream such as:

Those might be good for lossless cutting, but give much less freedom.

Grumbel
  • 3,782
1

Join/encode/convert to your heart's content with MediaCoder.

Gareth
  • 19,080
Tutul
  • 488
1

How about Windows Movie Maker or Windows Live Movie Maker? (depending on your version of windows, which it seems you are using by your other questions).

0

I have used copy/b & that joins the files OK but it does something to the header that messes with the time code. But then I ran the entire file through XMedia Recode using just video copy (not convert) & audio copy with the same extension & that seemed to straighten it out: http://forum.videohelp.com/threads/375401-How-to-cut-any-video-with-Xmedia-Recode

Max
  • 1
0

If you simply copy them together using the command line as suggested above, the duration will not be reported correctly in your media player, but it still may work. Don't trust the duration reported by your player - check manually.

When ripping and combining videos from DVD, If I rip without re-encoding, I get mpg files which I can combine with the copy command, and then even though VLC doesn't report the duration correctly, Handbrake "sees" the correct duration, and the final re-encoded mp4 files play correctly and display the correct duration.

Glaurung
  • 191