TASEmulators / TASEncodingPackage

http://tasvideos.org/EncodingGuide/PublicationManual.html
MIT License
4 stars 3 forks source link

Add FLAC encoding to FFmpeg package. #10

Closed despoa closed 2 years ago

despoa commented 2 years ago

This should speed up audio encoding by a significant amount with only a <2.5x increase in size and no perceptible difference in audio quality.

vadosnaprimer commented 2 years ago

Does it make any difference after YT reencodes it?

despoa commented 2 years ago

Not that I notice. No quality deterioration from my end. The FFmpeg executable still has libvorbis built in it just in case.

despoa commented 2 years ago

Here are two YouTube videos where the audio track was encoded with FFmpeg's version of FLAC. One is a Super Turrican TAS and the other is a Mega Turrican TAS.

https://www.youtube.com/watch?v=e51slC96z50 https://www.youtube.com/watch?v=bp1xFMHoRAs

Zinfidel commented 2 years ago

I mentioned that I think this is a good change already for a few reasons. The size of audio for our encodes is insignificant compared to video, so even a 2.5x size increase can basically be disregarded. We completely ignore the issue of quality this way as well by just sending lossless to YT, so we can stop thinking about it.

Based on some searching around on SO, it appears that if you use the libflac encoder in ffmpeg without a quality argument (-compression_level), it defaults to a value of 5 out of 12. I suspect that for our purposes the compression level is an unnecessary concern, but I wanted to mention it in case.

As for the ffmpeg build, I'm glad that you @despoa built it successfully because I was worried about being the only one who had done it so far. I think it's safe for us to remove the vorbis capabilities from the build even if it doesn't add a ton of size, just because the original idea was to make the included ffmpeg as tiny an audio tool as possible.

vadosnaprimer commented 2 years ago

I agree with dropping vorbis then, and I feel using the best compression in flac would be cleaner.

despoa commented 2 years ago

I would not change the compression settings. The reason to switch to FLAC is mainly for speed purposes and increasing the compression setting will slow down encoding with not much of an increase in compression ratio. The default setting is just right.

I'll recompile the FFmpeg executable while I'm at it as well.

vadosnaprimer commented 2 years ago

Alright!