Hi,

Since you've mentioned mplayer in your last two e-mails, but you are still using a _very_ old release, i can't help mentioning that mplayer from openwrt-packages is now hardware accelerated, thanks to David. So you really should consider upgrading.

On Tue, 23 Aug 2011, Hans Bezemer wrote:

Hi!

If someone is interested, I hacked together a small 4tH script that you feed a
filename and the display resolution (width, height) of a movie and it figures
out which FFMPEG command you have to give to get an Jlime MPlayer compatible
movie.

MPEG2 streams allow for anamorphic display, that means the display on the
screen is different from the actual resolution. Of couse, you get a letterbox
that way, but it won't be distorted.

If I'm courageous I can feed the resulting string to 4tHs SYSTEM library which
means it starts and executes FFMPEG as well. If we get that far it won't be
difficult to make a native executable out of it, so you don't even have to
install 4tH.

Hans Bezemer

---8<---
\ ffmpeg -i Bladerunner.m4v -ac 1 -ar 22050 -s 320x132
\ -padbottom 54 -padtop 54 -aspect 4:3 Bladerunner.mpg

char . constant '.'                    \ a dot character
512 constant /command                  \ size of command line
/command string command                \ allocate command line

: number? args number error? ;         ( n1 -- n2 f)
: odd? dup 1 and ;                     ( n -- n f)
: +one? if 1+ then ;                   ( n f -- n+1)
: -one? if 1- then ;                   ( n f -- n-1)
: +string command +place ;             ( a n --)
: +number <# #s #> +string ;           ( n -- )
: basename begin dup while 2dup 1- chars + c@ '.' <> while 1- repeat ;
: usage argn 4 < abort" Usage: nanocalc filename width height" ;

: margins                              ( n --)
 dup odd? >r
 s"  -padbottom " +string r@ -one? +number
 s"  -padtop "    +string r> +one? +number
;
                                      ( n --)
: padding? dup if margins else drop then ;

: calculate                            ( -- n1 n2)
 240 3200000
 2 number? abort" Invalid width" /
 3 number? abort" Invalid height" * 10000 /
;

: compose                              ( n1 n2 -- a n3)
 command >r s" ffmpeg -i " r@ place
 1 args +string s"  -ac 1 -ar 22050 -s 320x" +string
 odd? +one? dup +number - 2/ padding? s"  -aspect 4:3 " +string
 1 args basename +string s" mpg" +string r> count
;

: nanocalc usage calculate compose ;

nanocalc type cr
---8<---

--
Absolutely no trees were killed to produce this sig. Well, OK, we had to tie
one up and torture it. That's it.

Visit our website! http://thebeez.home.xs4all.nl/4tH/

*** Home of the 4tH compiler! ***

_______________________________________________
Qi Hardware Discussion List
Mail to list (members only): [email protected]
Subscribe or Unsubscribe: 
http://lists.en.qi-hardware.com/mailman/listinfo/discussion


_______________________________________________
Qi Hardware Discussion List
Mail to list (members only): [email protected]
Subscribe or Unsubscribe: 
http://lists.en.qi-hardware.com/mailman/listinfo/discussion

Reply via email to