Find the answer to your Linux question:
Results 1 to 9 of 9
Does anyone know how can I splitt a file of 750MB in one file of 690MB and one file for the rest?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2005
    Posts
    2

    Video file is too big


    Does anyone know how can I splitt a file of 750MB in one file of 690MB and one file for the rest?

  2. #2
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    Erm, I'm not sure about splitting them, but can you compress it maybe?

    Code:
    tar cjvf file.tar.bz2 file
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  3. #3
    Just Joined!
    Join Date
    Jul 2005
    Posts
    2
    It's not working. the compressed file is only about 7-8 MB smaller then the original. but THX

  4. #4
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    How did u get the video file?

    I remember using an app called dvdrip (imaginitively enough for ripping DVD's), (no this isn't illegal, as long as u dont sell them on, backing up is legal)

    I have only used this once, but i seem to remember there being the option to split the AVI up after encoding etc. and iirc, you can specify the size, so u could specify disk 1 as 690MB and then it'll just make the other disk the rest.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  5. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    It's really simple to split it up. Just use the `dd' command, as follows.

    For two parts, as you described:
    Code:
    dd if=your-input-file of=part1 bs=1M count=690
    dd if=your-input-file of=part2 bs=1M skip=690
    That will take 690 MiBs into the first part, and the rest into the second part.

    Just as an example, here's how to split a file into 3 parts of 10 MiBs each, and then the rest into a fourth part:
    Code:
    dd if=input-file of=part1 bs=1M count=10
    dd if=input-file of=part2 bs=1M count=10 skip=10
    dd if=input-file of=part3 bs=1M count=10 skip=20
    dd if=input-file of=part4 bs=1M skip=30

  6. #6
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Oh, I forgot. To recombine the part again, just use `cat':
    Code:
    cat part1 part2 >merged-file
    Or, in the last example:
    Code:
    cat part1 part2 part3 part4 >merged-file
    Of course, the shell does have a couple of ways to make that shorter. Just a few examples -- these won't be on the test.
    Code:
    cat part{1,2,3,4} >merged-file
    
    cat part[14] >merged-file
    
    # Okay, not really shorted, but arguably more flexible:
    (for f in $(seq 1 4); do cat "part$f"; done) >merged-file
    
    # If these are the only "parts" in the CWD:
    cat part* >merged-file

  7. #7
    Just Joined!
    Join Date
    Mar 2005
    Posts
    38
    I assume you want to fit the files onto CDs or something. If that's the case and you want them to be individually playable, then splitting them as proposed won't work.

    Instead, what you'll need to do is use some sort of video encoder and transcode it into two pieces. The problem is (I'm fairly certain), you'd actually have to re-encode the video, which means you will lose some quality. mencoder does provide the ability to do stream copying, but I don't think you can specify the start/end positions with stream copying. I could be wrong.

    There are a number of different tools for doing this and each is different in how it operates. You might want to look at mencoder which comes with mplayer (http://www.mplayerhq.hu)

    If you choose mencoder, I'd suggest joining the mencoder mailing list (see the web site) for help.

    Pete

  8. #8
    Just Joined!
    Join Date
    Mar 2005
    Posts
    38
    Quote Originally Posted by sdousley
    How did u get the video file?

    I remember using an app called dvdrip (imaginitively enough for ripping DVD's), (no this isn't illegal, as long as u dont sell them on, backing up is legal)
    Unless you're a lawyer, you should be careful about giving legal advice. There is actually some question about the legality of backing up DVDs from MPAA affiliates in some countries, even for personal use. While doing so may not violate copyright law, it may violate the DMCA in the US, depending on the tools being used. Ridiculous, and it's highly unlikely you would be prosecuted for doing so for personal use, but still...

  9. #9
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by pdavis68
    Quote Originally Posted by sdousley
    How did u get the video file?

    I remember using an app called dvdrip (imaginitively enough for ripping DVD's), (no this isn't illegal, as long as u dont sell them on, backing up is legal)
    Unless you're a lawyer, you should be careful about giving legal advice. There is actually some question about the legality of backing up DVDs from MPAA affiliates in some countries, even for personal use. While doing so may not violate copyright law, it may violate the DMCA in the US, depending on the tools being used. Ridiculous, and it's highly unlikely you would be prosecuted for doing so for personal use, but still...
    hehe ok, noted. in future, i will keep an eye out for such things.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

Posting Permissions

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