+ Reply to Thread
Results 1 to 20 of 51
Linux script for mencoder.
This is a discussion on Linux script for mencoder. within the Video and Imaging forums, part of the miniPlayer M6 / SL category; Ok i got something going. I'm using Ubuntu Egdy. Install mencoder if you haven't already. Debian/Ubuntu: Code: sudo apt-get install ...
-
03-19-2007 #1Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 PostsLinux script for mencoder.
Ok i got something going.
I'm using Ubuntu Egdy.
Install mencoder if you haven't already.
Debian/Ubuntu:
In the command line type: I use nano as a text editor. Change it to your favorite editor:Code:sudo apt-get install mencoder
This will open a text editor and create the file meizu-convert in /usr/bin.Code:sudo nano /usr/bin/meizu-convert
Put the following code in the text editor. Make sure you change mencoder path so that it points to it. And also set the output path.:
Save your document and exit. Now we must allow the script to execute.Code:#!/bin/bash #This script uses mencoder to convert movies to a playable AVI format for the MEIZU M6 mencoder=/usr/bin/mencoder outputpath=/media/DataStorage/meizuvid/ if [ $3 -a $1 == cropbar ] then #Crop black bars on widescreen video. $mencoder $2 -idx -noodml -ofps 18 -vf scale=427:240,expand=:240:::1,crop=320:240,rotate=1 -ovc lavc -ffourcc XVID -lavcopts vcodec=mpeg4:vbitrate=256:vmax_b_frames=0:vhq -sws 9 -oac mp3lame -lameopts cbr:mode=2:br=96 -af resample=44100 -srate 44100 -o $outputpath[M6]$3 else echo Unknown variable $1 #Default conversion settings $mencoder $1 -idx -noodml -ofps 18 -vf scale=320:-2,expand=:240:::1,crop=320:240,rotate=1 -ovc lavc -ffourcc XVID -lavcopts vcodec=mpeg4:vbitrate=256:vmax_b_frames=0:vhq -sws 9 -oac mp3lame -lameopts cbr:mode=2:br=96 -af resample=44100 -srate 44100 -o $outputpath[M6]$2 fi exit 0
In the command line type:
Now to convert a movie type in the command line:Code:sudo chmod +x /usr/bin/meizu-convert
If the video is widescreen you can crop the black bars by typing:Code:meizu-convert [SOURCE FILE] [DESTINATION FILE]
I'm adding more options as i see fit for my needs.Code:meizu-convert cropbar [SOURCE FILE] [DESTINATION FILE]
Last edited by shookie; 04-04-2007 at 02:36 AM. Reason: Stable.
-
03-19-2007 #2
For RM video -> AVI i find that 15fps works best, as it has minimal glitches.
$mencoder -noodml $1 -o $outputpath[M6-MID]$2 -mc 0 -ofps 15.000 -vf-add crop=480:320:-1:-1 -vf-add scale=320:213 -vf-add expand=320:240:-1:-1:1 -srate 44100 -ovc lavc -lavcopts vcodec=mpeg4 -lavcopts vbitrate=256 -ffourcc DIVX -oac mp3lame -lameopts vbr=0 -lameopts br=128 -lameopts vol=0 -lameopts mode=0 -lameopts aq=7 -lameopts padding=3 -af volnormCurrent Rigs:
8GB iAudio 7 > Not in use
4GB + 32GB iAudio D2 > Alessandro MS-Pro
Sony MZ-NH1 > Headroom Total Bithead > Grado Labs PS-1
2GB Meizu M6 T1 > Not in use
8GB iPod Touch 2G > Shure SE530
-
03-19-2007 #3Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 Posts
-
03-20-2007 #4Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 PostsI have changed the video bitrate and have gotten better quality images. Can anyone confirm this?
Was at 384 now im at 256.Last edited by shookie; 03-20-2007 at 10:43 AM.
-
03-20-2007 #5
Yes, a higher video bitrate will increase the quality of your video. However.. either Meizu's processor or OS seems incapable of playing video smoothly at higher bitrates (or anything above 18fps).
It will play 20fps encoded movies, but i'm sure many of you will agree with me that they are too glitchy.
Ubuntu is a great OS... I unfortunately use Gentoo... so much maintenance required. =( =(Current Rigs:
8GB iAudio 7 > Not in use
4GB + 32GB iAudio D2 > Alessandro MS-Pro
Sony MZ-NH1 > Headroom Total Bithead > Grado Labs PS-1
2GB Meizu M6 T1 > Not in use
8GB iPod Touch 2G > Shure SE530
-
03-20-2007 #6Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 PostsI still get sync issues.... I'm going to have to try and use wine and see if a windows app could help with the sync issues
To all you linux users doing successful conversions for SP Meizu M6 4GB... hook me up with some parameters.
-
03-22-2007 #7Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 PostsThe following is some new code i put together that should be for more advance users. It will allow you to specify simple settings like FPS and Audio/Video bitrates.
This particular script will encode with black bars to maintain aspect ratio of wide screen. To make it crop the black bars find and replace the following:Code:#!/bin/bash #This script uses mencoder to convert movies to a playable AVI format for the MEIZU M6 # Path to the mencoder executable mencoder=/usr/bin/mencoder # Path for the output file outputpath=/media/DataStorage/meizuvid/ echo "-> The following are prompts user-specific input." echo "-> Meizu M6 supports up to 20 FPS so this should be the max" echo "-> Video Bitrate and Audio Bitrate shouldn't be to high since" echo " it will cause problems rendering video/audio." echo "-> My current working videos are set to 20 FPS/256 Video Bitrate/96 Audio Bitrate" echo echo echo -n "Specify frames per second [20 max]: " read fps echo -n "Specify video bitrate: " read vbr echo -n "Specify audio bitrate: " read abr $mencoder $1 -idx -noodml -ofps $fps \ -vf scale=320:-2,expand=:240:::1,crop=320:240,rotate=1 \ -ovc lavc -ffourcc XVID -lavcopts vcodec=mpeg4:vbitrate=$vbr:vmax_b_frames=0:vhq \ -sws 9 -oac mp3lame -lameopts cbr:mode=2:br=$abr -af resample=44100 -srate 44100 -o $outputpath[M6]$2 exit 0
This file I had renamed to m6-conv and made it executable using chmod +x. This is the output:Code:Find: -vf scale=320:-2,expand=:240:::1,crop=320:240,rotate=1 Replace with: -vf scale=427:240,expand=:240:::1,crop=320:240,rotate=1
My working recommendations are not 100%. Still get some sync issues there fore im still trying to find the perfect setup for mencoder parameters.Code:shookie@shookie-core:~$ m6-conv -> The following are prompts user-specific input. -> Meizu M6 supports up to 20 FPS so this should be the max -> Video Bitrate and Audio Bitrate shouldn't be to high since it will cause problems rendering video/audio. -> My current working videos are set to 20 FPS/256 Video Bitrate/96 Audio Bitrate Specify frames per second [20 max]:Last edited by shookie; 04-04-2007 at 02:40 AM.
-
04-03-2007 #8Passing By
- Join Date
- Apr 2007
- Posts
- 9
- Thanks
- 0
Thanked 0 Times in 0 PostsThanks for taking the time to post this, I was about to start messing with avidemux when I spotted this script. Much easier and good success so far.
regards
-
04-04-2007 #9Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 PostsI'm happy you found it useful. Let me know how this works for you with lengthy video's...
There is another script in the forum that chops your video at 20 minutes to avoid a/v sync issues. I haven't had much problem with the results of my script, but i'd keep a copy of some of the other scripts on the forum just in case. When i find it I will post a link.
-
04-04-2007 #10Freshman
- Join Date
- Apr 2007
- Posts
- 35
- Thanks
- 0
Thanked 0 Times in 0 Posts
-
04-04-2007 #11Passing By
- Join Date
- Apr 2007
- Posts
- 9
- Thanks
- 0
Thanked 0 Times in 0 Posts
Sure I will try a couple longer ones, so far I have only done a few porn clips, they were pretty short and handy to do a few tests with. Did half a dozen or so and each worked just fine, but I haven't paid real attention to the sync on them.
Thanlks for the tip on the script to chop at 20mins, no doubt I'll be using that on a couple movies, aybe even the TV eps if neccessary.
For the script I have used used 15fps, 300kbps and 128/64 to convert with, does that seem like good figures or have you had better results with others which I should play with.
-
04-04-2007 #12Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 Posts
-
04-04-2007 #13Passing By
- Join Date
- Apr 2007
- Posts
- 9
- Thanks
- 0
Thanked 0 Times in 0 PostsI haven't noticed it yet, I only received the M6 yesterday so haven't really played a lot. I opted to go for 15fps as from what I had read was that the 20fps was the maximum and had potential from comments that it would skip and cause sync probs, all I am aiming for is a general "good enough" conversion that is going to work for the majority of files just fine.
Just converted a full 90min (or so movie) and watched a few minutes, seems fine so far, it only weighed in at 29mb though (should have cropped large black bands) Its amazing though the resolution of the screen still allows me to read the actor credits and such on the start with ease, this may even replace my PocketPC for a mobile movie viewer at this rate
Ok, recoded to have no border and just watched the movie and it must be dropping frames still, at 1h15mins video was about 1second in advance of the audioLast edited by subbass; 04-04-2007 at 07:02 PM. Reason: Updated comment.
-
04-08-2007 #14Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 PostsI need to check the precision of the windows convertors if there is better quality involved. in linux im converting at 70 FPS in windows its much slower.. so id prefer to do my conversions in linux.... we'll see.
-
04-08-2007 #15Passing By
- Join Date
- Apr 2007
- Posts
- 9
- Thanks
- 0
Thanked 0 Times in 0 PostsHad a problem converting the Lemony Snickit movie a couple days ago, various FPS and Bitrates but it wouldn't play, not until I used the script to chop it into 20min chunks. Still playing with it, seems nothing wants to get rid of the sync issues with longer files.
Kinda bites as I had a 1Gb Genus Vizo player which would play any divx/xvid I threw at it, in fact I didn't even used to convert, just dumped 700mb movies to it and watched them, the screen on the Meizu is larger with a higher res which is much nicer to watch on.
-
04-08-2007 #16Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 Postsagreed. I bought this because of the video capabilities.
I hope that this can be fixed with future firmware releases. Until then i will continue learning more about mencoder and perhaps open horizons on other video encoding software that runs on linux..
If you know of any, preferrably command line, please let me know.
-
04-08-2007 #17Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 PostsFound new settings
FPS: 18-20
A: 96
V: 480
Let me know how it works.
-
04-10-2007 #18Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 PostsWell 20 FPS give me slight issue with av sync, however the quality of the image is amazing. Played a 1hr 20min video after every 10 minutes i noticed incremental sync/lag issues... perhaps.
Next video will be at 15/300/96
-
04-12-2007 #19Member
- Join Date
- Mar 2007
- Posts
- 108
- Thanks
- 0
Thanked 0 Times in 0 PostsNear perfect using the following:
A: 128
V: 394
FPS: 20
But the video must be short ... like 30 minutes. good for TV shows... otherwise you need to chop it up. (I learned this using parena's script)
-
04-14-2007 #20Passing By
- Join Date
- Apr 2007
- Posts
- 9
- Thanks
- 0
Thanked 0 Times in 0 PostsBack again, upgraded to Feisty and the kids were ill, anyways I will give those last settings a whirl over the weekend
Similar Threads
-
Mencoder Video Converter Info
By FirePower in forum Video and ImagingReplies: 46Last Post: 01-06-2009, 02:06 PM -
Bash script for conversion under Linux
By parena in forum Video and ImagingReplies: 9Last Post: 11-06-2008, 08:42 PM -
My Theme Linux Redhat
By leoriohunter in forum Modifications and SkinsReplies: 2Last Post: 02-04-2007, 01:26 PM -
Avidemux / Linux
By scaglifr in forum Video and ImagingReplies: 1Last Post: 02-01-2007, 02:30 PM -
Ubuntu Linux Theme
By Austin in forum Modifications and SkinsReplies: 2Last Post: 12-31-2006, 06:01 AM



Reply With Quote
