So, I offered a favor to a user of a message board I frequent, and it turned out to be a fantastic learning experience.
As always, it started with arrogance.
They were wanting a video file converted. Basically, they wanted to replace the unsubtitled version of the opening animation for Disgaea 2 with a subtitled version using an srt they’d whipped up, but didn’t know how.
I assumed this would be a done-in-5-minutes handbrake job and I could feel good about myself.
So, they sent me a copy of the opening and their srt file, and I threw them into handbrake and told it to burn the srt into the video, and this took all of about 2 minutes start to end including encode time.
…then I looked at the result. It was not pretty. Handbrake had, for some reason, skipped the first subtitle. The video was also AWFUL. It was 1920×1080 video but had obviously started with a 640×480 source and been stretched to that size. I moved over to a PC and repeated the encode, and this time the first subtitle was there (so that may have been an issue with Mac handbrake) but the video was still awful.
I downloaded the demo for the game and took a look at my options. The opening animation was in the install folder as an ogm file at its original resolution and aspect ratio, so I pulled it out and ran IT through handbrake.
Video better. Subtitles, all present. Subtitle timing ridiculously bad, as the video from the game omitted an opening title that was present in the awful video. My smugness was fading.
Manually adjusted all timings in the srt. Ran again. Still off. Manually adjusted again. Still off.
Realized that handbrake has a way to change srt timing from within the handbrake application rather than needing to manually edit all the timings in the srt. Tweaked it a little. Timing was now reasonably decent, video looked good, I had a pretty solid m4v file that represented a subtitled version of the Disgaea 2 opening and I was starting to get my smug back.
Ran the m4v through ffmpeg to make an ogv file out of it, renamed to ogm, dropped into the Disgaea 2 folder, started the game… and got audio, but no video.
Took another look at the original file, realized that it used a yuv444p pixel format instead of yuv420p. I have never needed to mess around with pixel formats before and I’m not actually sure what the numbers MEAN, but I figured out how to adjust the pixel format in ffmpeg and encoded it for about the seventh time and dropped it into the game folder… and it worked.
So, very educational if a little humbling. I’ll probably never NEED to know how to make a yuv444p ogm file again but if I do, this post will be here to remind me.