ugoiras: increase quality of webm samples.
Fix certain ugoiras having very low quality webm samples. This was because we had a target bitrate of 5 Mbps, but this wasn't enough for videos that were high resolution or that had choppy, hard-to-compress motion, such as post 5081776 (nsfw).
This commit is contained in:
@@ -85,7 +85,7 @@ class MediaFile::Ugoira < MediaFile
|
|||||||
end
|
end
|
||||||
|
|
||||||
ext = zipfile.first.name.match(/\.(\w{,4})$/)[1]
|
ext = zipfile.first.name.match(/\.(\w{,4})$/)[1]
|
||||||
ffmpeg_out, status = Open3.capture2e("ffmpeg -i #{tmpdir}/images/%06d.#{ext} -codec:v libvpx -crf 4 -b:v 5000k -an #{tmpdir}/tmp.webm")
|
ffmpeg_out, status = Open3.capture2e("ffmpeg -i #{tmpdir}/images/%06d.#{ext} -codec:v libvpx -crf 12 -b:v 0 -an #{tmpdir}/tmp.webm")
|
||||||
raise Error, "ffmpeg failed: #{ffmpeg_out}" unless status.success?
|
raise Error, "ffmpeg failed: #{ffmpeg_out}" unless status.success?
|
||||||
|
|
||||||
mkvmerge_out, status = Open3.capture2e("mkvmerge -o #{output_file.path} --webm --timecodes 0:#{tmpdir}/timecodes.tc #{tmpdir}/tmp.webm")
|
mkvmerge_out, status = Open3.capture2e("mkvmerge -o #{output_file.path} --webm --timecodes 0:#{tmpdir}/timecodes.tc #{tmpdir}/tmp.webm")
|
||||||
|
|||||||
Reference in New Issue
Block a user