Fansite and Forum for Meizu Products
 
       



Go Back   Meizu Me > General > Video and Imaging

Bash script for conversion under Linux

Video and Imaging

Reply
 
Thread Tools Display Modes
Old 02-07-2007   #1 (permalink)
parena
 
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 (permalink)
Freshman scaglifr is on a distinguished road
 
Join Date: Dec 2006
Posts: 34
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 ...
scaglifr is offline   Reply With Quote
Old 02-07-2007   #3 (permalink)
parena
 
Posts: n/a
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.
  Reply With Quote
Old 02-07-2007   #4 (permalink)
Freshman scaglifr is on a distinguished road
 
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 is offline   Reply With Quote
Old 02-09-2007   #5 (permalink)
parena
 
Posts: n/a
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.
  Reply With Quote
Old 02-09-2007   #6 (permalink)
Freshman scaglifr is on a distinguished road
 
Join Date: Dec 2006
Posts: 34
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)
scaglifr is offline   Reply With Quote
Old 02-09-2007   #7 (permalink)
parena
 
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 (permalink)
Passing By yørn is on a distinguished road
 
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 is offline   Reply With Quote
Old 09-30-2008   #9 (permalink)
Valued Member mbarry will become famous soon enough
 
mbarry's Avatar
 
Join Date: Jun 2007
Posts: 1,003
Thnks a lot, I bet many Linux users will be praising you for this.
mbarry is offline   Reply With Quote
Old 3 Weeks Ago   #10 (permalink)
Freshman Furo is on a distinguished road
 
Furo's Avatar
 
Join Date: Oct 2007
Posts: 33
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 is offline   Reply With Quote
Reply


Thread Tools
Display Modes


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

All times are GMT. The time now is 11:58 PM.


Powered by vBulletin. Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0 ©2007, Crawlability, Inc.
 
Meizu Me is an independent resource for all things Meizu. Meizu, Mini Player, Music Card, Mini One and all other related names are properties of MEIZU Electronic Technology, Inc. Designed by ForumTemplates. All content © 2007 MeizuMe. All Rights Reserved.