Home Forums Gallery FAQs Downloads
 
 

Go Back   Meizu Me > General > Video and Imaging

Register Today!  

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 General category; I have created a bash script for linux to convert 1 or more videos with mencoder. You can even give ...



Reply
 
Thread Tools Display Modes
Old 02-07-2007   #1
parena
Guest
 
Posts: n/a
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.
  Reply With Quote
Old 02-07-2007   #2
Freshman
 
Join Date: Dec 2006
Posts: 34
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 ...
scaglifr nincs online   Reply With Quote
Old 02-07-2007   #3
parena
Guest
 
Posts: n/a
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.
  Reply With Quote
Old 02-07-2007   #4
Freshman
 
Join Date: Dec 2006
Posts: 34
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 ? )
scaglifr nincs online   Reply With Quote
Old 02-09-2007   #5
parena
Guest
 
Posts: n/a
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.
  Reply With Quote
Old 02-09-2007   #6
Freshman
 
Join Date: Dec 2006
Posts: 34
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)
scaglifr nincs online   Reply With Quote
Old 02-09-2007   #7
parena
Guest
 
Posts: n/a
Quite odd... I'd go take a look at the support forums for your distribution if I were you.
  Reply With Quote
Old 03-24-2008   #8
Passing By
 
Join Date: Mar 2008
Posts: 3
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!
yørn nincs online   Reply With Quote
Old 09-30-2008   #9
Valued Member
 
mbarry's Avatar
 
Join Date: Jun 2007
Posts: 1,124
Thnks a lot, I bet many Linux users will be praising you for this.
mbarry nincs online   Reply With Quote
Old 11-06-2008   #10
Freshman
 
Furo's Avatar
 
Join Date: Oct 2007
Posts: 35
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.
Furo nincs online   Reply With Quote
Reply


Thread Tools
Display Modes

Hot Deals for Meizu & Related Products Related Threads
All times are GMT. The time now is 08:46 PM.







   
 
Meizu Me is an independent resource for all things Meizu. All rights reserved. Powered by vBulletin. Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. Meizu M8, miniPlayer and all related names are properties of MEIZU Electronic Technology, Inc. Copyright 2008 Meizu Me.