Author Topic: Movies  (Read 6528 times)

undrwater

  • Full Member
  • ***
  • Posts: 232
    • View Profile
    • http://
Movies
« Reply #15 on: March 16, 2006, 02:30:27 pm »
Is anyone using 2 pass encoding?

I've tried this with mencoder and a couple of files, but it complains at the end that it couldn't read the file name at the end of the first pass.  In examples I've seen, the first pass gets written to /dev/null, then the second to the output file name. Other examples state that the first and second pass gets written to the output file name.

Looking through man and howto's i've seen 2-pass represented a couple of different ways:

Code: [Select]
pass:1
pass:2

pass=1
pass=2

Maybe it changes depending on the input or output file, but I had difficulty understanding how it's supposed to be used.

Can anyone explain this in a simple way?

portalgod

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • http://www.rajeshprakash.com
Movies
« Reply #16 on: September 26, 2006, 11:20:01 am »
Quote
There's already an article on mencoder:
https://www.oesf.org/index.php?title=Mencoder_Encoding

Here's my own .bat scripts for outputting the best playback quality/encoding speed for my Zaurus SL-C3000 on WindowsXP:

To encode an existing file using the syntax : enc movie.avi
This will create Zmovie.avi, the compressed movie file.

Code: [Select]
mencoder %1 -ffourcc DX50 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=500 -vf crop=640:480:0:0 -oac lavc -lavcopts acodec=mp2:abitrate=64 -o Z%1 %2
To encode a movie directly from a DVD source (that you own due to legal stuff) :

Code: [Select]
mencoder dvd://1 -ffourcc DX50 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=500 -vf crop=640:480:40:0 -oac lavc -lavcopts acodec=mp2:abitrate=64 -o Zdvd.avi %2
Those settings are pretty much the fastest I got to encode movies and the fastest playback on the zaurus using mplayer. You can tweak the bitrate to get better quality or remove the crop and use
Code: [Select]
-vf scale=640:480 to simply scale the full frames (slower encoding)

Note that mplayer playback of a movie with a bitrate beyond 500 was resulting in frame drops. I guess 500 is the best you can get for 640x480.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118888\"][{POST_SNAPBACK}][/a][/div]

Using your suggested mencoder encoding command above I find the audio is way out of sync with the video.  Have you experienced this?  I have not yet tried to see if I get more in sync audio & video by encoding files from the harddrive as opposed to straight off the DVD.

Also, have you encoded any movies using mencoder with subtitles?  What are the correct flags to use.  I tried using -vosubout and such but I couldn't get it to display them.
SL-C1000 w/pdaXii13 Akita (base) + select apps
4GB Transcend 150x SD, 4GB Transcend 120x CF
Planex gw-cf11x CF Wi-Fi, Buffalo CF LAN
UT-41 USB GPS
Misc other SD and CF cards

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Movies
« Reply #17 on: September 28, 2006, 04:29:03 am »
work in progress: zencoder

https://www.oesf.org/forums/index.php?showtopic=20438&st=15

Code: [Select]
# Copyright: Jay Coles 2006
# Licsence: GPL v2
# Version 0.9

# ######## Cut and paste from here into config file ##########
# ***** File Vars *******
ENCODER=mencoder
# File to be converted
INFILE=""
# Save file as
OUTFILE=""


# ****** Encoding Vars ******
# nice easy policys for encoding diffrent media
# added because it was easy to hack together :)
# note that you might want to add a policy_ to the
# front of your funtions to avoid clobbering
# the internal code
POLICY=policy_anime
POLICY_LIST="$POLICY policy_anime "

policy_anime() {
       NAME="Anime Medium Quality"
       DESCRIPTION="This is designed for encoding media for a zaurus with an anime file with hard subs (hence the high res)"
       AUTHOR="Jay Coles"
       LICSENSE="GPL"

       CONTAINER="avi"
       V_CODEC="xvid"
       A_CODEC="mp3"

       V_BITRATE="300"
       A_BITRATE="96"

       #Diffrent encoding policies (ie cbc abr vbr multipass)
       V_POLICY="multipass"
       A_POLICY="cbr"

       # allow recording at diffrent rates/fps
       # this really helps with anime by decimating the fps
       # by 2, allows for huge reductions in size with a small
       # loss in percived quality (ie motion is slightly more
       # jagged)
       V_RATE="0.5"
       A_RATE="22050"

       # Allow overiding of ratio blank for keep original
       RATIO=""
       KEEP_RATIO="y"
       # Note that these are max vals that will never be exceeded
       # while still maintiaining asspect ratio
       X_RES="640"
       Y_RES="480"

       #Amount of degrees to rotate video (helps increse performance)
       ROTATION=90
}

ENCODER_POLICY=encoder_mencoder

encoder_mencoder() {
       ENCODER_PROG=mencoder

       PROVIDES="xvid divx mp4"

       V_CODEC_STRING="-voc"
       A_CODEC_STRING="-aoc"
}
################ End cut and paste ################


################ functions ################
locate_codec() {
       for I in $ENCODER_POLICY; do
               . $I
               if (echo $PROVIDES | grep $1) = 0; then
                       echo $I
                       exit 0
               fi
       done

       exit 1
}


if [ -f /etc/zencoder.conf ]; then
       . /etc/zencoder/zencoder.conf
fi

if [ -f ~/zencoder.conf ]; then
       . ~/zencoder/zencoder.conf
fi

help () {
cat << EOF
zencoder: encodes moives for small media players

Usage: zencoder [-h | --help] [-o =] [-a
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

Legodude522

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • http://fradynet.com/
Movies
« Reply #18 on: November 04, 2006, 01:20:20 am »
VeMode works great for video converting.

DVD ripper -> VeMode -> SD card.