Upscaling recorded DOSBox video captures - CMD

Tools, assembly, and file formats.
Post Reply
User avatar
Nisaba
Posts: 310
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Upscaling recorded DOSBox video captures - CMD

Post by Nisaba » Fri Nov 18, 2016 7:39 am

keenmaster486 (PCKF) wrote:Yeah, that's what I was using before, and it works very well - except it outputs at actual resolution, which in my case is 320x200. It doesn't scale very well on YouTube; you end up with a lot of compression artifacts. So I looked into using programs like VirtualDub to scale it up, but right now I'm running Ubuntu and I'm too lazy to make it work with Wine or reboot my computer.
...another way to upscale your videos is using FFmpeg. I favour this over VirtualDub, Handbrake & Co cause you can choose and customize the parameters more precise for your own needs. besides that it is the best way of keeping it pixel perfect without any artifacts.
also this method is cross platform but therefor without a GUI (you have to use the CMD if you are on Windows, for Mac and Linux it is the Terminal).


For Windows users:
  • 1. Download the FFmpeg [/color]here.
  • 2. run the included Batch-file
  • 3. implement and add the following parameters.

    Code: Select all

    ffmpeg -i in.avi -sws_flags neighbor+full_chroma_inp -s 1280x800 -r 30 -vcodec libx264 -crf 20 -acodec libmp3lame -aq 2 -f mp4 out.mp4
  • 4.a) Change the parameter in.avi to the path where DosBox saves its video recodings. by default this is C:\Users\YOUR-USERNAME\AppData\Local\DOSBox\capture\keen4e_001.avi
  • 4.b) Change the parameter out.mp4 the a path of your choice.
  • 5. Press Enter and wait until the upscaling is done (speed depends on you hardware equipment though)
    Of course you can just save all those within an own Batch-routine if you wish.
[/color]

For Linux users (Debian/Ubuntu):
  • 1. Get FFmpeg from the official packages or type:

    Code: Select all

    sudo apt-get install ffmpeg && sudo apt-get install libavcodec-extra
  • 2. Next type into your terminal the following command:

    Code: Select all

    ffmpeg -i in.avi -sws_flags neighbor+full_chroma_inp -s 1280x800 -r 30 -vcodec libx264 -crf 20 -acodec libmp3lame -aq 2 -f mp4 out.mp4
  • 3.a) Change the parameter in.avi to the path where DosBox saves its video recodings. by default this is ~/.dosbox/capture/keen4e_001.avi
  • 3.b) Change the parameter out.mp4 the a path of your choice.
  • 4. Run it and wait until everything is done.

    Attention: by default, DOSBox’ video capturing feature is triggered by pressing Ctrl-Alt-F5 simultaneously. Unfortunately this key combination will never reach DOSBox, as it will typically get intercepted by the X server and drop you to the 5th text console instead. So you first wanna change the combination for the video capturing. Therefor open DosBox, press Ctrl+F1 (or run it via Terminal: dosbox -startmapper). Then map the keys to your liking.
[/color]



Some general Parameter explanation:
  • in.avi - - > name and path of the source video you recorded with DosBox
  • out.mp4 - - > is the name of your upscaled and muxed output container.
  • 1280x800 - - > the output solution in pixel. I recommend to use multiples of 320x200 (for eg. 640x400, 960x600, 1280x800...)
  • sws_flags - - > controls the software scale
  • neighbor+full_chroma_inp - - > lets the scaler perform nearest neighbor interpolation and forces it to take the full input chroma resolution into account
  • -r 30 - - > the output frame rate
  • -vcodec libx264 - - > determines the video encoder
  • -acodec libmp3lame -aq 2 - - > codec for a variable bitrate mp3 stream
super easy, super effective as long as you are not afraid of using some command-lines.
and if this isn't already enough for your the ffmpeg homepage features a beautiful documentation with tones of parameters and further information: Link
also please visit Ingomar Wesps page where most of those information came from.

Post Reply