Author Topic: Encoding Videos For Zaurus  (Read 20565 times)

nilch

  • Hero Member
  • *****
  • Posts: 668
    • View Profile
    • http://
Encoding Videos For Zaurus
« Reply #30 on: November 01, 2006, 10:37:54 am »
Quote
It's been a while since I posted my first encoding video for the Zaurus script, so here's an updated Version 2 of it. Enjoy.

Please post any suggestions for improvements. I'm still learning how to write bash scripts, so there's bound to be room for improvement.  Version 3 will allow for encoding multiple files.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=134633\"][{POST_SNAPBACK}][/a][/div]

I lost this thread here ... tell me, is this all doable on the Zaurus, or is it just video encoding for the Zaurus on the desktop ?

I would love to have some script which can encode single to 2-3 files on my zaurus which I copy from the internet without knowing if its codecs will be supported by Kino or not.

Having a mass batch encoder like what the thread discusses later on, on the desktop for overnight runs is also a good idea but naturally limited to the desktop.

Sorry guys, not much idea about video encoding hence the incomprehension about basic facts  
« Last Edit: November 01, 2006, 10:38:51 am by nilch »
New no more-C1000 / 5000D (sold my 6000 and 750) | Cacko ROM 1.23 on C1000 | 256 MB CF | 2GB PNY SD card | Socket Networker WiFi CF Card | USB Host cable from StreamlineCPUS | Mini Microphone (for voice recording) |

vrejakti

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://www.animecharactersdatabase.com
Encoding Videos For Zaurus
« Reply #31 on: November 01, 2006, 11:24:02 am »
You're right about this thread being all over the place.  To answer your question, I always assumed the encoding would be done on a desktop, mainly because computer resources greatly affect the time to encode a video. It is still possible to encode on the Zaurus, if you have the mencoder package installed.

I have seen a mencoder package for the Zaurus, though I'm sorry I don't have a link.

vrejakti

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://www.animecharactersdatabase.com
Encoding Videos For Zaurus
« Reply #32 on: November 01, 2006, 07:02:15 pm »
Quote
any particular reason for zsh? i try hard to keep my dependencies down to bash
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]
Here's the issue I had when using /bin/bash or /bin/ksh

Code: [Select]
debian% ls
[S^M] Galaxy Ange-lune 04 RAW.avi
debian% ./script.sh
File not found: '[S^M]'
Failed to open [S^M].
zsh seems to be the only shell that can properly pass complex file names in variables to mencoder. Personally, I use whatever works. At some point, I may even try doing this same script in perl or C - just for heck of it.

Edit: After thinking about it, you raise a very good point. I assume a lot more people have access to bash than zsh, so I changed my newest release to use #!/bin/bash by default, leaving the end user the option to change it to use #!/bin/zsh if needed for complex file name issues.

I've tried a lot of solutions to file names. From using a long script of sed replacement commands, to saving files to a text file and greping each line, as well as quoting, double quoting, and single quoting. zsh works for now.

Keep up the good work on your script Da_Blitz. I'm looking forward to seeing your next release. I still think the scripts we're working on are very useful. Not many people have the time to read the mplayer man pages to learn how to write a profile for their needs, that's why scripts that simplify or automate the proccess are still useful, I think.




Here's my latest script
[a href=\"http://www.lan358.com/scripts/vrecoder-3.65.txt]View script online as text.[/url]
Download script.

Notes on features.
Using -e smartcoder tells the script to automagically seek out any video files in the current directory and encode them for Zaurus Playback.

Experimental auto-resolution calculation tries to guess a correct 4:3 resolution for you when scaling the video.

Selecting "op" when asked "Start encoding? [Yes/No/op]" will allow you to encode the first hh:mm:ss of a video. It's good for catching opening themes from anime.
« Last Edit: November 01, 2006, 10:32:48 pm by vrejakti »

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
Encoding Videos For Zaurus
« Reply #33 on: November 01, 2006, 09:27:41 pm »
Quote
Quote
any particular reason for zsh? i try hard to keep my dependencies down to bash
[div align=\"right\"][a href=\"index.php?act=findpost&pid=145298\"][{POST_SNAPBACK}][/a][/div]
Here's the issue I had when using /bin/bash or /bin/ksh

Code: [Select]
debian% ls
[S^M] Galaxy Ange-lune 04 RAW.avi
debian% ./script.sh
File not found: '[S^M]'
Failed to open [S^M].
zsh seems to be the only shell that can properly pass complex file names in variables to mencoder. Personally, I use whatever works. At some point, I may even try doing this same script in perl or C - just for heck of it.

I've tried a lot of solutions to file names. From using a long script of sed replacement commands, to saving files to a text file and greping each line, as well as quoting, double quoting, and single quoting. zsh works for now.[div align=\"right\"][a href=\"index.php?act=findpost&pid=145338\"][{POST_SNAPBACK}][/a][/div]

You should be able to just quote the variable, for example:

Code: [Select]
mencoder "$F"Admittedly I've never used zsh, but I've yet to find anything that couldn't be accomplished with bash or korn . HTH
GROG!

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Encoding Videos For Zaurus
« Reply #34 on: November 01, 2006, 09:53:20 pm »
well the problem that you are getting is related to spaces in the file name, it is wierd that double quoting dosent work (single qoutes dont allow for varible expansion )

i would think that
Code: [Select]
mencoder "$IN" -ovc lavc -lavcopts debug=0:vcodec=mpeg4:vbitrate=300:vpass=1 -vf scale=$WIDTH:$HEIGHT -oac copy -o $OUT
#--------------------
mencoder "$IN" -ovc lavc -lavcopts debug=0:vcodec=mpeg4:vbitrate=300:vpass=2 -vf scale=$WIDTH:$HEIGHT -oac copy -o $OUT

should become
Code: [Select]
mencoder "$IN" -ovc lavc -lavcopts debug=0:vcodec=mpeg4:vbitrate=300:vpass=1 -vf scale=$WIDTH:$HEIGHT -oac copy -o "$OUT"
#--------------------
mencoder "$IN" -ovc lavc -lavcopts debug=0:vcodec=mpeg4:vbitrate=300:vpass=2 -vf scale=$WIDTH:$HEIGHT -oac copy -o "$OUT"

and just magiacally work ($OUT to "$OUT")

anyway back to my ones, perosnally i wanted to have my script done by now so i could focus on coming up with the encoding reipies that work best for the Z, its a shame that i havent gotten to that stage yet

i use Zsh all the time for its contextual auto compleation however there are some features (or bugs) that i dont like so i have been considering making an ncurses shell that is interactive only (ie not for scripting) as i feel bash is more than adequte for that. the advantage of using ncurses is that its easy to extend to dual monitor support (which i have) and helps take care of resizing. instead of the zsh autocemplete with filnames that shifts everything up and leaves it that way when it disappears (anoying when you needed the history) i am thinking of a popup window that slides form the bottom upwards moving the content up as well. when it disappears the content slides down to its originol postion as well

its somthing i am working on as well as a small 100 liner copy and paste deamon (how do you like bieng able to go cat $FILE | copy in one shell and paste | xargs "ls -l" in another ) or an enviroment deamon that makes sure that any varible you export (ie export PATH) gets automatically synced across all open shell instances instantlly (i used to have problems when i had 10+ xterms open with diffrent states of exported varibles, sucks when trying to cross compile) designed at getting the user firendlyness of the cmd line up to desktop standards
« Last Edit: November 01, 2006, 09:55:35 pm by Da_Blitz »
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

vrejakti

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://www.animecharactersdatabase.com
Encoding Videos For Zaurus
« Reply #35 on: November 01, 2006, 10:29:54 pm »
It would be nice if quoting was the solution---(rant cut short)

Da_Blitz, grog, your suggestions worked! Thanks! It really was as simple as quoting "$IN". Looks like zsh won't be needed after all.

I must have offset the quoting of my variables somewhere in previous scripts causing that type of quoting not to work, but it works as it should now.

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Encoding Videos For Zaurus
« Reply #36 on: November 02, 2006, 06:29:31 am »
it happens, the most common problem is the null argument () where one uses test or [ with a varible and forgets to qoute it, when a vaible gets passed to it it spits out a "wrong number of args" error and quits causing many headaces or when used with strins compares the first and second word because people forget that spaces seperate args

it happens and you learn to qoute all your varibles because it dosent hurt and gets rid of a problem or two

leasons learned the hard way  funny thing is its probelly a bug in zsh that made it work
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware