Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am currently trying to break a large .avi file into three equal chunks. I want it to be done slick in commandline as I dont want to go through the bother of a GUI to select points I want etc. Recommendations have pointed me to the avidemux command line interface. Unfortunately, it seems to miss frames when it breaks the file into fixed sizes... this means that when I try to patch them together there is a noticable skip where the cut has occurred. I was wondering if there are any other simple commandline utilities I could try to simple break one large avi file into 3 files of identical size without loss of frames?
I don't think split is appropriate as it has no idea where to break the file - it uses criteria like number of bytes, lines and so on. I assume that splitting an avi file would require the addition of some sort of headers to each file, and probably choosing a split point at a key frame, or adding a new one at the start of the second and third chunk.
Maverick, what is the format of the video? As I understand it, AVI is just a container, and may contain one of a large number of codecs. Many codecs are supported by Linux programs, but a few are less commonly or less well supported.
Assuming the codec in one which can be handled, you could use one of the various transcoding tools to extract and re-encode a segment of the original file. This is not ideal because you would lose quality and it will take a lot of CPU power.
What would be ideal would be a way to do the edits without having to re-encode everything. I don't know how to do this with video, sorry. With audio (ogg or mp3) you can use mp3splt. I'm guessing you want that sort of thing but for video.
The video I need to split is coded in DivX. Any ideas/experiences on a program which could do this? I need to spilt it using the commandline so which ever program it is , there needs to be a commandline interface. Hoping someone can help...
I just found that there is a program called avisplit on my system which seems to work on DivX files. This program is part of the transcode package (at least it is on Ubuntu).
You can specify to split by maximum size of output file, or by time.
Do you want to split the avi file to produce 3 separate playable avi files, or do you want to split the file just due to the size; Such as posting on usenet or sending slices via email, or not exceeding the filesize limit? If it is the latter, then you can use the split command to split the file up into slices. I've done this to store a backup of my home directory before an upgrade. The external drive I had handy used the FAT32 filesystem.
I think that avisplit will break up a video into shorter videos.
I will have a try with avisplit. I actually need the 3 smaller files to be seperate playable files so, as you say, I think avisplit is probably best. matthewg42, when you split the files and play them sequencially (say in vlc playlist), is there a noticable jump when it changes from one file to the other? This is what I have experienced in avidemux. I dont know if it is intelligent enough (or what it does) when you ask it for files a certain size, whether it creates one file of say 20MB and then starts at exactly the next frame to generate the next file etc...
Any input/information would be helpful but in the meanwhile I will try out avisplit when I get home and post back. Thanks for the help so far.
Bummer, (thanks for testing it Matthew) would anyone know of software which cuts the file according to the frame number? At least then I can have control over how the three smaller files are created and avoid this clipping problem?
Although it's wise to take a look at the other options used (are divx options needed??) and to check the manpage (man mplayer), the options that concern your question are:
-ss 00:00:00 (Seek to given time position).
and -endpos (Stop at given time or byte position).
-ss 00:01:30 -endpos 00:00:30 will start playing one minute and thirty seconds into the movie and will play for 30 seconds. The actual start and stop point are chosen by mencoder, there's no hard cut-off. I never tried using the byte position (-endpos 100mb), and don't know if this is or is not a hard cut-off.
Anyways, Hope I gave a better answer then the previous one
Okay, I've tried all the solutions and played the broken files back... The best at breaking the file into 3 without loss of frames seems to be mencoder using precise time stamps rather than file size. It's a little slower but seems to get the job done. I hope this helps anyone else who wants to do what I wanted to do....
Thanks everyone for posting suggestions (please do , if anyone has a better/faster option)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.