Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Splitting a divx movie
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Kawada
Apprentice
Apprentice


Joined: 22 Jul 2002
Posts: 159
Location: Florida, USA

PostPosted: Mon Apr 14, 2003 7:37 am    Post subject: Splitting a divx movie Reply with quote

Okay, I've got a divx movie that is too large to fit onto a CD. So I want to split the movie into two seperate files that can then be burned onto seperate CDs. Anybody have suggestions for a program that can do this easily?
_________________
Kawada

2002 Nethack Tournament -- 317th runner-up http://nethack.devnull.net/
Back to top
View user's profile Send private message
mikepb78
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 171
Location: London

PostPosted: Mon Apr 14, 2003 11:15 am    Post subject: Helper Program [updated]: Reply with quote

Spliting a Divx Movies in 2:
Here is a simple split script that will work with avi (not sure about mpegs). Remember to "chmod +x moviesplit" and copy it into your path :
Code:

#!/usr/bin/perl
use Video::Info;
my $info = Video::Info->new(-file=>$ARGV[0]);

print "Splitting the movie : ";
exec("mencoder -ofps " . $info->fps()
     . " -oac copy -ovc copy  -o   \"" . $ARGV[0] . "-part01.avi\" -endpos " . $info->duration()/2 . " \"" . $ARGV[0] . "\" &&"
     . "mencoder  -ofps " . $info->fps()
     . " -oac copy -ovc copy  -o  \"" . $ARGV[0] . "-part02.avi\" -ss  " . $info->duration()/2 . " \"" . $ARGV[0] . "\"");


I need to drop the extensions,as you can see i am no perl guru :). You need to -forceidx for broken avi's

Usage : moviesplit movie.avi

A nice little prog to display info on a movie :
Code:
#!/usr/bin/perl
use Video::Info;
my $info = Video::Info->new(-file=>$ARGV[0]);

print "Filename : " . $ARGV[0] . "\n";
print "Video Codec : " . $info->vcodec() . "\n";
print "Video Bitrate : " . $info->vrate()/1000 . " kb \n";
print "Audio Codec : " . $info->acodec() . "\n";
print "Audio Bitrate : " . $info->arate()/1000 . " kb \n";
print "Dimensions  : " . $info->width() . "x" . $info->height() . "\n";
#print "Aspect Ratio : " .  $info->aspect() . "\n";
print "Frames Per Second : " . $info->fps() . "\n";
print "Duration in Seconds : " . $info->duration() . "\n";
print "Video Frames : " . $info->vframes() . "\n";



Requirements :
Mplayer and Video::Info which is available here or CPAN :
:arrow: http://www.wooly.org/~allenday/perl/video.php

Video::INFO DEPENDENCIES
Video::OpenQuicktime (not really needed)
Class::MakeMethods::Emulator

Goodluck.

PS : midentify that is packaged with mplayer can also tell you info on a avi etc. I will support more formats than Video::Info but is not as acurate.

Code:
#!/bin/sh
mplayer -vo null -ao null -frames 0 -identify "$@" 2>/dev/null |
    grep "^ID" |
    sed -e 's/[`\\!$"]/\\&/g' |
    sed -e '/^ID_FILENAME/ { s/^ID_FILENAME=\(.*\)/ID_FILENAME="\1"/g; }'


PS : You can also use avisplit/ogmsplt/avidemux with various degrees of success

Web Resources :

Transcode : http://www.theorie.physik.uni-goettingen.de/~ostreich/transcode/
Avidemux : http://avidemux.sourceforge.net/
ogmtools : http://www.bunkus.org/videotools/ogmtools/
Video::Info : http://www.wooly.org/~allenday/perl/video.php


Last edited by mikepb78 on Mon Apr 14, 2003 6:41 pm; edited 2 times in total
Back to top
View user's profile Send private message
kasper
n00b
n00b


Joined: 22 Jul 2002
Posts: 55
Location: Montpellier

PostPosted: Mon Apr 14, 2003 2:43 pm    Post subject: Reply with quote

you can also just emerge transcode and use its avisplit command ;)
for ogm files, emerge ogmtools and use the ogmsplit command

"--help" is your friend ;)
Back to top
View user's profile Send private message
mikepb78
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 171
Location: London

PostPosted: Mon Apr 14, 2003 3:06 pm    Post subject: plug :) Reply with quote

kasper wrote:
you can also just emerge transcode and use its avisplit command ;)
for ogm files, emerge ogmtools and use the ogmsplit command

"--help" is your friend ;)


Noo.... Avisplit takes to long and messes things up sometimes !!! Although ogmsplt is best way for ogm's

Code:
 time avisplit -s 358  -i Boondock\ Saints.avi > /dev/null  2> /dev/null
real    2m17.764s
user    0m1.760s
sys     0m12.140s

time moviesplit "Boondock Saints.avi"  > /dev/null  2> /dev/null
real    1m13.096s
user    0m5.160s
sys     0m10.540s
Back to top
View user's profile Send private message
mean
Guru
Guru


Joined: 25 Sep 2002
Posts: 313

PostPosted: Mon Apr 14, 2003 5:53 pm    Post subject: Reply with quote

You should try avidemux
It can even split movie with VBR MP3 audio....
....
Back to top
View user's profile Send private message
Kawada
Apprentice
Apprentice


Joined: 22 Jul 2002
Posts: 159
Location: Florida, USA

PostPosted: Mon Apr 14, 2003 7:08 pm    Post subject: Reply with quote

Thanks for all the help. I ended up using your perl script mikepb78, worked perfectly. Took me a little while to track down and install all the perl modules it needed. Haven't had to do that kind of dependency checking since I moved to Gentoo. God I love portage. :D
_________________
Kawada

2002 Nethack Tournament -- 317th runner-up http://nethack.devnull.net/
Back to top
View user's profile Send private message
svyatogor
Retired Dev
Retired Dev


Joined: 13 Feb 2003
Posts: 186
Location: Kingdom of Kells

PostPosted: Sun Dec 28, 2003 1:28 pm    Post subject: Reply with quote

Just a small comment for over people reading this thread. In case you want to avoid using perl and run mencoder directly, you can use the following commands:
Code:

mencoder -ofps 29.97 -oac copy -ovc copy -o ./Part1.avi -endpos 01:16:00 ./Original.avi

mencoder -ofps 29.97 -oac copy -ovc copy -o ./Part2.avi -ss 01:16:00 ./Original.avi


You can get the Frame/second rate using tcprobe -i Original.avi (this tool is available from transcode package).

The -endpos and -ss parameters are given in form: hh:mm:ss.

P.S. avisplit in some cases fails miserably. The sound and video get tottally out of sync. Using transcode as suggested in man avisplit didn't help me.
Back to top
View user's profile Send private message
navidson
Apprentice
Apprentice


Joined: 30 May 2003
Posts: 235
Location: entre mon bureau et mon lit

PostPosted: Sun Dec 28, 2003 4:32 pm    Post subject: Reply with quote

try avidemux (in portage tree).....it works great
_________________
Il semblerait que cela fait un peu trop longtemps que des têtes n'ont pas été plantées au bout des piques.
Il semblerait que je suis loin d'être le seul à partager cette impatience.
Maurice G Dantec, a propos du TPI
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum