indiWiz.com

Subhash's Tech Log

Archive for the ‘multimedia’ tag

Finding the width and height of Ogg Theora videos

without comments

When placing Ogg Theora video files in your site using HTML5 <video> tags, you can optionally specify the width and height of the videos. But how do you find the width and height? Use the tool ogginfo:

$ ogginfo video.ogg

Written by Subhash Chandran

July 31st, 2009 at 9:43 am

Posted in Linux

Tagged with ,

Text-to-speech in Linux

without comments

Festival is an interesting OpenSource project for converting text-to-speech in Linux environment. It has a commandline tool text2wave which converts, guess what, text to voice in wave format. Simple usage:

$ echo "Hello World" | text2wave > a.wav

Wave files are uncompressed, and occupy lot of space. To encode to Ogg Vorbis format:

$ oggenc a.wav

This will create a.ogg in the current directory.

Written by Subhash Chandran

July 31st, 2009 at 8:55 am

Posted in Linux

Tagged with ,

Desktop Video Capture in Linux

without comments

recordmydesktop is a powerful screencasting commandline tool for Linux. To capture the screen:

$ recordmydesktop


Press Ctrl+C to quit capturing. The captured video will be encoded in Ogg Theora format and saved as out.ogv (if out.ogv exists, as out-1.ogv and so on). To save the file in another name, say myout.ogv:

$ recordmydesktop myout.ogv


There is also a GTK frontend for recordmydesktop. To launch it:

$ gtk-recordMyDesktop

Written by Subhash Chandran

July 15th, 2009 at 4:00 am

Posted in Linux

Tagged with , ,

Encoding to Ogg Theora Format: For use in HTML5

without comments

To encode a video file for use in HTML5 video compatible browser (firefox 3.5 and above supports HTML5 video), use the command:

$ ffmpeg -i in.flv -vcodec libtheora -sameq \
   -acodec libvorbis -ac 2 -sameq out.ogg


Finally use it in your page:

<video src="out.ogg">
Your browser does not support HTML5 video.
</video>


Reference: HTML 5 <video> Tag.

Written by Subhash Chandran

July 14th, 2009 at 9:08 am

Posted in Software Dev

Tagged with , , , , ,

Video format conversion in Linux

without comments

To stream video content using Video View Portlet, I had to re-encode some videos to flv format. This is pretty simple in Linux:

$ mencoder -oac copy -ovc lavc -o out.flv in.avi


-oac means Output Audio Codec and -ovc means Output Video Codec. The various options for -oac:

copy no encoding, just streamcopy.
pcm Encode to uncompressed PCM.
mp3lame Encode to MP3 (using LAME).
lavc Encode with a libavcodec codec.

The options for -ovc:

copy no encoding, just streamcopy.
raw Encode to an arbitrary uncompressed format (use ’-vf format’ to select).
lavc Encode with a libavcodec codec.

Written by Subhash Chandran

June 24th, 2009 at 11:13 am

Posted in Linux

Tagged with , ,