Advertisement
Guest User

ffmpeg+xvid-very_slow

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