Help - Search - Members - Calendar
Full Version: Adventures In Tv Encoding For The Z
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
Xumbi
I have a goal of being able to encode any TV shows into a format that I can play on my Zaurus. Here are the results of my quest thus far:

So I have an HDTV DVR from Comcast at home (and I work for them), and I read that you can use the firewire output to record (unencrypted) content to a PC (the guide that I followed is here).

It works, but the files it creates are huge "transport stream" video files (a half hour Family Guy episode took up 1.6GB!). These "transport stream" files seem difficult to manipulate. All the guides I found for windows software wouldn't work. Eventually I came accross FFMpeg for Linux, which is able to read and re-encode these files into mpeg/avi format.

Here is the command I've been using to create video that plays on my Z:

CODE
ffmpeg -i video.ts -f avi -vcodec mpeg4 -b 300 -g 300 -bf 2 -deinterlace -s 320x240 -croptop 2 -acodec mp2 -ar 22050 -ab 96 -ac 1 video.avi

This creates a video at about 3 to 4 mb/min that plays well with mplayer (actually I wrote a script for mplayer, I'll post it if anyone is interested). This is all well and good, but the files it creates are a tad big for my taste (almost 100MB for a half hour show).

I know very little about encoding video, but I know I followed some guides a while back to rip DVDs into DivX format for the Z, and they turned out to be around 1 to 2 mb/min, and they looked much better than these videos. Also, I was watching the CPU load, and it's right up around 90% when watching these videos, which seems high.

So at this point I'm looking for anyone with ideas on how to use FFMpeg, and maybe a DivX encoding program, to lower the size and raise the quality of these videos, if possible.

Hopefully this will spark some interest in encoding TV signals for the Z, which as far as I know hasn't come up yet.
fastscirocco
This site: http://www.videohelp.com/ has tons of information and forums on video editing and authoring.

I highly recommend you do some research there, maybe post what your is and I'm sure you will find your answer there.

I have used TMPGEnc 3.0 XPress on my windows box for video editing/conversion. If you can get it from that proprietary format to an avi or mpeg I'm sure you can shrink it with TMPGEnc 3.0 XPress.

HTH

ps I'll do a test with TMPGEnc 3.0 XPress and see how big a 2 hour movie is at 320x240
fastscirocco
found Pocket Divx Encoder here:
http://www.videohelp.com/tools?tool=661#comments

"Pocket Divx Encoder allows you to encode any video clip with optimized parameters for handled devices (landscape mode, 240x320, low CPU usage, increased brightness, ...).The 2 video output standards (.ogm ou .avi) are playable on the 2 famous DivX players under PocketPC : PocketMVP and betaplayer"

------------

I also read here:
http://www.videohelp.com/forum/viewtopic.php?t=257678

"Also the Beta versions of VideoReDo can open .ts files and save them as mpeg files."

This is the link for VideoReDo

http://www.videohelp.com/tools?tool=VideoReDo

Now as an FYI, my brother converted a 30 minute show toplay on his Ipaq at the same resolution using Windows Media Encoder, it was ~ 200 mb. So I think you can get a better video to play, but shrinking the size probably isn't going to happen.

HTH
philo
http://www.doom9.org is a great site for video stuff.

philo
Sna
hello,
just for fun, why do you record the movie on your pc? why not stream directly the output on the network, it is very possible with vlc and a linux server, i make it at home
Xumbi
Thanks for the replies. I checked out the Pocket Divx Encoder, it works very well. I took a .ts video (the Daily Show), converted it to .avi with ffmpeg in linux, but this time I used a high video and audio bitrate. Then I went back into windows and ran Pocket Divx Encoder, played around with a bunch of the settings, and now I have decent looking video with 44100/64kbs audio, and the entire 30 minute show is 76MB.

However, I occasionally download Call for Help videos from here, which are ~45min, and their file sizes are about the same as my 30min video. These videos are 320x240, 44100/64kbs, and they play perfectly on my Z. Now I just have to find out how these videos are being encoded...

My ultimate goal is to be able to encode videos in real time in linux from my firewire cable. As it is, I'm re-encoding twice, and rebooting three times, which sucks.

QUOTE(Sna @ Mar 2 2005, 04:00 AM)
hello,
just for fun, why do you record the movie on your pc? why not stream directly the output on the network, it is very possible with vlc and a linux server, i make it at home
*

I've thought about it, but I don't really need to watch TV live on my Z (although it would be really cool). Right now I just want to get the recording/encoding thing down.
arniel
Hi,
I have a UK DVB-T setup (digital terrestrial) which records .mpg files.
To convert to the Z, I use ProjectX to demux and cut out adverts (most importantly for me it also maintains sync of the signal even when it breaks up).
The .mp2 audio file is converted to Ogg format using OagMachine, currently experimenting with a 24k sample rate @ 57kbps, normalisation to 100%.
VirtualDubMod is used to remux the video and audio streams.
Filters are:
1. deinterlace (blend)
2a. (for anamorphic streams): resize to 320x180
2b. (for fullscreen): resize to 320x240
Full processing mode recompress the video stream using DivX 5.2 to 350kbps, with high postprocessing and psychovisual enhancement.
Write to an .ogm file.
I'm not sure, but in mplayer I think ogg decoding is faster than mp2 or mp3, and it is possible to get away with a lower bitrate for similar quality.
dreadlocks
using the code Xumbi posted I just re-encoded an episode of the daily show I downloaded via bittorrent and the resulting file was 62Mb

nice find, ive been wanting to do this.. now to setup some scripts to auto-encode em at like 6am and then sync it with my zaurus.. so when I head out the door in the morning for class I already have the previous nights ep loaded and ready for viewing at discression.

this is definatly worth more attention, I know im going to be playing with encoding my tv shows for my Z for the next few weeks.
fastscirocco
Well I'm glad I could help everyone out.

My problem is evidently m Z c3000 can't play AVI files.....any ideas?
I currently have to make mpeg iv files, and well...they're kind of big.

I'd prever to use this PocketDivXEncoder but can't play the avi file, hmmmm does anyone know if the movie player that ocmes with the C3000 can play OGM files?

Any thoughts!
dreadlocks
ok so I have been playing arround and got quality like xumbi's at a much smaller size..

CODE
mencoder the.daily.show.03.09.05.avi -srate 24000 -vf scale=320:240,eq2=1.0:0.6:0.1:0.7 -o the.daily.show-mobile.avi -oac mp3lame -lameopts preset=64:mode=3 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=150 -ofps 15 -sws 2


I stole the line from http://www.cs.unc.edu/~hensley/zaurus/encode.html where he does a good job of explaining each option.. His default sound quality is really bad so I uped it to a 64bit stream. I added my own pice to it, the "eq2=1.0:0.6:0.1:0.7" part cranks up the contrast so its not so dark on my Zaurus (looks washed out on my monitor tho). You will need to RTFM if you want to tweak that more.

The results were like this:
62M tds-ffmpeg.avi (xumbi's output)
35M tds-mencoder.avi (hensley's output)
176M the.daily.show.03.09.05.avi (original input)

im still playin with it, its kinda choppy on my 5600 so im looking for a way to lighten the load on mplayer
dreadlocks
ok so I have been playing arround with this all weekend and I think I finally found a great balance of quality and size for encoding on the zaurus.

First of all, if you are looking for a GUI to do this for you in linux I have been using Kmenc15, its pretty crude but it has made it easier to tweak this. Here is my template for kmenc15 0.03. Just open the file you want to encode then load my template and press 'encode'. http://www.nayr.net/zaurus/zaurus-tv.kmt.bz2

I intend on scripting this so being able to run this from command line is handy, here is how to do the exact same thing w/out the gui.

CODE
mencoder -of avi -ofps 15 -sws 10 -vf eq=10:-50,scale=320:-2::: -ovc lavc -lavcopts vcodec=mpeg4:vme=4:autoaspect:mbd=1:vbitrate=150:vpass=1 -oac copy source.avi -loadidx -o /dev/null
mencoder -of avi -ofps 15 -sws 10 -vf eq=10:-50,scale=320:-2::: -ovc lavc -lavcopts vcodec=mpeg4:vme=4:autoaspect:mbd=1:vbitrate=150:vpass=2 source.avi -loadidx -o output.avi -oac mp3lame -lameopts preset=radio


using these options I get 2Mb for every 1min of recording, my 22min episode of the daily show ended up being 44Mb, the quality is quite good.. much better than my previous attempts and the size is exactly what I was shooting for. I know I can make it much smaller, but I my goal was 1 hour of quality video on a 128M card. You should be able to encode dvd's onto a 256M but I havent tried it.

Something else to add is the contrast and brighness are tweaked, if you play the file on your computer the image will look washed out.. however it looks fine on my zaurus and I can watch it with ease with the backlight at half brightness.

on my 5600 the video plays pretty smoothly, its choppy when the camera is paning or zooming but only slightly.. I havent found any way to eliminate this completly yet but I have reduced it quite a bit by running 2 passes.

Want to see an example? Here is a very short clip (30s), watch it on your Zaurus.
http://www.nayr.net/zaurus/test.avi

Hope someone finds this usefull
-Ryan
Wolfie_Fox
Command & Conquer Red Alert, Red Alert 2 and Tiberian Sun are all low cpu and graphic games, I would love to play a C&C game on my Z.

C&C seems to be quite an open source game, apart from and new versions of the game which need uber 3D cards.


PLEASE DELETE THIS POST, IT WENT IN THE WRONG TOPIC mad.gif mad.gif mad.gif
Xumbi
Way to go dreadlocks! I'm glad other people are working on this.

Just like you, I found mencoder shortly after I made this thread, and I've been playing around with it a lot. Here's what I've come up with so far:

CODE
mencoder movie.in -ovc xvid -xvidencopts qpel:hq_ac:vhq=2:max_bframes=2:quant_type=h263:trellis:bitrate=350 -vop expand=320:240,pp=hb/vb/dr,eq=15,scale=320:-2,hqdn3d=8:6:12 -sws 2 -ofps 15 -oac mp3lame -lameopts vbr=3:br=64:mode=3 -o movie.out

This makes a file ~2-2.5MB/min that looks really good. I played around with 2 pass encodings too, but I never really noticed a difference in the quality.

In my search I also came across this site. I think it's run by someone on these boards. He has a script called createogm that works well making ogm files. I think the quality is a little low though, and I don't like that it uses stereo sound (I don't see the need to use twice the space for stereo when mono sounds fine on the Z, I'd rather use that space for better video quality). You can play around with the bitrates and make it look better, but for some reason if I changed the sound to mono it got all screwed up.

At this point I realize that ffmpeg isn't worth using, mencoder is far superior. The videos it creates are smaller and higher quality (with the right settings), and the CPU usage on my Z is below 50% when I play them.

Oh yeah, I wanted to explain how to get mencoder working for those who might not know. You'll need lame installed first if you want to use mp3 for the audio (as much as I love ogg, I've always had video/audio sync problems when I use it for videos). First you need mplayer (mencoder is included). Either get the package for your distribution on the mplayer site (site might not be up for long, they're protesting the European software patents issue), compile it on your own (which is a pain in my opinion), or if you run Debian like me, add the sources from http://hpisi.nerim.net/ to your sources.conf and run apt-get install mplayer w32codecs.
Cresho
have you guys compared your video results to mine? i just jumped on to the mencoder bandwagon under windows and then gona test it under linux as soon as i get everything i want running on my handheld

current output of the process i use is

I am using vidomi and my tutorial is here- http://home.earthlink.net/~cresho/


2 types here:
best results and in sync even fastforwarding or rewinding
video:320x240divx3@29fps
audio:128kbps stereo


okay video but awfull audio since i plug my z into creative portable speakers but sounds good on z
i can reduce to
320x240divx3 20fps
audio:32kbps mono

there is a video i outputed but its the low quality version...
http://webpages.charter.net/cresho/

any suggestions on the win version? I just started and i got my first result using this code which was okay but not good enough

QUOTE
mencoder.exe "C:\Hardware Wars.mpg" -srate 44100 -vop scale=320:240 -o Hardware Warsavi -oac mp3lame -lameopts preset=15:mode=3 -ovc lavc -lavcopts vcodec=msmpeg4 -ofps 15 -sws 2
adf
avidemux2 works beautifully, and has a simple gui (linux)
vdub in windows might work.

I tried the mencoder scripting route....great, but I spent more time tweaking scrits than anything else.
equal results can be had faster in avidemux2. does vlc not play ogm?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2016 Invision Power Services, Inc.