Notices


Reply
Thread Tools
iliaden's Avatar
Posts: 267 | Thanked: 50 times | Joined on Feb 2008 @ Montreal, Canada
#51
off topic:
Originally Posted by josiahg777 View Post
The new Garnet VM supports mathLib so both easyCalc and spacetime should work now! I'm looking forward to trying them when I get home
I installed mathlib and spacetime on Garnet VM. DOES NOT WORK (well, it does, just there is no keyboard display, needed to enter everything (I need it mostly for calculus, so no derivatives, integrals, limits...))
 
Posts: 425 | Thanked: 132 times | Joined on Mar 2008 @ California
#52
Hmmmm sucks about spacetime.

And yeah that sounds pretty reasonable... I don't exactly know how to implement it in a particularly elegant way either... I've been programming for a little while but I've never touched UNIX before this attempt at a script... I think we're onto something here though. I'll touch up the script tomorrow, I've got studying to do tonight :/ But I think I can work your suggestions in pretty well.

One request though... Would it be possible for you to test it as it is right now with a bunch of videos and look for a specific error? I get an error "sh not found: <SECOND WORD OF MULTIPLE WORD FILENAME>" And I have no idea where it comes from. It seems to be reported BEFORE any of my code is invoked. Also, if anyone with more UNIX experience could look into it that'd be much appreciated

Thanks
__________________
Promises are like babies. Fun to make, but hard to deliver.

Warning: dates on calendar are closer than they appear.
 
iliaden's Avatar
Posts: 267 | Thanked: 50 times | Joined on Feb 2008 @ Montreal, Canada
#53
sorry, can't try this right now, will do a bit later (tomorrow most probably). just leave the script in the archive.
I do have a hunch though: if you have a filename, say "movie number 1.avi", with spaces, when you enter the path, it would look like:
"/path/to/clip/movie\ number\ 1.avi" the space character is entered as "\ ". could this be the problem?
 
Posts: 425 | Thanked: 132 times | Joined on Mar 2008 @ California
#54
"/path/to/clip/movie\ number\ 1.avi" the space character is entered as "\ ". could this be the problem?
I had originally had this thought too, but even when I'm careful about typing the file name in, and even when I use tab-completion to input the file name I still get the same error

I'll take a look at it tonight and hopefully post up a new version Many thanks for your interest and suggestions!!
__________________
Promises are like babies. Fun to make, but hard to deliver.

Warning: dates on calendar are closer than they appear.
 
Posts: 425 | Thanked: 132 times | Joined on Mar 2008 @ California
#55
Alrighty here we go

Download here then untar by
tar -xzvPf Mopt.tar

Changelog:

Modified script to make decisions based on bitrate as well as resolution
Gave proper credit to iliaden as one of the authors
__________________
Promises are like babies. Fun to make, but hard to deliver.

Warning: dates on calendar are closer than they appear.
 

The Following User Says Thank You to josiahg777 For This Useful Post:
iliaden's Avatar
Posts: 267 | Thanked: 50 times | Joined on Feb 2008 @ Montreal, Canada
#56
hi,

I don't really think that this credit is "proper". I didn't write any code myself (since I cannot post it on some site for everyone), so it's not the best idea. you could put me under "ideas contributions". And it would look nicer if you wrote my name, not the nickname: Ilia Denotkine. guess where the nick came from

Code:
 if [ $# -eq 0 ];
then
    echo -n Please enter the name of the file: 
    read NAME
else
    NAME=$1
fi
code looks good. just for me, to make sure: the file you enter would be with or without the path, and if without, is the default root, user folder or the path where you are?

Code:
if [ $FPS -lt 12 -o $BITRATE -lt 750 ]
then
    mplayer -quiet -framedrop "$NAME"
    exit 0
fi
not "mplayer -quiet -framedrop -noslices "$NAME""

next, the bitrate is in what, bytes or kilobytes per second?
Code:
if [ $BITRATE -lt 16000 ]
elif [ $BITRATE -lt 128000 ]
128mbps or 128kbps. one seems to be INCREDIBLY large, the other one extremely low. could you clarify this please?

and one last comment: the difference between -framedrop and -hardframedrop should be determined by the bitrate and/or fps, not the ORIGINAL resolution.
maybe it's better to write:
Code:
if $FPS -gt 25
    $FRAMEDROP="hardframedrop"
    REST OF THE CODE HERE (the optimizations you wrote, this "if" thus remains independent of the rest"
else 
    $FRAMEDROP="framedrop"
    REST OF THE CODE (or a simple goto would do the trick here in order not to rewrite)
fi
looks good?
 
Posts: 425 | Thanked: 132 times | Joined on Mar 2008 @ California
#57
Originally Posted by iliaden View Post
I don't really think that this credit is "proper". I didn't write any code myself (since I cannot post it on some site for everyone), so it's not the best idea. you could put me under "ideas contributions". And it would look nicer if you wrote my name, not the nickname: Ilia Denotkine. guess where the nick came from
I still believe It's proper You've contributed just as much to this as I have And my apologies for not putting in your full name, I had no way of accessing it or knowing it (The forum doesn't post it, I checked your profile before adding that line) but I'd be more than happy to change this in the next version

code looks good. just for me, to make sure: the file you enter would be with or without the path, and if without, is the default root, user folder or the path where you are?
The path that gets entered here is the same as if you had entered it on the command line and just gets passed to MPlayer in the end so an absolute path or a relative path will work equally well. The only difference is you do NOT have to escape space characters because it gets read as a full string

next, the bitrate is in what, bytes or kilobytes per second?
MPlayer reads video bitrate in bytes per second. Please suggest a better value, I'm absolutely clueless what bitrates to use as delimeters. I was actually following the "standard" bitrates from http://en.wikipedia.org/wiki/Bit_rate
for lack of a better reference :P

and one last comment: the difference between -framedrop and -hardframedrop should be determined by the bitrate and/or fps, not the ORIGINAL resolution.
maybe it's better to write:
Code:
if $FPS -gt 25
    $FRAMEDROP="hardframedrop"
    REST OF THE CODE HERE (the optimizations you wrote, this "if" thus remains independent of the rest"
else 
    $FRAMEDROP="framedrop"
    REST OF THE CODE (or a simple goto would do the trick here in order not to rewrite)
fi
looks good?
Yeah that sounds very reasonable, I'll make sure and change this in the next version... Although having been well disciplined by my CompSci professors I might have an allergic reaction to a "goto" statement lol I'll see what I can do with it.

With respect to the next version I'm going out of town this afternoon and I won't be home until late Saturday night so I'm probably not going to be able to work on this and I definitely won't be able to upload anything. I'll try and get the next version out by next Sunday afternoon though Sorry about that.

You're more than free to edit the code however you like, if you'll just email me the edited code I'd be more than happy to tar it up (or you can do it, either way) and host it on my webspace My email address is josiahgaskin@gmail.com I usually reply to email the same day, same with PMs in this forum.
__________________
Promises are like babies. Fun to make, but hard to deliver.

Warning: dates on calendar are closer than they appear.
 
Posts: 4,030 | Thanked: 1,633 times | Joined on Jul 2007 @ nd usa
#58
Crashed.

Report:
Opening /media/mmc1/Jsu.m4v ...
Video width is 640, video bitrate is 0, video fps is 29
MPlayer 1.0rc1-maemo.27.n8x0 (C) 2000-2006 MPlayer Team
CPU: ARM
Internet Tablet OS version: RX-34+RX-44_2008SE_2.2007.51-3_PR_MR0
Menu inited: /etc/mplayer/menu.conf

Playing /media/mmc1/Jsu.m4v.

Quicktime/MOV file format detected.
VIDEO: [avc1] 640x480 24bpp 29.970 fps 0.0 kbps ( 0.0 kbyte/s)
[omapfb] Nokia N800/N810 hardware detected
[omapfb] tearsync is enabled
================================================== ========================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
================================================== ========================
================================================== ========================
Trying to force audio codec driver family dspmp3...
Trying to force audio codec driver family libmad...
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) decoder)
================================================== ========================
[AO SDL] Samplerate: 44100Hz Channels: Stereo Format s16le
AO: [sdl] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [omapfb] 640x480 => 640x480 Planar YV12 [fs] [zoom]
[omapfb] ARM JIT scaler (quality=2): 640x480 YV12 => 640x480 YUV420
__________________________________________________ ___
...
Movie-Aspect is undefined - no prescaling applied.
VO: [omapfb] 640x480 => 640x480 Planar YV12 [fs] [zoom][omapfb] ARM JIT scaler (quality=2): 640x480 YV12 => 640x480 YUV420
process 1946: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace


MPlayer interrupted by signal 6 in module: stop_maemo_screensaver
- MPlayer crashed. This shouldn't happen.
It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
gcc version. If you think it's MPlayer's fault, please read
DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
won't help unless you provide this information when reporting a possible bug.
/usr/bin # mplayer-opt /media/mmc1/Jsu.m4v >/media/mmc1/mopt1.txt
[MENU] Can't open menu config file: /home/user/.mplayer/menu.conf
ISO: Unknown File Type Major Brand: M4V
process 1964: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace


MPlayer interrupted by signal 6 in module: stop_maemo_screensaver
- MPlayer crashed. This shouldn't happen.
It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
gcc version. If you think it's MPlayer's fault, please read
DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
won't help unless you provide this information when reporting a possible bug.



__________________________________________________ ___

Suggestions?


bun

Last edited by bunanson; 2008-06-09 at 02:39.
 
iliaden's Avatar
Posts: 267 | Thanked: 50 times | Joined on Feb 2008 @ Montreal, Canada
#59
@bunanson: well, analyze this logically:
1) the script (which I presume you have read) will simply output the "mplayer -noslices -framedrop /media/mmc1/Jsu.m4v", since the bitrate is 0. This narrows the problem down to MPlayer.
the fact that mplayer determined the bitrate to be 0 shows two possibilities: 1- mplayer is poorly written and 2- the file is somewhat corrupted.
Does this problem occur with every single file or just this one?

@josiahg777:
no optimization needed (based on a n8x0, OS2008, and no background, cpu-eating processes) for bitrate <650kbps (650000bps) here are my suggested values:
Code:
if [ $BITRATE -lt 650000 ]
then
	if [ $WIDTH -gt 800 ]
	then
	    FULL=1
            echo ...setting lowres ON, 1/2 resolution
    else
    	mplayer -quiet -framedrop -noslices "$NAME"
    	exit 0
    fi
else
	if [ $WIDTH -lt 800 ]
	then
		if [ $BITRATE -gt 65000 ]
		then 
			FULL=1
			echo ...setting lowres ON, 1/2 resolution
		elif [ $BITRATE -gt 1024000 ]
		then 
			FULL=2
			echo ...setting lowres ON, 1/4 resolution
		else
                        echo ...playing video with original resolution
			mplayer -quiet -framedrop -noslices "$NAME"
		fi
	else
		if [ $WIDTH -gt `expr 4 \\* $MAX_WIDTH` -o $BITRATE -gt 3000000 ]
		then 
		    FULL=3
		    echo ...setting lowres ON, 1/8 resolution
		elif [ $WIDTH -gt `expr 2 \\* $MAX_WIDTH` -o $BITRATE -gt 1024000 ]
		then
		    FULL=2
		    echo ... setting lowres ON, 1/4 resolution
		elif [ $WIDTH -gt $MAX_WIDTH -o $BITRATE -gt 650000 ]
		then
		    FULL=1
		    echo ... setting lowres ON, 1/2 resolution
		else 
		    FULL=0
		    FAST=""
		    echo ... setting lowres OFF
		fi
	fi
fi
to e certain no lag occurs, the values of all the bitrates could be 50000 lower, but the values I entered seem good.
you agree?

Ilia
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#60
I'm subscribing here because this seems to be where the exciting developments in smooth video playback on the N800 are happening! Now to bundle this up into a gui so the user doesn't need to see all of this. Perhaps you could use pipeline's dbus-switchboard hack so you can run your script when the user clicks on any video file in Filemanager.

EDIT: Fixed link. Sorry!
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!

Last edited by qole; 2008-06-12 at 00:12.
 
Reply


 
Forum Jump


All times are GMT. The time now is 19:29.