Showing posts with label convert. Show all posts
Showing posts with label convert. Show all posts

18 August, 2010

New Phone

Well ladies (and gentlmen),
I've moved into the 21st century and replaced my old cell phone with a smart phone. Really wasn't too much of a question when selecting as my criteria was an Android-based phone. Settled in on the Samsung Galaxy and couldn't be much happier. The only issue I've noticed is the wireless doesn't work for 802.11N and haven't had a chance to get it to connect to our wireless router at home.

Anyway....I figured I'd play with converting videos for the phone, the intent of this post. As always, FFMpeg is our tool:


$ ffmpeg -i ./Tosh-001.mpg -s qcif -vcodec h263 -ac 1 -ar 8000 -r 25 -ab 12.2k -y outputfile.3gp


Mount the phone, copy in the output file, unmount and play through the gallery. Easy-peezy.

26 February, 2009

Extracting Raw Video Stream with Ffmpeg

We utilize raw, uncompressed video streams as input to sensor related video processing. Normally, our camera streams are captured directly from the camera source and stored in raw, uncompressed data file (no header or codec). Lately, we've found it useful to extract uncompressed streams from standard video file formats. Here's how:


$ ffmpeg -i ./VideoIn.avi -f rawvideo -pix_fmt gray /tmp/video.raw


This will convert the video stream to 8-bit grayscale and store it in a raw WxH stream, which you can play with:


$ mplayer -demuxer rawvideo -rawvideo w=640:h=352:y8 /tmp/video.raw


Note, the 640x352 image resolution was outputted as part of the ffmpeg extraction command, without the resolution you'll have more trouble viewing the video than 15 minutes of "The View".

Enjoy.

06 February, 2009

Have You Named Your Pipe?

I am the proud owner of a 13lb Series 2 Tivo. I'm also a Linux advocate leaving it a matter of time before figuring out how to download and playback Tivo shows.

TivoDecode provides the means of converting the Tivo Mpeg-4 video format to a good 'ole fashion Mpeg-4. Then you can play the converted file back with your favorite video player.

TivoDecode operates pretty straightforward, you specify the input file and the MAK key of your Tivo (which is embedded in the TiVo file). If you specify an output file the decrypted video is stored in said output file.

This works pretty well, but as a side-effect you are essentially duplicating the source Tivo file which can be quite large.

I just recently found an alternative to creating this temporary file, created solely to provide to the video player.

Named pipes act just like a file and can be used to stream the output of one application as input to another. They are created by the mkfifo command and removed with the rm command (just like a regular file). Using them, you can go from this:

$ tivodecode --mak=1234567890 ./Desktop/NCIS.TiVo -o /tmp/video.mpg
$ mplayer /tmp/video.mpg

to this:

$ mkfifo /tmp/pipe.0
$ mplayer /tmp/pipe.0 &
$ tivodecode --mak=1234567890 ./Desktop/NCIS.TiVo -o /tmp/pipe.0
$ rm /tmp/pipe.0


BTW, I found this info by what I'd consider an unexpected site....mainly a Mac guy! No disrespect, but this is the first time I've made use of Mac info...OSX is a flavor of BSD so it was just a matter of time.

Take a look, I thought it was quite useful.