+ Reply to Thread
Results 1 to 10 of 10

Bash script for conversion under Linux

This is a discussion on Bash script for conversion under Linux within the Video and Imaging forums, part of the miniPlayer M6 / SL category; I have created a bash script for linux to convert 1 or more videos with mencoder. You can even give ...

  1. #1
    parena
    Guest

    bash script to convert 1 or multiple videos :)

    I have created a bash script for linux to convert 1 or more videos with mencoder. You can even give the video bitrate, minutes per video part and target directory. The minutes per video part defaults to 20, because of the audio out of sync issue. So if you have a movie of 1 hour, 30 minutes, meizu_prepare will convert that to 4 parts of 20 minutes and 1 part of 10 minutes. All the information is here.

    It has worked great for me, I have converted short and long movies. There is one small issue, sometimes, for no appearant reason at all, meizu doesn't understand part of the file and locks up (it happens at the exact same spot every time you play the file, unless you're able to fast forward passed it). mplayer can read that file flawlessly, though. Happened to me only twice, but I don't know what causes this.

    Anyway, hopefully you'll find it useful.

  2. #2
    Freshman
    Join Date
    Dec 2006
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by parena View Post
    I have created a bash script for linux to convert 1 or more videos with mencoder. You can even give the video bitrate, minutes per video part and target directory. The minutes per video part defaults to 20, because of the audio out of sync issue. So if you have a movie of 1 hour, 30 minutes, meizu_prepare will convert that to 4 parts of 20 minutes and 1 part of 10 minutes. All the information is here.

    It has worked great for me, I have converted short and long movies. There is one small issue, sometimes, for no appearant reason at all, meizu doesn't understand part of the file and locks up (it happens at the exact same spot every time you play the file, unless you're able to fast forward passed it). mplayer can read that file flawlessly, though. Happened to me only twice, but I don't know what causes this.

    Anyway, hopefully you'll find it useful.

    Hi,

    Under SUSE 10 I get the following errors

    ~> meizu_prepare -targetdir /home/fgs/miniplayer/ /audio-visual/tron.avi

    results in

    Storing videos in /home/fgs/miniplayer/ ...

    Can't open joystick device /dev/input/js0: No such file or directory
    Can't init input joystick
    mplayer: could not connect to socket
    mplayer: Connection refused
    Failed to open LIRC support. You will not be able to use your remote control.

    Splitting /audio-visual/tron.avi into 5 parts:

    12:58:16 Encoding part 1/5: /audio-visual/tron_1.avi at 0:00:00
    12:58:16 Encoding part 2/5: /audio-visual/tron_2.avi at 0:20:00
    12:58:16 Encoding part 3/5: /audio-visual/tron_3.avi at 0:40:00
    12:58:16 Encoding part 4/5: /audio-visual/tron_4.avi at 0:60:00
    12:58:16 Encoding part 5/5: /audio-visual/tron_5.avi at 1:20:00
    12:58:16 Encoding finished ...

  3. #3
    parena
    Guest
    Quote Originally Posted by scaglifr View Post
    ~> meizu_prepare -targetdir /home/fgs/miniplayer/ /audio-visual/tron.avi

    results in

    Storing videos in /home/fgs/miniplayer/ ...

    Can't open joystick device /dev/input/js0: No such file or directory
    Can't init input joystick
    mplayer: could not connect to socket
    mplayer: Connection refused
    Failed to open LIRC support. You will not be able to use your remote control.

    Splitting /audio-visual/tron.avi into 5 parts:

    12:58:16 Encoding part 1/5: /audio-visual/tron_1.avi at 0:00:00
    12:58:16 Encoding part 2/5: /audio-visual/tron_2.avi at 0:20:00
    This was caused by the full /audio-visual/tron.avi path (I got different, weird errors as well). The target file would become /home/fgs/miniplayer//audio-visual/tron_1.avi etc. You can now download the new version where this is fixed.

  4. #4
    Freshman
    Join Date
    Dec 2006
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I found that if you copy the source file into the cwd then all works fine. Interestingly when hal mounted under the linux the M6 reports that it is full (even though konq shows the separate folders inside it adding up to only 3G) whereas when mounted on a winxp machine the free 1G is recognised. I suspect ?file system problem (Does fat32/16 use inodes ? )

  5. #5
    parena
    Guest
    Quote Originally Posted by scaglifr View Post
    I found that if you copy the source file into the cwd then all works fine.
    Yep, that's what I found out as well (or just cd the the source file's dir), which is why I updated the script.

    The available space thing I don't get. Over here it works correctly.

  6. #6
    Freshman
    Join Date
    Dec 2006
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by parena View Post
    Yep, that's what I found out as well (or just cd the the source file's dir), which is why I updated the script.

    The available space thing I don't get. Over here it works correctly.

    The available space thing is interesting because it _was_ working fine and I cannot see what has changed on either the linux machine or the (?) M6. I tend to apt-get upgrade quite frequently so am assuming that there is a new bug in something. The roblem I have is finding out how to troubleshoot it. Individual file sizes on the M6 are reported correctly in linux but all folders are shown to be of the same size (weather 20 megs or 2 gigs)

  7. #7
    parena
    Guest
    Quite odd... I'd go take a look at the support forums for your distribution if I were you.

  8. #8
    Passing By
    Join Date
    Mar 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The script works quite well for me, with most files.
    Some video files can be converted well with the script, as in, when I view the resulting files, they appear to be rotated and have the right width/height, but when I try to view them on my Meizu, the device crashes (black screen, some files paint a green line in the upper right edge) and I have to reboot it by holding play for 20 seconds.
    Does anyone have any idea how that's possible? Thank you!

  9. #9
    Valued Member
    Join Date
    Jun 2007
    Posts
    1,476
    Thanks
    21
    Thanked 14 Times in 11 Posts
    Thnks a lot, I bet many Linux users will be praising you for this.
    If you are having trouble with your player, please visit this thread first and try the steps before you panic. Most likely you will be able to fix your player easily using the steps listed.

    Players: Meizu M6 SP 4GB, iPod Touch 4G
    Headphones: SoundMAGIC PL-50s, Auvio In-Ear Armatures, Bose QC-15s.
    Current Audio Congifuration: X-Fi Elite Pro w/LM4562 Mod -> Mission MS-50 + Boston Acoustics Subwoofer


  10. #10
    Freshman
    Join Date
    Oct 2007
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey, I used your script to make a small frontend (really basic) for mencoder.
    You can download it here.
    It's in french but the text is useless. It's a first version, I will improve it with more possibilities like framerate or other things. It's designed for people who start under Linux and aren't terminal friends. I will put an english version when I improve it.


 

Similar Threads

  1. Encodage video sous linux
    By quatrecouleurs in forum French
    Replies: 4
    Last Post: 04-19-2008, 09:12 AM
  2. My Theme Linux Redhat
    By leoriohunter in forum Modifications and Skins
    Replies: 2
    Last Post: 02-04-2007, 01:26 PM
  3. Avidemux / Linux
    By scaglifr in forum Video and Imaging
    Replies: 1
    Last Post: 02-01-2007, 02:30 PM
  4. Ubuntu Linux Theme
    By Austin in forum Modifications and Skins
    Replies: 2
    Last Post: 12-31-2006, 06:01 AM
  5. video conversion on Linux Problem
    By barc in forum Video and Imaging
    Replies: 3
    Last Post: 12-05-2006, 09:57 PM