android
  #1  
Old 03-18-2007, 08:12 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default Batch Video Transcoder for Linux/Unix System

Hello all:

I have written a batch transcoder script for Linux/Unix systems. Please test it out to see if it works for you.

Requirements

(1) MEncoder compiled with LAME support

Features

(1) Batch convert a list of files passed to the script. Widecards are allowed.

(2) Automatically skip non-video files.

(3) Use LAME MP3 for audio track.

(4) Parameters can be fine tuned by editing the variables at the top of the file.

Usage

(1) Place files to be transcoded in a writable directory

(2) Run:

sansampeg <list_of files>

or

sansampeg *

To see a brief help message, you can use:

sansampeg -h

or

sansampeg --help

(4) The transcoded file will be place in the same directory with the original filename, but with a mpg extension.

Charles
Attached Files
File Type: zip sansampeg.zip (1.1 KB, 223 views)

Last edited by cpchan; 07-11-2007 at 08:24 PM.
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 03-19-2007, 08:41 AM
BeatTakeshi BeatTakeshi is offline
Junior Member
 
Join Date: Mar 2007
Posts: 1
Default

Hi.

Would love to test / use your script.
Seems like something went wrong with the attachment to the post, could you reattach it?

Thanks a lot!
Reply With Quote

  #3  
Old 03-19-2007, 11:26 AM
xandl12's Avatar
xandl12 xandl12 is offline
Junior Member
 
Join Date: Oct 2006
Location: Austria
Posts: 67
Default

Script works fine... thank you!

Just one Problem when there is i.e. a "." in the filename.. then it cuts the filname at this point!
Reply With Quote

  #4  
Old 03-19-2007, 04:34 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by xandl12 View Post
Script works fine... thank you!

Just one Problem when there is i.e. a "." in the filename.. then it cuts the filname at this point!
I know, I have to improve the file renaming logic. Thanks for the input.

Charles
Reply With Quote

  #5  
Old 03-19-2007, 04:36 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by BeatTakeshi View Post
Seems like something went wrong with the attachment to the post, could you reattach it?
What system are you on? Which shell are you using? What problems do you have?

Charles
Reply With Quote

  #6  
Old 03-19-2007, 07:08 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Here is a new beta version of sansampeg. Please test it out.

Changelog

Improve file renaming logic. Now the script can handle input file names with multiple periods. The periods are replaced with underscores for Rockbox.

Charles
Attached Files
File Type: zip sansampeg.zip (1.1 KB, 42 views)
Reply With Quote

  #7  
Old 03-20-2007, 06:27 AM
xandl12's Avatar
xandl12 xandl12 is offline
Junior Member
 
Join Date: Oct 2006
Location: Austria
Posts: 67
Default

Quote:
Originally Posted by cpchan View Post
Here is a new beta version of sansampeg. Please test it out.

Changelog

Improve file renaming logic. Now the script can handle input file names with multiple periods. The periods are replaced with underscores for Rockbox.

Charles
Hi!

Thanks for the new script!
Now there are Problems when using " " in i.e the folder name...
But good work!
btw. ... is there a reason why you are using exactly 469 for vid_bitrate.

xandl12
Reply With Quote

  #8  
Old 03-20-2007, 08:15 AM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by xandl12 View Post
Thanks for the new script!
No problem, I wrote it for myself, but I thought it would be useful for other people.

Quote:
Now there are Problems when using " " in i.e the folder name...
OK, fixed- I missed out on a couple of quotes. Also, in order to use wildcards on the commandline when there is a space, you must escape it:

http://www.tuxfiles.org/linuxhelp/weirdchars.html

For example, if the files are located in a subdirectory called "sansa videos" under you home directory do:

sansampeg ~/sansa\ videos/*

This is why it is generally frowned upon in the Linux/Unix world to use space in file/directory names. Most people either use an underscore or period as a substitute.

Quote:
btw. ... is there a reason why you are using exactly 469 for vid_bitrate.
Because this seem to be the recommended bitrate for 4:3 videos for the Sansa on the Rockbox wiki:

http://www.rockbox.org/twiki/bin/vie...uginMpegplayer

Charles
Attached Files
File Type: zip sansampeg.zip (1.1 KB, 96 views)
Reply With Quote

  #9  
Old 03-20-2007, 08:42 AM
xandl12's Avatar
xandl12 xandl12 is offline
Junior Member
 
Join Date: Oct 2006
Location: Austria
Posts: 67
Default

Quote:
Originally Posted by cpchan View Post
http://www.tuxfiles.org/linuxhelp/weirdchars.html

For example, if the files are located in a subdirectory called "sansa videos" under you home directory do:

sansampeg ~/sansa\ videos/*

This is why it is generally frowned upon in the Linux/Unix world to use space in file/directory names. Most people either use an underscore or period as a substitute.
Charles
Yes I knew. I'm using Linux for some years right now ... and this was not really a problem(except to others ;-) ).


Quote:
Because this seem to be the recommended bitrate for 4:3 videos for the Sansa on the Rockbox wiki:

http://www.rockbox.org/twiki/bin/vie...uginMpegplayer
I was just asking, because my videos did not work with the latest build.... but it seems that mpegplayerplugin is broken right now(just buffering all the time)


and Yeah ... your script works perfectly now

xandl12
Reply With Quote

  #10  
Old 03-20-2007, 04:01 PM
jimbolaya jimbolaya is offline
Junior Member
 
Join Date: Mar 2007
Posts: 4
Default

I can't get the attached script. Instead of a download link I see "Could not find phrase 'error_postcount_too_low_attachment'." What does that mean?
Reply With Quote

  #11  
Old 03-20-2007, 04:50 PM
testdasi's Avatar
testdasi testdasi is offline
Member
 
Join Date: Oct 2006
Location: Providence, RI
Posts: 432
Default

You need more than 10 posts to be able to attach files, I think.
Reply With Quote

  #12  
Old 03-20-2007, 06:53 PM
jimbolaya jimbolaya is offline
Junior Member
 
Join Date: Mar 2007
Posts: 4
Default

Thanks, but I'm not trying to attach a file. I can't download the attached zip file. Instead of a download link I see "Could not find phrase 'error_postcount_too_low_attachment'."
Reply With Quote

  #13  
Old 03-20-2007, 08:00 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by jimbolaya View Post
I can't download the attached zip file. Instead of a download link I see "Could not find phrase 'error_postcount_too_low_attachment'."
I think you need more than 10 posts to be able to download attachments.

Charles
Reply With Quote

  #14  
Old 09-23-2007, 12:40 PM
varior varior is offline
Junior Member
 
Join Date: Oct 2006
Posts: 1
Default

Hi,

Thanks for your Batch.

It doesn't run properly with mkv files. Mime type is Application.
I modified the batch to skip the control on the mime type for mkv and the encoding process starts.
Line 64 : Added
Code:
-o $file_ext = "mkv"
VaRioR
Reply With Quote

  #15  
Old 09-23-2007, 01:21 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by varior View Post
Thanks for your Batch.
No problem.

Quote:
It doesn't run properly with mkv files. Mime type is Application.
I modified the batch to skip the control on the mime type for mkv and the encoding process starts.
Line 64 : Added
Code:
-o $file_ext = "mkv"
Thanks, I will add it to the script. Please keep me informed if you encounter more exceptions. Enjoy the script.

Charles
Reply With Quote

  #16  
Old 10-02-2007, 12:01 AM
helacus helacus is offline
Junior Member
 
Join Date: Oct 2007
Posts: 7
Default

ive downloaded the script, but what to do from there im am completely lost. i have ubuntu fiesty, and i would really like to have videos on my sansa. thanks a bunch!
Reply With Quote

  #17  
Old 10-02-2007, 07:55 AM
kugel's Avatar
kugel kugel is offline
Rockbox Developer
 
Join Date: Dec 2006
Location: Berlin, Germany
Posts: 1,153
Default

I have Super installed, can I use the MEncoder integrated in Super to use this?
__________________
;;
Reply With Quote

  #18  
Old 10-07-2007, 04:55 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by helacus View Post
ive downloaded the script, but what to do from there im am completely lost. i have ubuntu fiesty, and i would really like to have videos on my sansa. thanks a bunch!
What do you mean? The script is very easy to use- just put your videos in a directory and run:

Code:
sansampeg *
(You will need mencoder installed). For a list of options used the usual "-h" or "--help" switches.

Charles
Reply With Quote

  #19  
Old 10-07-2007, 05:04 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by kugel View Post
I have Super installed, can I use the MEncoder integrated in Super to use this?
If mencoder is a separate program you should be able to use it. However, since you are using Windows, you also need to obtain a Windows version of the Unix "file" program:

http://www.darwinsys.com/file/


Charles
Reply With Quote

  #20  
Old 10-14-2007, 08:49 AM
pienose pienose is offline
Member
 
Join Date: Mar 2007
Posts: 358
Default

Iv'e just downloaded this (and ubuntu) and can't seem to get it to work this is what I did-
I have a file named eyecandy.3gp in /home/tim/videos

put the file in /home/tim/.sansampg
then I ran sansampeg </home/tim/videos/eyecandy.3gp>
I got the responce-
bash: syntax error near unexpected token `newline'
wtf does this mean?

Thanks

P.S: sorry for n00b question, not good with ubuntu yet
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 08:55 PM.