Notices


Reply
Thread Tools
grog's Avatar
Posts: 546 | Thanked: 85 times | Joined on Feb 2008 @ Winnipeg, Canada
#21
Haven't had much time to try many other methods, but I have been playing around with tablet-encode & mencoder directly. I found that tablet-encode's n900 preset still uses a DIVX codec (according to midentify's output, ID_VIDEO_CODEC=ffodivx), so while it seems to work, to me it's still not optimal.

As far as mencoder goes I've come up with several different one-liners, two of which I've included here:

Code:
time mencoder "$INPUT" -o "$OUTPUT" -vf scale -xy 800 -ofps 23.976 -srate 44100 -of mpeg -oac faac -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1447

time mencoder "$INPUT" -o "$OUTPUT" -vf scale -xy 800 -ofps 23.976 -srate 44100 -of mpeg -oac faac -ovc lavc -lavcopts vcodec=libx264:vbitrate=1447
While both of these come close, neither seem to hit the mark. The 'vcodec=mpeg4' still seems to use the divx codec, while the 'vcodec=libx264' isn't very playable.

I thought about trying the specialized Handbrake setting from the Video Encoding wiki, but I'm really looking for a CLI method & HandbrakeCLI can't use custom presets. So to use that I'd need to "translate" it.

Any tips? TX
__________________
GROG!
N900 | ZAGG Body Armour | 16Gb A-DATA micro-sd
N810 | 2 x Patriot 8gb mini-SD | Boxwave Crystal Clear SS | Black Aluminum case | OTG dongle
N800 | 2 x 8gb OCX SD | Boxwave Anti-glare SS | PDAir book-style case
Holux M-1200 bluetooth GPS | iGo 4-row bluetooth keyboard | Linksys USB 10/100 ethernet | Plantronics Voyager 855 BT Headset
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#22
For Linux Users:
Well, after a little over a week now I've been trying to find a good solution for video encoding with X264. HandBrake does decent, especially using the preset from the Wiki, and I did find a good HandbrakeCLI one that worked decent as well - unfortunately handbrake didn't handle the audio properly on a lot of my BluRay/720p sources.

Tablet-encode did well, and using mencoder directly with mpeg4 did well, but I couldn't get the settings just right for x264 to play decent in the built-in player.

I've finally ended up with this script, it rips the video in a 2 pass 2000 bitrate using x264 directly, then the audio using a tool from here.

I've found that encoding at -crf 19 produces ~2200 bitrate and is playable, but once in a while the poor processor just can't decode fast enough and it skips a little. 2300+ is simply unplayable, the video is too slow. 2100 works, but for some random reason every movie I've watched at that will just stop and reset at some point during the movie. I can then restart the movie, go back to where I was and finish it without a problem.

So 2000 seems to work good enough, and is the same that tablet-encode uses. Because this is x264 vs tablet-encode's mpeg4 - you should find that the filesizes are slightly smaller than tablet-encode's without losing any quality.

I had to add some sleeps in here otherwise mplayer would give me a video decoder error every once in a while. I think it just needs to buffer into the FIFO for a second or two.

Code:
#!/bin/bash
for video in "$@"; do
        name="${video##*/}"
        name=${name%.*}
        fps=`mplayer -identify -ao null -vo null -endpos 2 "$1" | grep ID_ | grep ID_VIDEO_FPS | uniq | cut -d'=' -f 2`
        mkfifo "$name.y4m"
        nohup mplayer "$video" -nosound -benchmark -vo yuv4mpeg:file="$name.y4m" -sws 9 -vf dsize=800:480:0,scale=0:0,expand=800:480,dsize=15/9 2>&1 &
        sleep 4
        x264 --profile baseline --level 3 --no-cabac --partitions p8x8,b8x8,i4x4 --me umh --subme 7 --threads auto --no-fast-pskip --output "$name.264" "$name.y4m" --pass 1 --bitrate 2000
        sleep 2
        nohup mplayer "$video" -nosound -benchmark -vo yuv4mpeg:file="$name.y4m" -sws 9 -vf dsize=800:480:0,scale=0:0,expand=800:480,dsize=15/9 2>&1 &
        sleep 4
        x264 --profile baseline --level 3 --no-cabac --partitions p8x8,b8x8,i4x4 --me umh --subme 7 --threads auto --no-fast-pskip --output "$name.264" "$name.y4m" --pass 2 --bitrate 2000
        mkfifo "$name.wav"
        neroAacEnc -ignorelength -lc -q 0.5 -if "$name.wav" -of audio.mp4 2>nero.log & mplayer -nocorrect-pts -vo null -vc null -ao pcm:file="$name.wav":fast "$video"
        MP4Box -fps $fps -add "$name.264" -add audio.mp4 "$name.mp4"
        #`which mkvmerge` -D "audio.mp4" -A "$name.264" -o "$name.mkv"
        rm -f *.{log,y4m,264,wav,mbtree}
        rm -f audio.mp4 nohup.out
done
It will do batch operation, use it with:

Code:
./scriptname Video Video2 Video3 Video4
I'll keep this updated as I make changes.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!

Last edited by fatalsaint; 2010-05-16 at 20:17.
 

The Following 4 Users Say Thank You to fatalsaint For This Useful Post:
Posts: 25 | Thanked: 4 times | Joined on Jan 2010 @ Belfast
#23
heres some guidelines for settings

this will give you playable smooth bitrate in default media player (maybe smoother with oss media server in km player)


[codec_id]
CODEC_ID_AAC
[codec_longname]
libfaac AAC (Advanced Audio Codec)
[codec_type]
Audio
[codec_bitratemin]
24
[codec_bitratemax]
320
[codec_bitrates]
[codec_resolutions]
[codec_framerates]
[codec_samplerates]
32000
44100
[codec_channelsmin]
0
[codec_channelsmax]
2
[codec_id]
CODEC_ID_H264
[codec_longname]
libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[codec_type]
Video
[codec_bitratemin]
100
[codec_bitratemax]
2000
[codec_bitrates]
[codec_resolutions]
800x480 maximum
[codec_framerates]
5
10
12
15
23,976023976024
24
25
29,97002997003
[codec_samplerates]
32000
44100
48000
[codec_channelsmin]
0
[codec_channelsmax]
0
[1088_hack]
True
[vbv_buffer]
2000
[max_bitrate]
2000
[level]
30
[cabac]
True
[MaxRefs]
4
[DisableHighPartitions]
True
[MaxBFrames]
0
[BPyramidMode]
0
[WeightedPPred]
0
[DoAutoDeint]
True
[DoAutoDetele]
True
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#24
Ahh, maxbitrate 2000.. that makes sense now .
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,467 times | Joined on Jan 2010 @ Australia Mate
#25
Originally Posted by squee666 View Post
heres some guidelines for settings

this will give you playable smooth bitrate in default media player (maybe smoother with oss media server in km player)
where do you set this????? thanks
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#26
Originally Posted by f2thak View Post
where do you set this????? thanks
That looks like a dump of all possible codecs, bitrates, etc. that the N900 will play.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 
seiichiro0185's Avatar
Posts: 270 | Thanked: 610 times | Joined on Nov 2007 @ Leipzig/Germany
#27
hey there, I recently wrote a python script for converting videos to a N900-friendly format. It uses mencoder and MP4Box to produce mp4 files with h264 video and aac audio. It can handle styled subtitles like ssa (e.g. to encode fansubbed anime) and does automatically calculate the video resolution according to the aspect ratio. Also main parameters like video/audio bitrate are setable via commandline. If you want to give it a try have a look here: n900-encode.py on my website.
__________________
N800 -> N810 -> N900 -> N9 -> Jolla & TOHKBD -> Jolla C -> Xperia X -> XA2 Plus Dual Sim

http://www.seiichiro0185.org
 

The Following 2 Users Say Thank You to seiichiro0185 For This Useful Post:
grog's Avatar
Posts: 546 | Thanked: 85 times | Joined on Feb 2008 @ Winnipeg, Canada
#28
I've been using Hanbrake with the specialized Handbrake setting from the Video Encoding wiki, and while the results are good, I've become disillusioned with Mediaplayer's lack of finer controls (skip 2 minutes, skip 10 minutes, easy pause, chapter control, etc). I have several instructional videos that I'm using & I've purposely encoded them using DIVX so I can play them using mplayer via SiB, just because of mplayer keyboard controls make jumping back-n-forth much easier. Seemingly only advantages I see for me encoding videos with h264 is that it's much less processor & thus battery intensive & the M4V container can handle chapters.

Am I correct about Mediaplayer or is there something I'm missing? Are there any other video players that can play h264 videos?

TX
__________________
GROG!
N900 | ZAGG Body Armour | 16Gb A-DATA micro-sd
N810 | 2 x Patriot 8gb mini-SD | Boxwave Crystal Clear SS | Black Aluminum case | OTG dongle
N800 | 2 x 8gb OCX SD | Boxwave Anti-glare SS | PDAir book-style case
Holux M-1200 bluetooth GPS | iGo 4-row bluetooth keyboard | Linksys USB 10/100 ethernet | Plantronics Voyager 855 BT Headset
 
grog's Avatar
Posts: 546 | Thanked: 85 times | Joined on Feb 2008 @ Winnipeg, Canada
#29
Originally Posted by grog View Post
(ramblings of a loose mind)
Not to be daunted by the obvious lack of interest in my disjointed delusional ramblings, I'll continue on my merry way with yet another barrage of senseless drivel to fill the empty void of what otherwise might have been a riveting & useful piece of information that everyone on this auspicious forum might have discussed for generations to come had I not stumbled upon the unsuspecting white-space & totally obliterated it .

I've started using tablet-encode again with the 'n900' quality setting instead of Handbrake & I've been quite happy. I did notice something that I found confusing.though. Playing a video via Media Player (MP) produced by the previously mentioned Handbrake baseline encoding (h264) the CPU usage of mafw-dbus-wrapper process averages around 25-30%, BUT the same video converted to DIVX via tablet-encode played via MP only uses around 15-20% CPU . Playing the same DIVX file via mplayer clocks the CPU to about 50% or so, which is what I'd expect.

Why does MP seem to handle the DIVX file better than the h264?

GROG Signing off.
TX
__________________
GROG!
N900 | ZAGG Body Armour | 16Gb A-DATA micro-sd
N810 | 2 x Patriot 8gb mini-SD | Boxwave Crystal Clear SS | Black Aluminum case | OTG dongle
N800 | 2 x 8gb OCX SD | Boxwave Anti-glare SS | PDAir book-style case
Holux M-1200 bluetooth GPS | iGo 4-row bluetooth keyboard | Linksys USB 10/100 ethernet | Plantronics Voyager 855 BT Headset
 
Jack6428's Avatar
Posts: 635 | Thanked: 282 times | Joined on Sep 2009 @ Black Mesa Research Facility
#30
I personally don't convert anything for the N900, because everything plays. But when I want to watch 720p and 1080p content, I convert it with these settings:

Video:
Codec: Xvid Mpeg4
Video Size: 800x480/720x400
Video Bitrate kb/s: 3000
Video Framerate fps: 25


Audio:
Codec: MP3
Sample Rate (Hz) : 48000
Audio Channel: 2, Stereo
Audio Bitrate kb/s: 192


Very good results if you want to watch HD content on the N900. Looks very detailed.

The software I use is Xilisoft Video Converter Ultimate 6
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:46.