+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3
Results 41 to 47 of 47

Mencoder Video Converter Info

This is a discussion on Mencoder Video Converter Info within the Video and Imaging forums, part of the miniPlayer M6 / SL category; transcoding from one lossy codec to another results automatically in a loss of quality. Also you have to be more ...

  1. #41
    Administrator
    Join Date
    May 2007
    Posts
    3,191
    Thanks
    17
    Thanked 32 Times in 29 Posts
    transcoding from one lossy codec to another results automatically in a loss of quality. Also you have to be more precise what you understand of "bad sound".
    BatMan, the free video converter for Meizu players. Problems ? English First Aid here. Deutsche Erste Hilfe hier.
    Join the Meizume Chatroom at irc://irc.moofspeak.net/meizume ! Firefox Users : get the Chatzilla Plugin. Other Browsers : use this web client.

  2. #42
    Passing By
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hello.
    I'm french and have difficulties to translate and describe exactly what the sound is,so...
    -no music, no conversation can be heard
    -only constant and insufferable noise.
    thanks

  3. #43
    Passing By
    Join Date
    Mar 2008
    Location
    Austria
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've written a bash script to automate the conversion progress.

    You can use it for just converting movies to a compatible format, ore use it for autocropping 16:9 movies to the m6 display format 4:3.

    It also automatically detects those black bars at the top and the bottom of some movies faking a 4:3 resolution and crops to *real* 16:9

    Code:
    #!/bin/bash
    #
    # bash script for converting videos to a meizu-m6 compatible format
    # autodetecting and -removing those black fagbars faking a 4:3 resolution
    # autocropping 16:9 to 4:3 
    # 
    # (c) 2008 by antisystem@jabber.org
    
    echo
    echo "Do you want to crop the video to 4:3?  [y/n]"
    echo "Standard is No"
    echo
    read crop
    
    
    if [ "$crop" = "y" ]; then
    	mplayer "$1" -vf cropdetect -frames 5 -ss 600 -vo null -ao null >/home/$USER/.meizucrop
    	cropres=`cat /home/$USER/.meizucrop | grep crop | tail -n 1 | cut -d "(" -f 2 | cut -d ")" -f 1`
    #	mplayer "$1" $cropres,scale=-2:240,crop=320:240 
    	mencoder "$1" -idx -noodml -ofps 20 $cropres,scale=-2:240,expand=320::::1,crop=320:240,rotate=1 -ovc lavc -ffourcc XVID -lavcopts vcodec=mpeg4:vbitrate=384:vmax_b_frames=0:vhq -sws 9 -srate 44100 -oac mp3lame -lameopts cbr:br=128:mode=0 -o "$2"
    else
    #	mplayer "$1" -vf scale=320:-2,expand=:240:::1,crop=320:240
    	mencoder "$1" -idx -noodml -ofps 20 -vf scale=320:-2,expand=:240:::1,crop=320:240,rotate=1 -ovc lavc -ffourcc XVID -lavcopts vcodec=mpeg4:vbitrate=384:vmax_b_frames=0:vhq -sws 9 -srate 44100 -oac mp3lame -lameopts cbr:br=128:mode=0 -o "$2"
    fi
    
    exit 0
    working fine for me - if you have problems or questions, feel free to send me a mail.

  4. #44
    Administrator
    Join Date
    May 2007
    Posts
    3,191
    Thanks
    17
    Thanked 32 Times in 29 Posts
    I wonder why u linux guys invent the wheel each day again ? There are a couple of linux scripts now in this forum, but you don't want to work together and use the synergy.
    BatMan, the free video converter for Meizu players. Problems ? English First Aid here. Deutsche Erste Hilfe hier.
    Join the Meizume Chatroom at irc://irc.moofspeak.net/meizume ! Firefox Users : get the Chatzilla Plugin. Other Browsers : use this web client.

  5. #45
    Passing By
    Join Date
    Mar 2008
    Location
    Austria
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by BobbyQ View Post
    I wonder why u linux guys invent the wheel each day again ? There are a couple of linux scripts now in this forum, but you don't want to work together and use the synergy.
    Because it is fun :-)

  6. #46
    Passing By
    Join Date
    Mar 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    nice mencoder script

    This is a nice script I've been using from some time now. I downloaded from an old thread and improved a bit. Crops, let you do double pass and load subtitles when available.

    Code:
    #!/bin/bash
    #
    #       Redistribution and use in source and binary forms, with or without
    #       modification, are permitted provided that the following conditions are
    #       met:
    #       
    #       * Redistributions of source code must retain the above copyright
    #         notice, this list of conditions and the following disclaimer.
    #       * Redistributions in binary form must reproduce the above
    #         copyright notice, this list of conditions and the following disclaimer
    #         in the documentation and/or other materials provided with the
    #         distribution.
    #       * Neither the name of the  nor the names of its
    #         contributors may be used to endorse or promote products derived from
    #         this software without specific prior written permission.
    #       
    #       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    #       "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    #       LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    #       A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    #       OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    #       SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    #       LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    #       DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    #       THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    #       (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    #       OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    #
    #       Copyleft 2007, 2008 wishmechaos and dudus
    #
    #        Version 0.1, 21-oct-07
    #        Version 0.2, 22-oct-07, Added ratio autodetect (requires ffmpeg),
    #            small subtitle fix.
    #             routine from http://tuxicity.wordpress.com/2006/12/01/avi-to-dvd-with-ffmpeg-and-dvdauthor/
    #        Version 0.2.1, 12-feb-08, Fixed small bug when filename has spaces.
    #        Version 0.3, 1-mar-08, Tuned mencoder parameters.
    #        Version 0.4, 20-mar-08, fixed double pass and subtitles loading
    
    # For debugging purposes
    # set -x
    
    ### Defaults
    # Frames per second (15-20)
    fps=20
    
    # Two pass encoding, takes longer, better quality
    # yes / no
    twopass=no
    
    # Crop settings.
    # "auto" will try to detect if the source video is 4:3 or 16:9
    #  and leave that intact.
    # "yes" will leave 4:3 videos as they are, and will crop 16:9
    #  videos in order to take up all of the screen.
    crop="auto"
    
    # Video bitrate
    vbitrate=350
    # Audio bitrate
    abitrate=112
    # Sample rate
    srate=44100
    # Maximum Bitrate allowed
    vrc_maxrate=460
    # Buffer size
    vrc_buf_size=1835
    ### End defaults
    
    # Some common options
    common="-idx -noodml -force-avi-aspect 1.3333 -msglevel mencoder=1 -ofps $fps -ovc lavc -ffourcc XVID"
    
    show_help() {
        echo "Usage: `basename "$0"` [-h(elp)] [-c(rop) auto yes] [-p (two-pass)] [-f(ps) number]
        [-v(ideo bitrate) number] [-a(udio bitrate) number] file1.avi [file2.avi...]
        Subtitles are automatically loaded if their filename is the same as the movie file"
        exit 1
    }
    
    # find subtitles with same filename
    findsubs() {
        for possiblefile in "$filename"*; do
            case $possiblefile in
                *.sub) subfile="$possiblefile";;
                *.srt) subfile="$possiblefile";;
            esac
        done
        if test -n "$subfile"; then #if [[ "$subfile" != "" ]]; then
            echo "Found $subfile."
            subs=(-noautoexpand -subpos 95 -subfont-autoscale 3 -subfont-outline 1 -subcp enca -sub "$subfile")
        fi
    }
    
    aspectdetect() {
        aspect=$(( $(ffmpeg -i "$moviefile" 2>&1 | grep "Stream\ #0.0" | sed "s/.* \([1-9][0-9]*\)x\([0-9]*\).*/\10000 \/ \2/") ))
        
        if [[ $aspect -lt 15555 ]]; then
            # 4:3
            echo "$moviefile appears to be 4:3"
            vf="scale=-2:240,crop=320:240,expand=320:240:::1"
        else
            # 16:9
            echo "$moviefile appears to be Widescreen"
            vf="scale=320:-2,crop=320:240,expand=320:240:::1"
        fi
    }
    
    convert() {
        case $crop in
            auto) aspectdetect;;
            yes) vf="scale=-2:240,crop=320:240,expand=320:240:::1"
        esac
        
        if [[ "$twopass" == "no" ]]; then
            mencoder "${subs[@]}" -vf softskip,$vf,rotate=1 "$moviefile" $common -lavcopts threads=8:vcodec=mpeg4:mbd=2:trell:vbitrate=$vbitrate:vrc_maxrate=$vrc_maxrate:vrc_buf_size=$vrc_buf_size:vmax_b_frames=0:vhq:acodec=libmp3lame:abitrate=$abitrate:keyint=100:sc_factor=5 -sws 9 -srate $srate -oac lavc -af volnorm,delay=230:230 -o "$filename.meizu.avi"
        else
            #pass 1
            mencoder -nosound -vf softskip,$vf,rotate=1 "$moviefile" $common -lavcopts threads=8:vcodec=mpeg4:vpass=1:vbitrate=$vbitrate:vrc_maxrate=$vrc_maxrate:vrc_buf_size=$vrc_buf_size:vmax_b_frames=0:vhq:turbo -sws 9 -o "$filename.meizu.avi"
            #pass 2
            mencoder "${subs[@]}" -vf softskip,$vf,rotate=1 "$moviefile" $common -lavcopts threads=8:vcodec=mpeg4:mbd=2:trell:vpass=2:vbitrate=$vbitrate:vrc_maxrate=$vrc_maxrate:vrc_buf_size=$vrc_buf_size:vmax_b_frames=0:vhq:acodec=libmp3lame:abitrate=$abitrate:keyint=100:sc_factor=5 -sws 9 -srate $srate -oac lavc -af volnorm,delay=230:230 -o "$filename.meizu.avi"
            rm divx2pass.log
        fi
    
        echo " Finished converting $moviefile"
    }
    
    cleanUp() {
        rm "$filename.meizu.avi"
        rm divx2pass.log
        exit 1
    }
    trap cleanUp INT
    
    # If there're no arguments
    if [ $# = 0 ]; then show_help; fi
    
    # Parse arguments
    x=1         # Avoids an error if we get no options at all.
    while getopts "hc:pf:" opt; do
        case "$opt" in
            h|\?) show_help;;
            c) crop="$OPTARG";;
            p) twopass="yes";;
            f) fps="$OPTARG";;
            a) abitrate="$OPTARG";;
            v) vbitrate="$OPTARG";;
        esac
        x=$OPTIND
    done
    shift $((x-1))
    
    for moviefile in "$@"; do
        if [[ -f "$moviefile" ]]; then
            echo "Moviefile is $moviefile"
            extension=".${moviefile##*.}"
            echo "Extension is $extension"
            filename="`basename "$moviefile" "$extension"`"
            echo "Filename is therefore "$filename""
            # ugly way to do it, works though.
            if [[ "$moviefile" != "${moviefile%/*}" ]]; then cd "${moviefile%/*}"; fi
            findsubs
            echo "Converting $moviefile"
            convert
        else
            echo ""$moviefile" doesn't exist."
        fi
    done

  7. #47
    Stalker
    Join Date
    Jan 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello together. I`ve tested some of the scripts, but they dont work: The mencoder scripts and the script above rotate the video 90°.

    So I read the manpage of mencoder and built this script:
    Code:
    mencoder movie.avi -vf scale=320:240 -oac copy -ovc xvid -o output.avi
    This doesnt change the size of the file (~700 MB), but it resizes the video to 320x240px (Google says this is the screen resolution of my m6 sl). Yeah, it looks really bad... but the biggger problem is: It does not work: The player does not want to play this video.

    Do you know why it does not work?

    Best regards, Keba

    PS: Yep, Im using Linux (Ubuntu 8.04)
    PPS: Im sorry for my English, i hope, that you understand me.

    //edit: Mabe i should say, that the player plays the standard-movie (meizu promotion).
    Im using the firmware, which was with the player - dont know its name. I cant listen to the radio...
    Last edited by Keba; 01-06-2009 at 02:13 PM.


 

Similar Threads

  1. MZ Video Converter
    By Err0r in forum Video and Imaging
    Replies: 20
    Last Post: 07-01-2010, 03:30 PM
  2. Loli Video Converter for M6
    By Lolita in forum Video and Imaging
    Replies: 127
    Last Post: 12-25-2009, 01:23 AM
  3. Meizu converter and vob files
    By scaglifr in forum Video and Imaging
    Replies: 0
    Last Post: 01-25-2007, 10:02 AM