Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Tablet-encode & mencoder

    Reply
    Page 4 of 5 | Prev |   2     3   4   5   | Next
    Jaffa | # 31 | 2008-03-29, 11:19 | Report

    Originally Posted by bubieyehyeh View Post
    Wishlist: Does/Will the configuration file offer a way to set the 770 mode permenently? And prehaps a way to set default preset. I can modify the script myself, but I guess other may like the features also.
    tablet-encode v2.18 has been released. More detail at:

    http://www.maemopeople.org/index.php...uch_improved_d

    To set the default preset and to always enable 770-compatibility mode, create ~/.tablet-encode.conf and put in it:

    Code:
    $options{770} = 1;
    $defaultPreset = 'good';
    You can also define your own presets, there's more info in the README.

    Let me know if you have any problems.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to Jaffa For This Useful Post:
    leke, qwerty12

     
    mve | # 32 | 2008-03-30, 13:20 | Report

    Is it possible to add few more parameters for the tablet-encode? I tried to use "--mencoder=ARGn" but couldn't get it working.

    I have some kung-fu DVDs which have English audio set as a default and when I make conversion, tablet-encode selects it. However I would like to have original Chinese audio with English subtitles.

    I have also used few other parameters with my own script (based to ones found on maemo.org wiki) which I would like to see also in tablet-encode. One of those is possibility to keep original aspect ratio and still crop black borders away. Videos will be 400 pixels (or whatever is set as resolution) wide and height will be automatically calculated based on aspect ratio. At least mplayer plays these videos correctly and black borders aren't encoded at all.

    These are the mencoder parameters I would like to see in tablet-encode:

    #Audio language e.g "zh"
    -alang <lang code>

    #Subtitle language e.g "en"
    -slang <lang code>

    #Subtitle font and its size
    -subfont-text-scale 7 -spuaa 3 -subcp latin1

    #Crop value and scaling to correct aspect ratio.
    -vf crop <x:x:x:x>,scale=400:-10

    I have used "mplayer dvd://$TITLE -vf cropdetect" to get correct crop value. Crop value can be different in the start of the movie so I have selected manually a position which I would like to use as a crop value and then I have then put it as a parameter for "-vf crop".

    Here is the script I have used to convert my DVDs. It's bit rough edged but it has been working just fine for me
    Code:
    #!/bin/bash
    #
    # N800dvd.sh
    #
    # Usage: N800dvd.sh
    #
    
    TITLE=$1
    
    clear
    echo
    echo '       ##################################################'
    echo '       #                                                #'
    echo '       #           Encode DVD for Nokia N800            #'
    echo '       #                                                #'
    echo '       ##################################################'
    echo
    echo -n "DVD title number to be encoded? [$1]: "
    read title_in
    if [ "$title_in" != "" ]; then
      TITLE=$title_in
    fi
    
    # Default values
    ABR='128'
    VBR='600'
    ALANG='en'
    AID='128'
    SLANG='fi'
    SID='1'
    RES='400'
    OUT=`echo -n "$TITLE" |sed 's/$/-N800.avi/g'`
    VOP='0:0:0:0'
    
    echo -n "Output file? [$OUT]: "
    read out_in
    if [ "$out_in" != "" ]; then
      OUT=$out_in
    fi
    
    echo -n "Resolution (width)? [$RES]: "
    read res_in
    if [ "$res_in" != "" ]; then
      RES=$res_in
    fi
    
    echo -n "Video bitrate? [$VBR]: "
    read vbr_in
    if [ "$vbr_in" != "" ]; then
      VBR=$vbr_in
    fi
    
    echo -n "Audio bitrate? [$ABR]: "
    read abr_in
    if [ "$abr_in" != "" ]; then
      ABR=$abr_in
    fi
    
    echo -n "Audio language code? [$ALANG]: "
    read alang_in
    if [ "$alang_in" != "" ]; then
      ALANG=$alang_in
    fi
    
    echo -n "Subtitle language code? [$SLANG]: "
    read slang_in
    if [ "$slang_in" != "" ]; then
      SLANG=$slang_in
    fi
    
    echo
    echo "Crop black bars?"
    echo "(y) Yes"
    echo "(n) No"
    echo -n "Select [n]: "
    read crop
    if [ "$crop" = "y" ]; then
    echo
    echo Press q to use that point as a croping value.
    mplayer dvd://$TITLE -vf cropdetect -nosound -vo xv &>crop.tmp
    sed -e :a -e '$q;N;4,$D;ba' crop.tmp > crop1.tmp
    crop_line=$(sed q crop1.tmp)
    crop_front=$(echo "$crop_line" | sed -re 's/^.+\=//')
    VOP=$(echo "$crop_front" | sed s/..$//)
    rm crop*.tmp 2>/dev/null
    
    else
    VOP='0:0:0:0'
    fi
    
    echo
    echo Video crop area: $VOP
    
    echo
    echo '       ##################################################'
    echo '       #                                                #'
    echo '       #            Encoding (pass 1 of 2)              #'
    echo '       #                                                #'
    echo '       ##################################################'
    echo
    echo "Start time: $(date)"
    
    rm -f divx2pass_$OUT.log 2>/dev/null
    
    #nice -n 19 \
    mencoder "dvd://$TITLE" \
        -o "$OUT" \
        -oac mp3lame -lameopts cbr:preset=$ABR -af volnorm=1 \
        -passlogfile divx2pass_$OUT.log \
        -vf field=0 \
        -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=$VBR:vpass=1:turbo \
        -vf crop=$VOP,scale=$RES:-10 \
        -ffourcc DIVX &>/dev/null \
        -alang $ALANG -slang $SLANG \
        -idx \
        -subfont-text-scale 7 -spuaa 3 -subcp latin1 &>/dev/null
    
    
    echo "End time: $(date)"
    
    echo
    echo '       ##################################################'
    echo '       #                                                #'
    echo '       #            Encoding (pass 2 of 2)              #'
    echo '       #                                                #'
    echo '       ##################################################'
    echo
    echo "Start time: $(date)"
    
    #nice -n 19 \
    mencoder "dvd://$TITLE" \
        -o "$OUT" \
        -oac mp3lame -lameopts cbr:preset=$ABR -af volnorm=1 \
        -passlogfile divx2pass_$OUT.log \
        -vf field=0 \
        -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=$VBR:mbd=2:vpass=2 \
        -vf crop=$VOP,scale=$RES:-10 \
        -ffourcc DIVX \
        -alang $ALANG -slang $SLANG \
        -idx \
        -subfont-text-scale 7 -spuaa 3 -subcp latin1 &>/dev/null
    
    rm -f divx2pass_$OUT.log 2>/dev/null
    
    echo "End time: $(date)"
    echo
    echo '       ##################################################'
    echo '       #                                                #'
    echo '       #               Encoding completed               #'
    echo '       #                                                #'
    echo '       ##################################################'
    echo

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Jaffa | # 33 | 2008-03-30, 18:48 | Report

    mve, thanks for the feedback.

    * Auto-cropping using cropdetect is possible, but why've you got videos with encoded black bars in them anyway? ;-) I'll look into it for the next version.

    * Original aspect ratio can be maintained with --original-aspect (-o).

    * -alang is passed through for auto-detected DVDs, based on $LANG. I'll look at doing it more often.

    * --mencoder=ARGn should work, e.g.:

    Code:
    tablet-encode -o -m-alang -mzh -m-slang -men in.avi out.avi
    You can use the new ~/.tablet-encode.conf feature to use these as standard, if desired.

    Hope that helps,

    Andrew

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Jaffa For This Useful Post:
    mve

     
    mve | # 34 | 2008-03-30, 19:38 | Report

    Originally Posted by Jaffa View Post
    * Auto-cropping using cropdetect is possible, but why've you got videos with encoded black bars in them anyway? ;-) I'll look into it for the next version.
    Yeah, those crappy 1:2.35 DVDs why they just don't make all those in 4:3 full screen Thank you for looking it.

    Originally Posted by
    * Original aspect ratio can be maintained with --original-aspect (-o).

    * -alang is passed through for auto-detected DVDs, based on $LANG. I'll look at doing it more often.

    * --mencoder=ARGn should work, e.g.:

    Code:
    tablet-encode -o -m-alang -mzh -m-slang -men in.avi out.avi
    This was a thing I was looking. I had wrong syntax when I tried tablet-encode. Now I can hear original CHAP and CHOP sound effects in my movies with Chinese dialog and English subs

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Jaffa | # 35 | 2008-03-30, 19:41 | Report

    Originally Posted by mve View Post
    Yeah, those crappy 1:2.35 DVDs why they just don't make all those in 4:3 full screen Thank you for looking it.
    Ah, 2.35:1 DVDs. Good point :-)

    Edit | Forward | Quote | Quick Reply | Thanks

     
    ldrn | # 36 | 2008-05-22, 16:04 | Report

    Tablet-encode is awesome!

    I wanted to set it up to automatically encode all the files I download with azureus... not there yet, but I ran into a bug with mencoder and mkvs that I've run into before, where it cuts short mkv files while encoding randomly. My point is, I found where someone wrote up a workaround for it, and the way you can pass any mencoder option to tablet encode via -m let me use it really easily. Thanks a ton for this great program!

    (The other awesome part about tablet encode to me? I can launch a progress bar for my conversion from the command line, meaning I can automate things with visual feedback. And if I put it inside screen first, I can get remote console feedback on the progress of files, too! )

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Jaffa | # 37 | 2008-05-23, 08:50 | Report

    If the option is something which could always be passed for *.mkv files without any problems, let me know and I'll stick it in by default.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Jaffa For This Useful Post:
    ldrn

     
    ldrn | # 38 | 2008-05-24, 18:47 | Report

    That'd be great! It could be passed without issue; the way I do it does add a bit of extra time (about 10 seconds on my machine) to the process up front, though. I know there are better ways to do it -- you can extract the audio first -- I just haven't bothered.

    The bug can be summed up as: mencoder has trouble with mkvs when it has to also decode the audio for some reason; I know nothing of the technical details. The workaround I use is a bash script; I thought about modifying tablet-encode, but I know almsot no perl.

    Problem with how I do it is, what if you are not on a Linux system? I don't know if other systems work the same way or how to adapt it.

    Here's what I do, without the stuff specific to me:
    Code:
    #!/bin/bash
            TEMPFILE=`mktemp`
            rm $TEMPFILE
            mplayer "$1" -ao pcm:fast:file=$TEMPFILE -vc null -vo null
            ~/bin/tablet-encode --preset mplayer -m-audiofile -m$TEMPFILE --gui $1 $2
            rm $TEMPFILE

    Edit | Forward | Quote | Quick Reply | Thanks

     
    nyu2 | # 39 | 2008-07-15, 08:17 | Report

    Originally Posted by Jaffa View Post
    Code:
    tablet-encode -o -m-alang -mzh -m-slang -men in.avi out.avi
    You can use the new ~/.tablet-encode.conf feature to use these as standard, if desired.
    I can't seem to get the syntax of this file down. Could you post an example, converting the code above into the .tablet-encode.conf format as a further example?

    -nyu2

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Jaffa | # 40 | 2008-07-15, 12:21 | Report

    Originally Posted by nyu2 View Post
    I can't seem to get the syntax of this file down. Could you post an example, converting the code above into the .tablet-encode.conf format as a further example?
    No problem at all! At the moment, it might require a little too much Perl knowledge, I'm hoping to drum up some extra developers at the Maemo Summit lightning session on tablet-encode.

    For the above command line options, put this in ~/.tablet-encode.conf:

    Code:
    $options{'original-aspect'} = 1;
    $options{'mencoder'} = [qw(-alang zh -slang en)];
    The next version of the GUI (some thoughts based on suggestions from RST38h here) should provide a mechanism for maintaining the configuration file to make it easier to set your default options. Again, patches and suggestions always welcome :-)

    Hope that helps,

    Andrew

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 4 of 5 | Prev |   2     3   4   5   | Next
vBulletin® Version 3.8.8
Normal Logout