Last century’s HQ video (part 2)
June 7, 2026
Part one explained how I got interested in creating DVDs from random video files. This part will detail my full workflow to create a DVD thanks to dvdauthor. I won’t cover adding menus just yet.
PAL-compliant video and audio
After encoding a few files more using my previous workflow, I encountered a file where PowerDVD would produce noise on the audio output. I wondered whether it could be caused by the frame rate not being exactly PAL-compliant. Last time, I said I don’t like changing the refresh rate of the video because it causes judder. I searched around a bit and found out that the common practice, coming from a 23.97 fps file, and going to 25 fps PAL, is to just speed up the video a little. Basically, you keep all the frames from the original video, they just display a little faster and the video ends up a little shorter. FFmpeg can do that with a video filter. Of course, other streams that should be synced with the video, such as audio and subtitles, also have to be adjusted accordingly. For subtitles, it’s quite simple as the times simply need to be interpolated to the target frame rate, and dvdauthor can handle it. For the audio streams it can get a bit trickier, because just speeding it up would cause its pitch to change. That can be bothersome with voices, for example. What seems to do the trick is to tell FFmpeg to process the audio stream at a slightly higher sample rate and then resample it down according to the DVD spec. I'm really out of my comfort zone on this one, but the results have been satisfying to me. This can be achieved with an audio filter. The bonus of all that is that the file is now exactly conforming to the DVD spec, which means we can use FFmpeg’s dedicated target. Furthermore, I’ve noticed that my files were always smaller than the size of a DVD, allowing me to ditch the 2-pass encoding, everything is done with one pass only:
$ ffmpeg -i in.mkv -vf "setpts=PTS*(24000/25025),fps=25,scale=720:1024*ih/iw:flags=lanczos,pad=720:576:(ow-iw)/2:(oh-ih)/2,setdar=16/9" -af "asetrate=48000*(25025/24000),aresample=48000" -target pal-dvd out.vob
The setpts video filter is what speeds up the video. It actually modifies the timestamp of each frame by a factor of 23.976/25. Because 23.976 is actually 24000/1001, we end up with a precise factor of 24000/(25000*1001). After that, the fps filter sets the video refresh rate to 25 fps. The audio part is similar with the asetrate filter, except here we are modifying a sample rate and not timestamps, so the factor is inverted. I don’t bother with subtitles at this stage because they’ll be muxed in later with dvdauthor. I actually use FFmpeg’s -map parameter to only include the video and audio streams in the output. That’s specific to each input file though.
As a side note, I've now encoded a few more videos, and some of them did not require refresh rate change. For those, FFmpeg seemed to be able to handle the resizing and cropping on its own, so the video filter and the audio filter could go away, yielding a much simpler invocation:
$ ffmpeg -i in.mkv -target pal-dvd out.vob
Adding the subtitles
Next, the subtitles. I want to add subtitles from a subtitle.srt file. DVD subtitles are actually bitmaps that the player displays on top of the video at the right time. dvdauthor includes spumux(1), a command line utility that can convert a text SRT file to bitmaps and mux them into the VOB file we created earlier. spumux(1) needs a configuration file for that, which we’ll call subtitle.xml:
<subpictures format="pal">
<stream>
<textsub filename="subtitle.srt" force="no" characterset="UTF-8" fontsize="20.0" font="DejaVuSans" movie-fps="25" subtitle-fps="23.976" movie-width="720" movie-height="570" horizontal-alignment="center" />
</stream>
</subpictures>
You should adjust the characterset and the subtitle-fps options according to your subtitle.srt file and the original video refresh rate, respectively. spumux(1) uses the two fps settings to interpolate the subtitles timestamps, as discussed in the previous section. As such, it is important to set those right. I’ve had great success with the DejaVu font at this size. In my opinion it produces a much cleaner output than the Liberation Sans font spumux(1) used as a default on my machine. You can check out all the available options in the man page. Once the XML file is ready, you can launch spumux(1) like so:
$ VIDEO_FORMAT="pal" spumux -s 0 subtitle.xml < out.vob > out_srt.vob
And now your SRT file is muxed into out_srt.vob. You can add several subtitle tracks by calling spumux(1) several times and incrementing the -s parameter by one each time, as this parameter is the subtitle stream unique ID. Actually, for the first subtitle stream, you can omit the -s parameter entirely, because 0 is its default value. Of course, each invocation should take the output of the previous as its input, and output to a new VOB file. The VIDEO_FORMAT environment variable is set to stop spumux(1) from complaining that the "default video format" is not set. We’re creating a PAL DVD, and we specified this in its configuration file already, but it seems to want this variable set anyway so I oblige…
Creating the DVD
We now have a VOB file with our video, audio and subtitle streams ready to be transformed into a DVD ready for burning. That’s where the dvdauthor(1) command comes into play. Like spumux(1), it is configured through a XML file, which we’ll call dvdauthor.xml:
<dvdauthor format="pal" dest="DVD">
<vmgm />
<titleset>
<titles>
<video format="pal" aspect="16:9" widescreen="nopanscan" />
<audio format="ac3" lang="fr" channels="6" />
<audio format="ac3" lang="en" channels="6" />
<subpicture lang="fr" />
<subpicture lang="en" />
<pgc>
<vob file="out_srt.vob" chapters="0,0:15:00,0:30:00,0:45:00"/>
</pgc>
</titles>
</titleset>
</dvdauthor>
This will create a simple DVD without menus. The video will start playing as soon as the disc is inserted into the player. As with spumux(1), all the available options are documented in the man page. The dest attribute at the top of the file sets the folder where the DVD files will be written. The video tag sets our video to be PAL with a 16:9 aspect ratio. The audio tags set two audio streams, one for French and another for English, each encoded with AC-3 codec using 5.1 channels. Those settings are what FFmpeg uses with its pal-dvd target. Next we have two subtitle streams, the first for French and the other for English. And finally the VOB file to write, here I set a chapter every 15 minutes, but you should set timestamps from the real chapters if you know them.