Video Editing: Difference between revisions

m formatting
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight"
 
Line 59: Line 59:


You can extract the part you want with mplayer like this:
You can extract the part you want with mplayer like this:
<source lang="bash">
<syntaxhighlight lang="bash">
$ mencoder -ovc copy -oac copy infile -ss 00:10:09.5 -endpos 00:05:00 -o outfile
$ mencoder -ovc copy -oac copy infile -ss 00:10:09.5 -endpos 00:05:00 -o outfile
</source>
</syntaxhighlight>
"-ovc" means "output video codec", "-oac" means "output audio codec",
"-ovc" means "output video codec", "-oac" means "output audio codec",
the "-ss" argument skips ahead to 10 minutes 9.5 seconds into the
the "-ss" argument skips ahead to 10 minutes 9.5 seconds into the
Line 70: Line 70:


This can also be done with ffmpeg:
This can also be done with ffmpeg:
<source lang="bash">
<syntaxhighlight lang="bash">
$ ffmpeg -acodec copy -vcodec copy -itsoffset -00:10:09.5 -i infile -ss 00:10:09.5 -t 00:05:00 outfile
$ ffmpeg -acodec copy -vcodec copy -itsoffset -00:10:09.5 -i infile -ss 00:10:09.5 -t 00:05:00 outfile
</source>
</syntaxhighlight>
Note that the "-itsoffset" option must be specified to make sure that
Note that the "-itsoffset" option must be specified to make sure that
A/V timestamps synchronize, and that its value must be the negative of
A/V timestamps synchronize, and that its value must be the negative of
Line 82: Line 82:
To transcode the video, specify the output codecs as the "vcodec" and
To transcode the video, specify the output codecs as the "vcodec" and
"acodec" sub-options to the libavcodec option (-lavcopts):
"acodec" sub-options to the libavcodec option (-lavcopts):
<source lang="bash">
<syntaxhighlight lang="bash">
$ mencoder -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:acodec=ac3 infile -o outfile
$ mencoder -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:acodec=ac3 infile -o outfile
</source>
</syntaxhighlight>
Here, "lavc" means to use one of the libavcodec codecs, specified by
Here, "lavc" means to use one of the libavcodec codecs, specified by
the "vcodec" and "acodec" suboptions to the "-lavcopts" option (which
the "vcodec" and "acodec" suboptions to the "-lavcopts" option (which
Line 94: Line 94:
If you want to change the framerate of the video, you can use
If you want to change the framerate of the video, you can use
something like this:
something like this:
<source lang="bash">
<syntaxhighlight lang="bash">
$ mencoder -ofps 25 -oac copy -ovc copy -o outfile infile
$ mencoder -ofps 25 -oac copy -ovc copy -o outfile infile
</source>
</syntaxhighlight>
Note that, whenever you use "copy" as the codec, mplayer will copy the
Note that, whenever you use "copy" as the codec, mplayer will copy the
corresponding stream to the output unmodified.  That means it will ignore
corresponding stream to the output unmodified.  That means it will ignore
Line 102: Line 102:


For example:
For example:
<source lang="bash">
<syntaxhighlight lang="bash">
$ mencoder -oac copy -ovc copy -af volume=10 -o outfile infile
$ mencoder -oac copy -ovc copy -af volume=10 -o outfile infile
</source>
</syntaxhighlight>
WILL NOT DO what you probably want, because with "-oac copy" the
WILL NOT DO what you probably want, because with "-oac copy" the
"volume" audio filters (specified with "-af") will be ignored, and the
"volume" audio filters (specified with "-af") will be ignored, and the