Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: HOWTO: easily join separate mpeg files into one file.

  1. #1
    Join Date
    Nov 2005
    Location
    Czech Republic
    Beans
    3
    Distro
    Ubuntu Breezy 5.10

    Thumbs up HOWTO: easily join separate mpeg files into one file.

    To join separate mpeg files (for example a movie) into one smooth mpeg file:
    Code:
    cat file1.mpg file2.mpg file3.mpg... > filename.mpg
    Pay attention to the order of files after the cat command, it will determine the sequence within the final file.
    This will ONLY join the files! It has NO EFFECT on the quality.
    It DOES NOT work with AVI files!
    Last edited by fleshnblood; November 3rd, 2005 at 05:05 PM.

  2. #2
    poptones Guest

    Re: HOWTO: easily join separate mpeg files into one file.

    Actually, it does work with avi files or ANY files split with something like hjsplit.

    It will also work on ANY AVI files so long as you have mplayer installed. After joining some arbritrary group of AVI files via "cat," tell mplayer to rebuild the index

    mencoder -forceidx -oac copy -ovc copy infile.avi -o outfile.avi

  3. #3
    Join Date
    Nov 2005
    Location
    Czech Republic
    Beans
    3
    Distro
    Ubuntu Breezy 5.10

    Re: HOWTO: easily join separate mpeg files into one file.

    Quote Originally Posted by poptones
    Actually, it does work with avi files or ANY files split with something like hjsplit.

    It will also work on ANY AVI files so long as you have mplayer installed. After joining some arbritrary group of AVI files via "cat," tell mplayer to rebuild the index

    mencoder -forceidx -oac copy -ovc copy infile.avi -o outfile.avi
    Thanks for the tip, I haven't tried it through mplayer. When I joined AVI files with cat, the final file was OK in terms of picture but the audio was shifted. So I guess mplayer fine-tunes it, right?

  4. #4
    poptones Guest

    Re: HOWTO: easily join separate mpeg files into one file.

    I will try. If a file is made with MP3 (especially vbr mp3) it may not be able to do so. MP3 doesn't have a fixed frame size and so is ill suited to video soundtracks, but that doesn't stop people from (mis)using it.

    If you cannot get audio and video to synch (because someone made the audio mp3) an easy way to correct this is to save the audio to a file as pcm, then use mplayer to add it back (you can specify separate audio and video files). I use 4 bit ADPCM for audio - it's larger than MP3 but it is fixed size, synchs perfectly, and the distortion it adds is much more tolerable than the darth vader whooshing added by mpeg codecs.
    Last edited by poptones; November 3rd, 2005 at 08:56 PM.

  5. #5
    Join Date
    Oct 2005
    Beans
    80

    Re: HOWTO: easily join separate mpeg files into one file.

    Thank you very much! I was looking for that since I installed Ubuntu 1 month ago.

    cat Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.001 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.002 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.003 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.004 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.005 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.006 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.007 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.008 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.009 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.010 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.011 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.012 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.013 > Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg
    bash: syntax error near unexpected token `('

    Where is the syntax error, please?
    Last edited by bluebyt; November 4th, 2005 at 12:52 AM.

  6. #6
    Join Date
    Nov 2005
    Location
    Czech Republic
    Beans
    3
    Distro
    Ubuntu Breezy 5.10

    Re: HOWTO: easily join separate mpeg files into one file.

    Quote Originally Posted by poptones
    I will try. If a file is made with MP3 (especially vbr mp3) it may not be able to do so. MP3 doesn't have a fixed frame size and so is ill suited to video soundtracks, but that doesn't stop people from (mis)using it.

    If you cannot get audio and video to synch (because someone made the audio mp3) an easy way to correct this is to save the audio to a file as pcm, then use mplayer to add it back (you can specify separate audio and video files). I use 4 bit ADPCM for audio - it's larger than MP3 but it is fixed size, synchs perfectly, and the distortion it adds is much more tolerable than the darth vader whooshing added by mpeg codecs.
    Can you please write a "step by step" for the above to get it work.
    I'm still very new to these things

    Thanks.

  7. #7
    Join Date
    Jan 2005
    Location
    Lexington, Kentucky
    Beans
    150
    Distro
    Ubuntu Karmic Koala (testing)

    Re: HOWTO: easily join separate mpeg files into one file.

    Quote Originally Posted by bluebyt
    Thank you very much! I was looking for that since I installed Ubuntu 1 month ago.

    cat Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.001 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.002 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.003 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.004 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.005 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.006 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.007 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.008 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.009 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.010 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.011 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.012 Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.013 > Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg
    bash: syntax error near unexpected token `('

    Where is the syntax error, please?
    Try \'ing before all the ('s and )'s.

    Can this method be applied to mp3's like audiobooks?

  8. #8
    poptones Guest

    Re: HOWTO: easily join separate mpeg files into one file.

    Ah, you need to read the friendly manual on "cat"

    Put the sections in one directory, go to your terminal and type "cat Madonna" and press tab. When it autocompletes to "Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.0"
    press the splat key *, space, "> Madonna" and press tab again. This time when it autocompletes press backspace so the filename ends with "mpg" Now press enter.

    cat Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.* >> Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg

    You can wildcard cats and it will automatically group the parts by sequence.

    Linux roolz.
    Last edited by poptones; November 6th, 2005 at 01:56 AM.

  9. #9
    Join Date
    Oct 2005
    Beans
    80

    Re: HOWTO: easily join separate mpeg files into one file.

    Quote Originally Posted by poptones
    Ah, you need to read the friendly manual on "cat"

    Put the sections in one directory, go to your terminal and type "cat Madonna" and press tab. When it autocompletes to "Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.0"
    press the splat key *, space, "> Madonna" and press tab again. This time when it autocompletes press backspace so the filename ends with "mpg" Now press enter.

    cat Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg.* >> Madonna\ -\ Hung\ up\ (live\ at\ EMA).mpg

    You can wildcard cats and it will automatically group the parts by sequence.

    Linux roolz.
    Thank you!!!!

  10. #10
    Join Date
    Jun 2005
    Location
    South Africa
    Beans
    259
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO: easily join separate mpeg files into one file.

    Hi,

    Thank you for the "cat" help... did not know it would be so easy to combine mpg files...

    I have another question... i once burned a vcd file but the .bin file was bigger than 700MB and it all fit on the cd? now... i made an image and it was also little big, but did not want to write on one cd...

    i used ffmpeg to change a AVI to MPG (vcd) and then made an image with vcdimager... the mpg file grew bigger? ok different compression...

    what would be the easiest way to convert AVI to VCD?

    thanx... command prompt pleas...

    born to suffer!

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •