Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # A ffmpeg XviD conversion script by Wintershade (Wintershade AT gmail DOT com)
- #
- # I change -b:v depending on my desired filesize. Also, rather than scaling the
- # video to 720:-16 or 640:-16, I prefer to change the aspect ratio (the same line
- # as with the -b:v) to match the input video, while keeping the resolution as
- # high as possible (preferrably 720:480 or 720:576).
- nice \
- ffmpeg -i "$1" \
- -c:a libmp3lame \
- -qscale:a 5 -ac 2 -compression_level:a 0 \
- -c:v libxvid -vtag DX50 -f avi -maxrate:v 5000k \
- -qmin:v 2 -qmax:v 9 -qdiff 1 -bufsize 4096 \
- -b:v 1250k -aspect 16:9 -pass 1 \
- -mbd 2 -bf 2 -trellis 1 -flags +aic -cmp 2 -subcmp 2 -g 250 \
- -bt 1 -lumi_mask 0.25 -dark_mask 0.01 \
- -vf hqdn3d="2:2:6:6",scale="720:480" \
- -threads 0 \
- -y output.pass1.xvid.avi
- nice \
- ffmpeg -i "$1" \
- -c:a libmp3lame \
- -qscale:a 5 -ac 2 -compression_level:a 0 \
- -c:v libxvid -vtag DX50 -f avi -maxrate:v 5000k \
- -qmin:v 2 -qmax:v 9 -qdiff 1 -bufsize 4096 \
- -b:v 1250k -aspect 16:9 -pass 2 \
- -mbd 2 -bf 2 -trellis 1 -flags +aic -cmp 2 -subcmp 2 -g 250 \
- -bt 1 -lumi_mask 0.25 -dark_mask 0.01 \
- -vf hqdn3d="2:2:6:6",scale="720:480" \
- -threads 0 \
- -y output.pass2.xvid.avi
- # hey guys, thanks for taking a look at this. This is supposed to generate XviD AVI
- # files which should play on legacy Home Theater DVD players.
- # the problem is that this is painfully slow - on my Intel Core2Duo CPU, the 2nd
- # pass encodes at less than ~10 FPS. I remember XviD being much faster (almost ~25
- # FPS on a single-core Intel Pentium-M). FWIW, I have ffmpeg and video libraries
- # compiled with -O3 -march=native flags, on Gentoo Linux.
- #
- # my aim is, in a nutshell, to get this to work faster, with as little quality loss
- # as possible (preferrably none at all). any suggestions would be welcome.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement