My small contribution to the LUG this week is to offer some brief instructions on how to do Video clipping for You Tube using Linux exclusively.

Understood is the fact that my understanding and practice is rudimentary and possibly not the best. In the case any reader has better information to offer please feel free to forward it to myself or to Duane. My video clips are posted on my blog at gilfishdadblog.blogspot.com. There are a couple of other videos featured there as well reflecting my personal taste.

The objective in creating digital video is for sharing via You Tube or another forum. Thus, there is a 20mb limit in file size. My understanding is file size vs length of video provides the quality of video constraint.

My steps in creating a You Tube video are as follows:

First, I have a camcorder which is digital but also magnetic tape. I purchased a DVD recorder and have been using the camcorder in play mode to record the feed directly to the DVD recorder. On my recorder (SV 2000 ). Also my setup includes a VHS/DVD player which has helped bring back to life old home VHS tapes to You Tube. Both the recorder and the player were purchased at Walmart for less than $75. I record a DVD-R and not a DVD-RW as it formats the final disk for play on any player or the computer.

Once the DVD is made I use the computer to first transfer it back over to magnetic media in the form of hard disk data.

The DVD files of a raw DVD video image look something like this:

Under the VIDEO_TS directory:

dr-xr-xr-x 2 4294967295 4294967295  560 2007-11-24 23:31 .
dr-xr-xr-x 4 4294967295 4294967295  136 2007-11-24 23:31 ..
-r-xr-xr-x 1 4294967295 4294967295  12K 2007-11-24 23:31 VIDEO_TS.BUP
-r-xr-xr-x 1 4294967295 4294967295  12K 2007-11-24 23:31 VIDEO_TS.IFO
-r-xr-xr-x 1 4294967295 4294967295  94K 2007-11-24 23:31 VIDEO_TS.VOB
-r-xr-xr-x 1 4294967295 4294967295  52K 2007-11-24 23:31 VTS_01_0.BUP
-r-xr-xr-x 1 4294967295 4294967295  52K 2007-11-24 23:31 VTS_01_0.IFO
-r-xr-xr-x 1 4294967295 4294967295 1.0G 2007-11-24 23:31 VTS_01_1.VOB
-r-xr-xr-x 1 4294967295 4294967295 1.0G 2007-11-24 23:31 VTS_01_2.VOB
-r-xr-xr-x 1 4294967295 4294967295 1.0G 2007-11-24 23:31 VTS_01_3.VOB
-r-xr-xr-x 1 4294967295 4294967295 1.0G 2007-11-24 23:31 VTS_01_4.VOB
-r-xr-xr-x 1 4294967295 4294967295 332M 2007-11-24 23:31 VTS_01_5.VOB

Under the VIDEO_RM directory:
dr-xr-xr-x 2 4294967295 4294967295  196 2007-11-24 23:31 .
dr-xr-xr-x 4 4294967295 4294967295  136 2007-11-24 23:31 ..
-r-xr-xr-x 1 4294967295 4294967295  32K 2007-11-24 23:31 VIDEO_RM.BUP
-r-xr-xr-x 1 4294967295 4294967295 1.0M 2007-11-24 23:31 VIDEO_RM.DAT
-r-xr-xr-x 1 4294967295 4294967295  32K 2007-11-24 23:31 VIDEO_RM.IFO

Apparently a VOB file is very much like an mpeg2 file with subtitle track support. Wikipedia has a write up here: http://en.wikipedia.org/wiki/VOB

Previously, I have used DVD_RIP to transcode the video files into an avi format using xvid codec as shown in earlier slides presented in the PC LUG. Then I was using some transcode commands which worked quite well once I figured out -M 1 and -M 3 transcode commands. It is important to add that staying within the command line is something in the PC LUG we are all learning as a useful discipline. Flexibility, versatility, and feedback response seems to be better when the GUI is left behind although it is a great starter and some will always prefer the GUI.

Lately I have had the best luck with direct commands from mencoder to in one swoop turn the DVD into avi. The response is a bit different and it still takes a while. If the screen response on the command line looks like it does not.

This command can be entered and with a file name to suit your purpose. The results have been working well for me. The results take a few hours. Best left to an overnight run..

mencoder dvd:// -oac mp3lame -ovc xvid -xvidencopts pass=2:bitrate=800 -o xvidfile.avi

My experience in running this command is that it runs well reducing a 5GB dvd into a 400 mb or so avi file.

We will now take a few minutes to review the mencoder man page and discuss some of the more familiar and possible the more useful command arguments.

Following the above commands I have found using ffmpeg works the best to get the clip you want.

I use VLC to get the time of start and time duration. Mplayer provides excellent frame data but ffmpeg arguments of -ss and -t require time in 00:00:00 format. Perhaps we can update the instructions in case we discover a better way to find direct clip start and stop by frame number. We will take a few moments to look at the two player options and discuss the differences:

Also we will take a few moments to review the man page of both these players.

I have found experimenting with different options such as size in cif or qcif, codec, and bitrate have been successful in reducing the clip to the optimal file size, For example:

To reduce this file

-rw-r--r--  1 gilfishdad gilfishdad 466M 2007-11-26 02:27 megdancing.avi

To this file
-rw-r--r--  1 gilfishdad gilfishdad 7.7M 2007-11-26 20:31 meghiphop3.avi

I used the command:
ffmpeg -i megdancing.avi  -ss 00:14:13 -t 00:03:44 -copyright tomgilmore -ar 22050  -s cif -vcodec mpeg4 -b 6000 meghiphop3.avi

Some of my recent transcode successes like the command below:

transcode -i VTS_01_1.VOB -x mpeg2 -y xvid -F 3 -M3 -U -Z 480x320 francisfstep.avi

This command shows how you can skip a step if you knows exactly what clip you are looking for. We will now take a minute to review the transcode man page.