Page 1 of 2 12 LastLast
Results 1 to 10 of 23

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

Hybrid View

  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
    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?

  7. #7
    Join Date
    Aug 2007
    Location
    Saint Louis, MO. USA
    Beans
    214
    Distro
    Ubuntu 14.04 Trusty Tahr

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

    Quote Originally Posted by bluebyt View Post
    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?
    You need to change directory into the \Madonna file by entering 'cd Madonna' in the terminal. Then you don't have to put the directory in for every file. That's probably your syntax error.

  8. #8
    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.

  9. #9
    Join Date
    Jun 2006
    Location
    Red Sox Nation
    Beans
    40
    Distro
    Ubuntu 9.10 Karmic Koala

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

    Quote Originally Posted by poptones
    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
    Sweet...this will come in handy; thanks for the info.

  10. #10
    Join Date
    Jun 2005
    Location
    bonn, germany
    Beans
    49

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

    or easier:

    Code:
    mencoder -oav copy -ovc copy -o output.avi 1.avi 2.avi
    i must cease the senseless sucking

Page 1 of 2 12 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
  •