Highlights of a Week

January 13th, 2010

My roommates are awesome in the video.


Another Semester!

January 11th, 2010

Well I'm off to another semester and the last one before I graduate with my bachelors degree in Electrical Engineering.

The classes that I am taking are:
Communications 1
Digital Radio
Analog VLSI
Engineering Communications
Western Swing

I decided that i needed two add a mix into my regiment of engineering classes. I'm more than just an Engineer but I am also a human. I might not write as much as I'd like to for this site but will try to continue to post here. I have a couple more videos that I'd like to post here.

The Beardall Christmas video

January 9th, 2010

I finally put together the video I took during Christmas when I was given my camera. I'm not actually in the video because I'm the one recording. Enjoy!


The Video Flow in Linux

January 8th, 2010

So I was given a camera for Christmas that can record video. This brought me to sort of re-learning or better learning the video flow in Linux using the many utilities. If you are used to working with audio you are still in a peaceful land. Doing video is going to the wild west which hasn't been tamed yet.

The tools of the trade are libquicktime, ffmpeg, mplayer, cinelerra, mjpegtools, and xine.

I use a combination of libquicktime, ffmpeg, and mjpegtools to get the video ready for import into Cinelerra. Getting the video into a format that can be read by Cinelerra is rather tricky.

Cinelerra reads the quicktime files the best and is able to render back to quicktime mov files the best as well. The recommended video encoding is mpeg4, or h.264. Now what is made by most cameras that are recorded in either of those video codecs won't load into Cinelerra. I have found that for flawless import I convert the video into raw YUV which produces a rather large file by running the following command.

 

ffmpeg -i $file -f yuv4mpegpipe - | y4mtoqt -k -o $output_file

 

The command loads the file into ffmpeg and pipes it out into a format called yuv4mpeg and that can be used in the mjpegtools. The command y4mtoqt sends writes the data back out in the pixel format that was specified with ffmpeg. The -k option is used for when the color is reversed.

The next thing we need is to decode the audio and re-encode it into another file that will be imported to Cinelerra. I use ffmpeg to do that and the audio codec I use is pcm_s16be. The command looks like this:

 

ffmpeg -i $inputfile -vn -acodec pcm_s16be -ar 48000 $outputfile

 

The flag -acodec specifies the audio codec and the -ar specifies the audio bitrate.

The next thing is to load the files into Cinelerra and do the editing that you'd like. Cinelerra exceeds the scope of this entry but may be covered in a later entry. Suffice to say to export I use either the yuv4mpegpipe to encode just the video for later multiplexing the audio back into the video or I use the quicktime export and select one of the yuv options along with two compliment audio.

Once the project has been exported and there is one file with the audio and video multiplexed together then I use ffmpeg once again to encode to a smaller file. I use the following command:

ffmpeg -i $inputfile -vcodec libx264 -vpre slowfirstpass -s 512x288 -vb 400k -pass 1 -acodec libfaac $outputfile.mp4

This specifies the vcodec to use the libx264 to encode into the h.264 compressed video format. -vpre is a video preset for ffmpeg to use. -s sets the size of the output video and if ffmpeg needs to resize that will be done too. -pass 1 specifies the pass number that I'm doing since I want to do two pass encoding to get the file well compressed at a fairly constant bitrate. -vb specifies the video bitrate that I want to use. I also specified libfaac for the audio codec so that I can get aac audio into the stream.

The next thing to do is to do the second pass on the video encoding. The first pass could take several hours depending on the length of the video. I'll run the same command with the exception of -pass which I'll change to -pass 2 and -vpre which also gets change to -vpre max.

 

ffmpeg -i $inputfile -vcodec libx264 -vpre max -s 512x288 -vb 400k -pass 2 -acodec libfaac $outputfile.mp4

 

The file can be copied to the website but the entire file will have to be downloaded to start playback. To fix this there is a program called qt-faststart. The command looks like this:

 

qt-faststart $inputfile $outputfile

 

Now I have a video file that can be copied to the website and is ready for viewing. The file is as small as I want and with the quality that I'd also like.

To summarize the commands that I run to make this all happen:

 

ffmpeg -i m4h00005.mp4 -f yuv4mpegpipe - | y4mtoqt -k -o m4h00005v.mov

ffmpeg -i m4h00005.mp4 -vn -acodec pcm_s16be -ar 48000 m4h00005a.mov cinelerra

ffmpeg -i m4h00005.mov -vcodec libx264 -vpre slowfirstpass --s 512x288 pass 1 -vb 400k -acodec libfaac m4h00005.mp4

ffmpeg -i m4h00005.mov -vcodec libx264 -vpre max -s 512x288 -pass 2 -vb 400k -acodec libfaac webvideo.mp4 qt-faststart webvideo.mp4 webvideo-fast.mp4

 

That is everything summarized. I hope that his helps someone to get video editing working in Linux.

With ffmpeg the video can be encoded into mpeg4 and imported into Cinelerra and with mp3 audio encoding. I prefer not to use mp3 since it is lossy and that is bad when editing video and audio. So for mpeg4 video I use the following command to import into Cinelerra:

ffmpeg -i $inputfile -vcodec mpeg4 -strict very -sameq -acodec pcm_s16be $outputfile.mov

That will get the video compressed and into a format that Cinelerra can read and export.

Religious Studies

December 23rd, 2009

I found this interesting book that was written in 1823 - 1825 and talks about the indians being related to the Israelites in Judea. View of the Hebrews

I've read a little bit in the book and seems like an interesting narrative or history. The book seems to read like a speculative history.