Permalink
Browse files

Recode OGV with -qscale 6.

This is needed mostly due to the input files being mp4/avi
in a lot of cases, and OGV just does not come out OK by
default with ffmpeg. A modest qscale of 6 seems to be OK
for both size and quality.
  • Loading branch information...
1 parent 8f56de7 commit a4a5f6cd7a6f32b9008a8696cd38abb11eb9fd42 @sofar committed Oct 10, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 album-watch.php
View
@@ -63,15 +63,19 @@ function do_file($path, $album, $user)
# mp4
$t = $cache_base . "/" . $album . "/" . $i['filename'] . ".mp4";
if (!is_file($t)) {
+ # most of my stuff is in AVI or MP4 format, and doesn't need any tuning to come out OK
+ # with mp4 format recoding
echo 'ffmpeg -i "' . $path . '" -acodec libfaac -vcodec libx264 "' . $t . '"' . "\n";
system('ffmpeg -i "' . $path . '" -acodec libfaac -vcodec libx264 "' . $t . '" > /dev/null 2>&1');
}
# ogv
$t = $cache_base . "/" . $album . "/" . $i['filename'] . ".ogv";
if (!is_file($t)) {
- echo 'ffmpeg -i "' . $path . '" -acodec libvorbis -ac 2 -vcodec libtheora "' . $t . '"' . "\n";
- system('ffmpeg -i "' . $path . '" -acodec libvorbis -ac 2 -vcodec libtheora "' . $t . '" > /dev/null 2>&1');
+ # with -sameq or no params, OGV's come out very pixelated and small. Instead
+ # code these at -qscale 6, which is small but plenty res for the web.
+ echo 'ffmpeg -i "' . $path . '" -acodec libvorbis -ac 2 -vcodec libtheora -qscale 6 "' . $t . '"' . "\n";
+ system('ffmpeg -i "' . $path . '" -acodec libvorbis -ac 2 -vcodec libtheora -qscale 6 "' . $t . '" > /dev/null 2>&1');
}
}

0 comments on commit a4a5f6c

Please sign in to comment.