![]() |
Re: Request: TCPMP
Quote:
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 :) Oh and thanks for the mplayer line! I no longer miss TCPMP :P I bundled it into a quick dirty shell-script that I'll post as soon as I get home :) It's kind of a work in progress but it works :) |
Re: Request: TCPMP
Okay, here we go :)
Download, remove the ".txt" from the end, drop it in /usr/bin and chmod +x it :) This script when called by mplayer-opt <FILENAME> will read the size of the video and choose the appropriate low-res for it. It will then echo what resolution it chose and then call mplayer with the the optomized flags (-hardframedrop -noslices etc). It's a work in progress and I plan on adding options to it and maybe some better optomizations if I can find them. It's also my first shell script ever so any feedback/corrections/suggestions are more than welcome! EDIT: UPDATE AVAILABLE, SCROLL DOWN |
Re: Request: TCPMP
good idea; has a few small [or maybe crucial] problems:
1) you measure the video by the width ONLY. usually the problems occur not only due to the resolution, but also due to the bitrate and the amount of complete image changes per time (fast-paced action). 2) just for me: Code:
-lavdopts "$FAST"lowres="$FULL" 3) Code:
mplayer -really-quiet -noslices -hardframedrop -lavdopts "$FAST"lowres="$FULL" -vo omapfb "$NAME" Code:
-vo omapfb is this really necessary? I never had any problems with the video decoder, and I thought that MPlayer usually choses optimally... 4) Code:
if [ $WIDTH -gt 1600 ] oh, and one last thing: Quote:
|
Re: Request: TCPMP
Quote:
HTH, Andrew |
Re: Request: TCPMP
Quote:
Quote:
Quote:
Feel free to suggest a better sliding scale :) Quote:
Code:
/ID_VIDEO_BITRATE/ { print substr( $0, 18, length($0) ) Quote:
EDIT: I also read in the video's FPS but I don't currently do anything with it. What should I do with it? Quote:
Okay, here's version 0.2: mplayer-opt I updated the link in the previous post as well. I really need to learn about debian packaging so I can bundle this into an installable .deb |
Re: Request: TCPMP
I ran it on xterm, /bin/ash: illegal option -
? n810/2008OS bun |
Re: Request: TCPMP
Crap! That'll teach me to upload stuff at one in the morning. Sorry about that, I fixed the error :) It should work fine now :)
|
Re: Request: TCPMP
For some reason, I can only copy your script and make one out of it. Your link does not seem to be able to dl, or, even worst, I do not know how to dl from your link :)
I redl/rerun again, and this time...........same error. Sorry, bun |
Re: Request: TCPMP
EDIT: Okay try this one: mplayer-opt
Download and run: tar -xzvPf Mopt.tar on it :) Then: cd /usr/bin chmod +x mplayer-opt FIXED: Unfortunately it's my server's problem :( I don't own the webspace directly, I sublease it from one of my friends so I don't have permission to fix it. Try right clicking on it and selecting "Save as" ? |
Re: Request: TCPMP
I believe that in the code you are using, FPS should not matter.
I experimented a bit with -framedrop and -hardframedrop, while keeping an eye on the original FPS. here's what I got: - on low bitrate videos, all FPS play well, and all the slightest lags can be removed by -framedrop. - on high bitrate videos: 1) -framedrop increases performance, reducing the lag, but not always entirely 2) -harframedrop reduces the lag even further, but OFTEN screws up colors, by keeping the previous ones. now, concerning FPS: unless the video has been anyhow converted, It's between 27 and 30 FPS. MPlayer -quiet -framedrop would play all of those videos, with the bitrate < 900kbps without any problem. The problem only occurs with the videos with actions scenes, with a larger amount of key frames (those that need to be loaded entirely, not just the modifications to the previous scene). I have no clue how to determine this in a file, specially if it's only a small segment of it. The theoretical ideal would be that the mplayer parameters would change in the middle of the clip, but this IS impossible. my suggestion (made at 7 am, might be crazy): - if the video has already been somehow converted (i.e. framerate < 12 fps), just run mplayer -quiet -framedrop file - if the video has not yet been converted: - check bitrate. if < 750 bps, "mplayer -quiet -framedrop" if 750 > < 900, look at resolution. if width > 530, add lowres=1 if width < 530, "mplayer -quiet -framedrop" if > 900, look at resolution. if width > 800, add lowres, depending on bitrate if width < 800, use lowres=1|2, depending on bitrate. this idea sounds to create quite a long code, yet I can't yet figure out how to place a cycle, since the requirements are different for each step. anyways, does this idea sounds to optimize something? Ilia |
Re: Request: TCPMP
off topic:
Quote:
|
Re: Request: TCPMP
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 :) |
Re: Request: TCPMP
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? |
Re: Request: TCPMP
Quote:
I'll take a look at it tonight and hopefully post up a new version :) Many thanks for your interest and suggestions!! |
Re: Request: TCPMP
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 |
Re: Request: TCPMP
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 ]; Code:
if [ $FPS -lt 12 -o $BITRATE -lt 750 ] next, the bitrate is in what, bytes or kilobytes per second? Code:
if [ $BITRATE -lt 16000 ] 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 |
Re: Request: TCPMP
Quote:
Quote:
Quote:
for lack of a better reference :P Quote:
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. |
Re: Request: TCPMP
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 |
Re: Request: TCPMP
@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 ] you agree? Ilia |
Re: Request: TCPMP
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! |
Re: Request: TCPMP
Thanks, this is a very interesting idea.
I will make sure this is added to the final release, but not until then. I think it's better to concentrate on the script itself first, and only then go for the gui. However, the method you offered has a slight problem: most people would just run their videos through a media player. I, myself, am not quite familiar with the MPlayer package built for maemo, but I do know it has a gui. Could you point to the file to be modified in order for the gui to launch "mplayer-opt FILE" instead of "mplayer FILE". I believe this would be the most convenient for a common end user. @josiahg777 I [just] found this [by following the provided link and by adding the "h" to http]: Quote:
And I made a few updates, and removed an impossible if situation, so this script should be version 4 (yet I don't have any hosting sites ). Changelog: 1) added a "-o" and "--original" option: bypass the script. this could be useful to compare the modifications with the original. 2) corrected the bitrate values 3) added the "hardframedrop" for files with FPS > 25 4) corrected authors' names 5) modified echo returns Here it is: Code:
#! /bin/sh -f |
Re: Request: TCPMP
I finally tried your script (v 0.4) tonight. I pasted from your message into a file I named /usr/bin/optmplayer
The file was a half-hour TV show. I did not record it or transcode it. I used tab completion on a file name with spaces, so it automatically backslash-escaped the name. Let's say the name was "Your Big Video File.avi", so it was displayed on the command line as Your \Big \Video \File.avi I got two errors immediately: Quote:
Quote:
spits out three errors, Quote:
(The bitrate seems ridiculously high (1240984), especially since the file plays with only a few stutters without optimization, and MPlayer itself later says it is 1108.3 kbps (135.3 kbyte/s). Also, when I play the file normally, the mplayer output includes all of that information, almost instantly, on the terminal right after it says "AVI file format detected". Is there any way to play 1 second of the file and capture and parse that output from MPlayer?) I then get an error: Quote:
Ironically, the output still stutters a bit. |
Re: Request: TCPMP
Hi,
just woke up, so give me 10 minutes to figure it all out. first: Quote:
Quote:
Quote:
if [$FPS -gt 25] , while it should be if [ $FPS -gt 25] just corrected it in the precious post. Quote:
|
Re: Request: TCPMP
On my most recent flight, I was almost entirely unable to hear dialogue on videos in canola even with earphones in. Hell, it was difficult to hear them even in the concourse.
|
Re: Request: TCPMP
@ midwinter:
I tried the -softvol-max 1000 on my n800. No success. Can anyone copy this, or is this a problem with my device? |
Re: Request: TCPMP
Hey Guys :)
I'm back with fast internet at last! Looks like some good stuff has happened while I've been gone! Thanks iliaden! I'll try your revised version tonight and mod it if necessary and host it up, oh and i'll also try the volume thing out |
Re: Request: TCPMP
@ Josiah:
the -softvol-max filter was taken from the mplayer man page. It does not seem to work with the internet tablets. Also, I will rewrite the first part of the script to make it better for the arguments. This would mean I will change from "if the first argument is..." to "if ANY argument is..." the only way I see doing this is a loop, going from 1 to $#. anyone can suggest a more elegant way? If so, please do in the next 6-7 hours, since it is then that I will rewrite the script. oh, and a thought just crossed my mind: would it be reasonable to start a new thread for this script, or should we just continue here, although it isn't [anymore] related to TCPMP. the only relation that still exists is that we're trying to implement most of tcpmp's features in one script. |
Re: Request: TCPMP
Hmmm I think by this time a new thread would be appropriate... Although the script really is still an Alpha product but if we make that clear to people then it should be fine.
And I believe that that's the best way to do it (looking at command line arguments)... Although, don't be too quick to take my word for it, I know next to nothing about shell scripting and I've only been able to come this far through the help of hours of google searches |
Re: Request: TCPMP
the softvol-max parameter does work on the tablet. I think you have to use two extra parameters, "-softvol=yes" and maybe "-ao=sdl".
See these two threads. If you start a new thread, maybe post a link to it from this thread. ALSO: Is there any way to arbitrarily resize a video, or are you forced to halve or quarter the size? |
Re: Request: TCPMP
thanks for the help (the "-softvol=yes" part mainly)
Quote:
I will look for an[other] way to keep the best video display under 100% cpu usage, but due to a lack of ideas, I am trying to make this manner the most optimal. |
Re: Request: TCPMP
Quote:
And yes, mplayer lets you set the x/width value, and then it will set the y/height value according to the aspect ratio, or you can do it the other way around, or you can set the x and the y and ignore the aspect ratio to stretch the video any way you want. It's a very versatile program. But as iliaden mentioned this takes far more CPU than pixel doubling or quadrupling which is hardware accelerated. On this note, I'm wondering if we should put in a feature that comes from the other end? For a really low resolution video could we call mplayer's built-in deinterlacing/postprocessing functions perhaps? EDIT: I'm hoping to post up a new version with iliaden's changes tonight, my apologies for the wait |
Re: Request: TCPMP
I was thinking that you could always resize to 240 height x whatever width and then pixel-double it. The problem with simply halving the resolution is that if the resolution is less than 480 high, the halved resolution will be very low, and that looks noticeably ugly. But if you aim for 240 high, then the video will always be exactly doubled, and that looks fine.
|
Re: Request: TCPMP
Pipeline has a much more robust mime-handler system in this thread. He started a new thread and I didn't notice. This is why it is important to put a forwarding address at the end of the old thread when you're starting a new one!
|
Re: Request: TCPMP
Okay, the new version is hosted, sorry it took me so long.
Instructions are as before: Download: Mopt.tar Untar with tar -zxvPf Mopt.tar Then make executable: chmod +x /usr/bin/mplayer-opt This version is identical to the last one iliaden posted, I'm really sorry I haven't been able to make any changes, my schedule is kind of hectic right now. TODO: --FIX: Script now crashes if not given a filename as a command line paramenter --ADD: Support needed for post-processing low-res videos --ADD: mime-handling needed |
Re: Request: TCPMP
Sorry guys, I'm a bit busy these days. I will have time to work on this only starting sunday... sorry for not being able to help much right now.
TODO (added): - ADD: parameters to work if entered in any order (not just the first one) [working on it... almost done!] - ADD: parameter to define output resolution (both halved, quartered, or arbitrary) [I will do it] - ADD: GUI (anyone ???) - ADD: *.deb installer packaging |
Re: Request: TCPMP
I'll see what I can do about deb packaging... I've been meaning to learn about that :P
And do we really need a GUI? Maybe so... I'll take a look at the source for the existing Mplayer GUI and see if we can maybe make it point to mplayer-opt instead. I think I'll have some time for these two tomorrow, but I can't make any promises :D |
Re: Request: TCPMP
Quote:
|
Re: Request: TCPMP
Status update:
FIXED: Script will not crash anymore if it is invoked without any arguments Added: I had forgotten to add a test to see whether or not the video file actually exists. This is now handled more elegantly. Still working on: I'm (slowly) learning PyPackager, but the generated .deb it created for me won't install due to an "Incompatible application package" error. Grrr... I'll work on this later tonight or tomorrow, I need a break. So, all this said and done, I'll upload an updated version by tomorrow night :) |
Re: Request: TCPMP
quick update (for me)
Quote:
2: I'm going to my brother's after prom. If I am alive sunday, I will post a new part of the script. otherwise, my alcohol system would be cleared of blood... |
Re: Request: TCPMP
Quote:
(or whatever the equivalent is, I use dh_make/debhelper and dpkg-buildpackage in scratchbox) |
All times are GMT. The time now is 00:28. |
vBulletin® Version 3.8.8