Wednesday, December 26, 2018

Tutorial - Using VapourSynth vs AVISynth+ for QTGMC: Round One

PLEASE NOTE: This tutorial is now significantly out of date. I've provided it only for historical reference, and am currently working on a followup. The instructions below WILL NOT WORK with current versions of VapourSynth.

Since I've had a few commenters on my videos ask about VapourSynth, I figured it was time to give it a look. For those who don't know, VapourSynth is a python-based video processing scripting system similar to AVISynth, and can actually use AVISynth plugins. My main interest in VS is that it has a native QTGMC port, and before AVISynth+ 64-bit got stable, VS has been a preferred method among some users for faster/more stable conversions.

It took me about a morning to get everything I needed and set up a sample script for QTGMC conversion. I decided to try to keep the setup as bloat-free as possible by using "portable" versions of the apps involved.

Here was my ultimate workflow. I won't try to explain everything since I'm not totally fluent in Python, but adapting the following settings should allow you to get it work:


BIG DISCLAIMER: This process may not work, may crash, or do other things to your system. Virus scanning all files is strongly encouraged, but not a 100% guarantee of safety.

You have been warned. 

If you're on a deadline (and using Premiere Pro, After Effects, or Final Cut Pro) probably your best best is to use a paid plugin like FieldsKit. And no, they aren't paying me to say that.

Also, this tutorial is for Windows 10. Most of the steps work for other OSes, but I won't cover the differences here.

Here's a video version of the tutorial:




First, grabbed the embeddable version of Python 3.7.X:
https://www.python.org/downloads/
(Click on the name of the latest version of Python 3.7, then scroll down to find the embeddable version.)

Then, downloaded the portable VapourSynth:
https://github.com/vapoursynth/vapoursynth/releases
(I'm using the 64-bit portable version.)

Then, grabbed VapourSynth Editor (VSEdit):
https://bitbucket.org/mystery_keeper/vapoursynth-editor/downloads/

Extracted the Python archive to a directory. Extract both VapourSynth and VSEdit to the same directory, in that order.

Now, for the needed plugins and VapourSynth Python modules:

FFmpegSource:
https://github.com/FFMS/ffms2/releases

havsfunc
https://github.com/HomeOfVapourSynthEvolution/havsfunc/releases
(The source code is what you want here.)

mvsfunc
https://github.com/HomeOfVapourSynthEvolution/mvsfunc/releases

adjust
https://github.com/dubhater/vapoursynth-adjust/releases

nnedi3_resample
https://github.com/mawen1250/VapourSynth-script
(Click on the "Clone or download button" and select "Download ZIP")

I also grabbed fmtconv for colorspace conversion:
https://github.com/EleonoreMizo/fmtconv/releases

Then, the VapourSynth versions of the needed QTGMC prerequisites:
https://github.com/dubhater/vapoursynth-mvtools/releases

https://github.com/dubhater/vapoursynth-nnedi3/releases
(You'll also need nnedi3_weights.bin from here. Left-click on the link, don't right-click/save)

Scanned all the above files for viruses.

Extracted the .py files in the main directory. Extracted the (64-bit) .dll files to the vapoursynth64/plugins directory

Opened VSEdit. Made the following initial script:
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
clip = core.ffms2.Source(source='F:\directory\\input movie.mov')
clip = haf.QTGMC(clip, Preset='Slower', TFF=False)
clip = core.resize.Spline36(clip, 720, 540, matrix_in_s='709')
clip.set_output()
Note that the final backslash before the input file name needs to be "escaped" with another backslash.

With the above settings, the source colorspace will be preserved, but the color matrix will be shifted to REC.709 on resize. To change both the output colorspace and color matrix, use:
clip = core.resize.Spline36(clip, 720, 540, format=vs.YUV422P10, matrix_in_s='709')
If you're coming from a source file with a non-recognized colorspace, you can use:
clip = core.fmtc.resample (clip=clip, css="420")
clip = core.fmtc.bitdepth (clip=clip, bits=8)
right after the ffms2 command.

Update: As UniveralAl1 mentions in a comment on the tutorial video, it may be possible to skip this by just converting once to YUV422p10 before QTGMC. The resulting script might look something like this:


import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
clip = core.ffms2.Source(source='E:\Archive\\input video.avi')
clip = vs.core.resize.Point(clip, format = vs.YUV422P10)
clip = haf.QTGMC(clip, Preset='Slower', TFF=False)
clip = core.resize.Spline36(clip, 720, 540)
clip.set_output()

Please try this first rather than the final script below.

All of the above ended up being necessary for the video file I selected for testing due to it using 4:1:1 chroma subsampling, so here is my final script:

import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
clip = core.ffms2.Source(source='E:\Archive\\input video.avi')
clip = core.fmtc.resample (clip=clip, css="420")
clip = core.fmtc.bitdepth (clip=clip, bits=8)
clip = haf.QTGMC(clip, Preset='Slower', TFF=False)
clip = core.resize.Spline36(clip, 720, 540, format=vs.YUV422P10, matrix_in_s='709')
clip.set_output()

Saving this script gives you a .vpy file.

To render it out, I used a combination of vspipe and FFMPEG as per the documentation. However, VapourSynth does not handle audio and video at the same time, so I had to use the mapping command in FFMPEG to copy over the audio separately:
vspipe --y4m Upscale.vpy - | ffmpeg -i pipe: -i "C:\pathto\inputmovie.mov" -c:v prores -profile:v 3 -c:a copy -map 0:0 -map 1:1 "F:\Temp\output file.mov" 

Preliminary testing gives me 67 fps average for VapourSynth and 77fps average for AVS+ using the following script:

SetFilterMTMode("QTGMC", 2)
FFmpegSource2("ITVS Trailer.avi", atrack=1)
ConvertToYV12()
AssumeBFF()
QTGMC(Preset="Slower", EdiThreads=3)
Spline36Resize(720, 540)
Prefetch(10)

The only difference I noticed in the resulting files was that bright red colors bled upwards in the VS encode, and downwards in the AVS+ encode. If I figure out more, will report back.

If you have any input or suggestions, feel free to leave a comment below.

Tuesday, December 11, 2018

Announcement: Adobe has brought (officially licensed) ProRes encoding to Windows versions of their video apps. This is not a drill.

Adobe just announced that officially licensed ProRes encoding is now available for Premiere Pro, After Effects, etc. on Windows. I just downloaded the update.

It works.

Finally.

Remember, if you can't afford the Creative Cloud All Apps subscription, you can still export (not officially licensed) ProRes files using FFMPEG or one of the many programs that uses FFMPEG for export. Just realize that some TV channels will not accept non-official ProRes files, so don't use FFMPEG as your final export if you're submitting to a major TV channel.

Anyways, my next tutorial was going to be about DNxHD/DNxHR encoding in FFMPEG for this very reason. I will now be looking for another topic.

Sunday, December 2, 2018

Tutorial - FFMPEG issues - Resizing color shift, Adobe weirdness, etc.

FFMPEG is an amazing program. I frequently use it to convert obscure video formats to something usable, export from AVISynth scripts, and swap audio tracks in and out of videos. It does have some quirks, however, and if you aren't on the lookout for them, they can change your video in ways you might not like. Here's a few of them:

BIG DISCLAIMER: This process may not work, may crash, or do other things to your system. Virus scanning all files is strongly encouraged, but not a 100% guarantee of safety.

You have been warned. 

Also, this tutorial is for Windows 10. Most of the steps work for other OSes, but I won't cover the differences here.

Here's a video version of the tutorial:


The SD to HD resizing bug


Resizing in FFMPEG is done via filters, which are specified by the -vf switch. -vf has so many filters it would be impossible to describe here, but the structure for how each is called is basically:

-vf "filter1=optiona:optionb:optionc, filter2=optiona:optionb:optionc"

Of course, you won't necessarily use that many (or even any) options depending on the filters you choose.

A simple resize and convert to ProRes 422HQ would be:

ffmpeg -i "inputvideo.mp4" -vf  "scale=1280:720:flags=spline" -c:v prores  -profile:v 3 -pix_fmt yuv422p10le -c:a pcm_s16le "outputvideo.mov"

Note how the resize comes before the codec setting. Order of commands is very important in FFMPEG, and putting things in the wrong order can result in errors or quality issues.

The above command would resize the source video to 1280x720 using the Spline resize method, similar to what I've used in AVISynth tutorials in the past. For more info on FFMPEG resizing, check out the wiki entry here:

https://trac.ffmpeg.org/wiki/Scaling

So what's the issue? Well, if you're resizing from a standard definition video (SD) to a high definition (HD) framesize, you might get a color shift... depending on the codec you use. In my testing, DNxHD/HR and H.264 have this issue, while ProRes does not. Check out the following frame grabs:

This is the original image from a DVD version of a documentary I worked on:


Yes, it's supposed to look like that. The DVD is encoded in anamorphic widescreen, when means it takes a 16x9 image and squeezes it to fit inside a 4x3 frame. Your DVD player can then un-squeeze the image back to 16x9 for widescreen TVs.


This is the video upscaled to 720p using FFMPEG:



Notice the color shift? It's subtle. It's most prominent on the lower-third graphic and the warden's face.

So, why is this happening? Basically, SD video conforms to a broadcast standard known as bt.601. HD video conforms to a very slightly different standard known as bt.709 (otherwise known as Rec.709). FFMPEG does not automatically correct for the differences between the two standards, and this results in a color/brightness shift.

Luckily, you can force the conversion by adding colormatrix=bt601:bt709 to the filters entry, like so:

ffmpeg -i "inputvideo.mp4" -vf  "scale=1280:720:flags=spline, colormatrix=bt601:bt709" -c:v dnxhd -profile:v dnxhr_hqx -pix_fmt yuv422p10le -c:a pcm_s16le "outputvideo.mxf"

and the result is this:



Viola! Image fixed.

However, don't use this filter unless you see a color shift. Otherwise, you might end up creating a color shift where one didn't exist before. Oh, and you can also convert the other direction as well if you're downscaling to SD from an HD video; just switch the options around:

colormatrix=bt709:bt601

Bottom line? Always check your exports before sending them out or dropping them in your edit timeline. You'll save yourself a lot of work later trying to manually correct them.

 

Color shifts in Adobe products


Update: the ProRes color shift I had up here before is gone in current nightly builds of FFMPEG. If you're still stuck on an older build that creates a color shift when the exported file is viewed in Premiere Pro or After Effects, use the prores_ks encoder rather than prores, and it'll correct the issue.

This glitch is a bit of a puzzler, frankly. Basically, FFMPEG's DNxHD/HR exports have a color shift, but only in After Effects and Premiere Pro.

This is really subtle, so I'm going to zoom in.

Here's the original:



And here's the DNxHD/HR encode viewed in After Effects:



If you still can't see it, use your left and right arrow keys (or tap on the pictures if you're on a mobile device) to move back and forth between the images. Basically there's a slight green/yellow shift.

Now, here's the kicker. If I import these files into DaVinci Resolve, they look identical.

So, what the heck? I'm not entirely sure. If I had to guess, I'd say that FFMPEG is generating metadata that Adobe programs don't like, but it could be something else.


Fortunately, after testing and Googling, I've figured out how to fix the color shifts.

All you have to do is change the container format to .mxf instead of .mov:

ffmpeg -i "inputvideo.mov" -c:v dnxhd -profile:v dnxhr_hqx -c:a pcm_s16le "outputfile.mxf"

And this is the result:




The only issue with the DNxHD/HR solution is that oddly enough, FFMPEG-generated .mxf files don't work in Resolve (and Assimilate Scratch Play). Resolve will refuse to load them, and Scratch Play will load but will only play the audio from the file. Adobe programs will handle them just fine. However, Resolve and Scratch Play will recognize and play back the .mov files with no color shift issues. 

So, yeah. Weird.

Saturday, December 1, 2018

Tutorial - Using FFMPEG for DNxHD/DNxHR encoding, resizing, and batch encoding

Before I begin, I'd like to acknowledge Jon Hall, whose recently deceased web page taught me how to set up FFMPEG in my system path. Also, a shoutout to /u/kichigai on the Reddit /r/editors subreddit for his excellent FFMPEG for editors FAQ:

https://www.reddit.com/r/editors/wiki/ffmpeg

If you want a comprehensive look at FFMPEG for a bunch of editing tasks, the above link is the way to go. If you want a video tutorial for a comprehensive FFMPEG setup, check out my tutorial for setting up FFMPEG 32-bit (along with an alternate install method for AVISynth+).

Or, you could try setting up both the 32-bit and 64-bit versions of FFMPEG (along with AVISynth+) at the same time.


BIG DISCLAIMER: This process may not work, may crash, or do other things to your system. Virus scanning all files is strongly encouraged, but not a 100% guarantee of safety.

You have been warned. 

Also, this tutorial is for Windows 10. Most of the steps work for other OSes, but I won't cover the differences here.



Regardless, I'm going to assume for the rest of this post that you already have FFMPEG installed.

First, let's start with a quick review of an FFMPEG command. Note that the line below doesn't actually run as written; this is just to show you the basic structure of the command:

ffmpeg -i "inputvideo.mp4" -c:v videocodec -c:a audiocodec "outputvideofile.mp4"

Simple enough, right? -i for input, -c:v for video codec, -c:a for audio codec, and then the name of the output file. There's a bunch of other options you can put in amongst this, but basically, this is the way the command is structured.


DNxHD, DNxHR, ProRes and Cineform are all what are known as "intermediate codecs". This means that they're designed to be used to transcode footage from other sources into a form that's easy for video editing programs to work with while maintaining quality. So, unlike most h.264 implimentations, they focus on low CPU usage, retaining as much detail as possible,  and an ability to be re-compressed several times without significant loss in quality. They have larger bitrates than consumer video codecs, but they still represent a significant space savings over fully uncompressed video.

DNxHD and DNxHR are Avid's intermediate codecs, designed to work well with Avid Media Composer, and as competition for ProRes. They have roughly equivalent quality to ProRes, but, like Media Composer, are organized in a more complicated manner.


DNxHD


DNxHD is the first variant of Avid's intermediate codec, and focuses (as the name suggests) on high-definition resolutions. It works great, but has an incredibly unintuitive naming system for different quality levels and resolutions based on the overall bitrate of the video. If you really want to take a look at the full list, check out this Wikipedia page:

https://en.wikipedia.org/wiki/List_of_Avid_DNxHD_resolutions

In FFMPEG, you need to set the bitrate properly in order for the built-in DNxHD encoder to work. Here's an example command using a 1280x720 h.264 .mp4 file running at 29.97fps:

ffmpeg -i "inputvideo.mp4" -c:v dnxhd -b:v 110M -pix_fmt yuv422p -c:a pcm_s16le "outputvideo.mxf"

Using the list of resolutions, we find that is the correct bitrate to output an 8-bit 422 chroma subsampled 720p video at 29.97fps is 110 megabits, which is denoted by that "110M" setting in the command.

Unfortunately, the official list of bitrates isn't exact. For example, looking at the list, you might assume that if you wanted to do 10-bit instead of 8-bit, you would think that you just had to change the colorspace to yuv422p10le (like we do for ProRes) and keep the bitrate the same. However, that will give you an error. Luckily, DNxHD errors in FFMPEG will list the correct range of supported bitrates. Let's take a look (cropped to relevant section and cleaned up a bit for readability):

Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p10
Frame size: 1280x720p; bitrate: 180Mbps; pixel format: yuv422p10
Frame size: 1280x720p; bitrate: 220Mbps; pixel format: yuv422p10
Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 110Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 180Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 220Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 60Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 75Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 120Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 145Mbps; pixel format: yuv422p

Unfortunately, this list doesn't display framerates, but you'll find that these bitrates work for any framerate within the same frame size and pixel format. In this case, the answer for 10-bit 720p/29.97fps is 180M. So, the command for a 10-bit output would look like this:

ffmpeg -i "inputvideo.mp4" -c:v dnxhd -b:v 180M -pix_fmt yuv422p10le -c:a pcm_s16le "outputvideo.mxf"

Just for reference, here's the complete list that FFMPEG spits out:

Frame size: 1920x1080p; bitrate: 175Mbps; pixel format: yuv422p10
Frame size: 1920x1080p; bitrate: 185Mbps; pixel format: yuv422p10
Frame size: 1920x1080p; bitrate: 365Mbps; pixel format: yuv422p10
Frame size: 1920x1080p; bitrate: 440Mbps; pixel format: yuv422p10
Frame size: 1920x1080p; bitrate: 115Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 120Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 145Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 240Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 290Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 175Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 185Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 220Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 365Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 440Mbps; pixel format: yuv422p
Frame size: 1920x1080i; bitrate: 185Mbps; pixel format: yuv422p10
Frame size: 1920x1080i; bitrate: 220Mbps; pixel format: yuv422p10
Frame size: 1920x1080i; bitrate: 120Mbps; pixel format: yuv422p
Frame size: 1920x1080i; bitrate: 145Mbps; pixel format: yuv422p
Frame size: 1920x1080i; bitrate: 185Mbps; pixel format: yuv422p
Frame size: 1920x1080i; bitrate: 220Mbps; pixel format: yuv422p
Frame size: 1440x1080i; bitrate: 120Mbps; pixel format: yuv422p
Frame size: 1440x1080i; bitrate: 145Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p10
Frame size: 1280x720p; bitrate: 180Mbps; pixel format: yuv422p10
Frame size: 1280x720p; bitrate: 220Mbps; pixel format: yuv422p10
Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 110Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 180Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 220Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 60Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 75Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 120Mbps; pixel format: yuv422p
Frame size: 1280x720p; bitrate: 145Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 36Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 45Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 75Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 90Mbps; pixel format: yuv422p
Frame size: 1920x1080p; bitrate: 350Mbps; pixel format: yuv444p10, gbrp10
Frame size: 1920x1080p; bitrate: 390Mbps; pixel format: yuv444p10, gbrp10
Frame size: 1920x1080p; bitrate: 440Mbps; pixel format: yuv444p10, gbrp10
Frame size: 1920x1080p; bitrate: 730Mbps; pixel format: yuv444p10, gbrp10
Frame size: 1920x1080p; bitrate: 880Mbps; pixel format: yuv444p10, gbrp10
Frame size: 960x720p; bitrate: 42Mbps; pixel format: yuv422p
Frame size: 960x720p; bitrate: 60Mbps; pixel format: yuv422p
Frame size: 960x720p; bitrate: 75Mbps; pixel format: yuv422p
Frame size: 960x720p; bitrate: 115Mbps; pixel format: yuv422p
Frame size: 1440x1080p; bitrate: 63Mbps; pixel format: yuv422p
Frame size: 1440x1080p; bitrate: 84Mbps; pixel format: yuv422p
Frame size: 1440x1080p; bitrate: 100Mbps; pixel format: yuv422p
Frame size: 1440x1080p; bitrate: 110Mbps; pixel format: yuv422p
Frame size: 1440x1080i; bitrate: 80Mbps; pixel format: yuv422p
Frame size: 1440x1080i; bitrate: 90Mbps; pixel format: yuv422p
Frame size: 1440x1080i; bitrate: 100Mbps; pixel format: yuv422p
Frame size: 1440x1080i; bitrate: 110Mbps; pixel format: yuv422p
You'll notice some 10-bit 444 color profiles in the 1920x1080p section. Don't use those unless you're coming from a 444 source, or you're wasting hard drive space.

DNxHR


So what about DNxHR? This is the more modern variant of DNxHD that supports a wider range of resolutions and color options. More importantly, it's way simpler to work with.

There's no need to specify bitrate, it will automatically use the correct one based on your input file. Unfortunately, most HR codec variants are only 8-bit, and will give an error if you try to convert to a different bit depth. The options for DNxHR are:

LB (roughly equivalent to ProRes Proxy)
SQ (roughly equivalent to ProRes LT)
HQ (roughly equivalent to ProRes 422)
HQX (roughly equivalent to ProRes 422HQ)
444 (you guessed it, roughly equivalent to ProRes 444)

Both the 444 and HQX variants use 10-bit color in HD or less, and either 10 or 12-bit color at 2K/UHD/4k resolutions. LB through HQX will always use 422 chroma subsampling, 444 will always use, well, 444 chroma subsampling. Still Confusing? You bet.

What's worse is that FFMPEG won't actually encode to 12-bit DNxHR HQX/444 or ProRes 4444XQ, it only supports 10-bit color depth.

That all said, here's a command that will give the same video quality as the first DNxHD command above, but using DNxHR:

ffmpeg -i "inputvideo.mp4" -c:v dnxhd  -profile:v dnxhr_hq -pix_fmt yuv422p -c:a pcm_s16le "outputvideo.mxf"

Notice how the codec variant is specified at the end of the profile option with an underscore before it.

If you wanted to transcode to HQX 10bit from a file with a different bitdepth/colorspace, you would do something like:

ffmpeg -i "inputvideo.mp4" -c:v dnxhd -profile:v dnxhr_hqx -pix_fmt yuv422p10le -c:a pcm_s16le "outputvideo.mxf"

To go to 10-bit 444, you would need to give it a 2K or larger resolution file and do:

ffmpeg -i "inputvideo.mp4" -c:v dnxhd -profile:v dnxhr_444 -pix_fmt rgb24 -c:a pcm_s16le "outputvideo.mxf"

As before, you generally don't want to use 444 unless you're coming from a 444 colorspace file, or a raw capture format that FFMPEG can understand. Otherwise, it's a waste of storage space, and is much slower to encode.

Oh, and if you're wondering how the FFMPEG DNxHD/HR encoder compares to the equivalent presets in Adobe Media Encoder, know that it's very close, but just slightly softer.

Wednesday, October 31, 2018

Tutorial - Installing 64-bit and 32-bit AVISynth+, QTGMC, and FFMPEG side by side

Hey folks - just wanted to let you know that this tutorial is now officially outdated.  I'm leaving it up here are for up historical interest, but here's a link to a post that I will maintain from this point forward with the current instructions for setting up AVISynth and QTGMC:



============================================



So, it turns out I made a mistake. I assumed that QTGMC still didn't work properly in 64-bit AVISynth, even though it had been over a year since I looked into it.

Not only does it work, it actually gives a 10%-20% speed boost during rendering.

However, there is one particular hitch that holds it back a bit: AvsPMod 64-bit throws up error messages when you use the video preview function. It's not a deal-breaker, but it's annoying. Hopefully, a newer version will come out soon. In the meantime, in the interest of both correcting my error and of finally putting the setup tutorial videos to rest, I'm going to show how to install and run the 32 and 64-bit versions of AVISynth+, QTGMC and FFMPEG side by side.


BIG DISCLAIMER: This process may not work, may crash, or do other things to your system. Always check your files before submitting/uploading them.

Virus scan everything you download. It's not a 100% guarantee that you'll avoid getting a malware infection, but it's a lot better than not checking at all.

You have been warned. 

Also, this tutorial is for Windows 10. Most of the steps work for previous versions of Windows, but may require slight modifications. Users of MacOS and other OSes should look elsewhere.


Here's the video version of the tutorial:



Also, I will be rushing through some of the initial steps for 32-bit AVISynth+, so if you'd like a little more depth, check out my original tutorial first, or check out my video version of that tutorial:





BIG DISCLAIMER: This process may not work, may crash, or do other things to your system. Virus scanning all files is strongly encouraged, but not a 100% guarantee of safety.

You have been warned. 

If you're on a deadline (and using Premiere Pro, After Effects, or Final Cut Pro) probably your best best is to use a paid plugin like FieldsKit. And no, they aren't paying me to say that.

Also, this tutorial is for Windows 10. Most of the steps work for previous versions of Windows, but may require slight modifications. Users of MacOS and other OSes should look elsewhere.





First of all, AVISynth+ installs both the 32-bit and 64-bit versions by default. You can grab it from here:

https://github.com/pinterf/AviSynthPlus/releases

Then, we'll need to get all the filters (plugins) needed:

FFMPEGSource

11/6/2018 Update: looks like Jiangmin antivirus is currently flagging FFMpegSource with a warning on VirusTotal. Given that no other antivirus engines have spotted anything, I'm cautiously calling this a false positive, especially because one of the top search results for Jiangmin on Google is a post about the problems with reporting false positives to them.

QTGMC

Don't forget to get all the "Core Plugins", along with 32-bit FFTW3 library as well.


If you need to sharpen the image, I recommend LimitedSharpen (Technically "LimitedSharpenFaster")

With all the AVISynth filters and scripts grabbed, it's time to get the supporting software:

AvsPMod

This is like an IDE for AVISynth scripts, and is pretty much essential IMO. Be sure to grab both the 32-bit and 64-bit versions.

FFMPEG

Update: since Zeranoe has shut down, I will be recommending compiling 32-bit FFMPEG from source using https://github.com/m-ab-s/media-autobuild_suite . Since this tutorial is getting a little long in the tooth any ways, I'll just leave this here as a placeholder until I create a newer and better version. You can get the 64-bit version here: https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-essentials.zip 

7-zip

If you don't have 7-zip already installed, you won't be able to open many of the downloaded archives. The version you get here doesn't matter, so maybe just do the 64-bit one.

After virus scanning everything, install:

7-zip (if needed)
AVISynth+

Just follow the default options in both cases. Then, go to the 32-bit plugins directory for AVISynth+. On my system, this is:

C:\Program Files(x86)\AVISynth+\plugins+\

Extract all .dll and .avsi files to the plugins directory from all plugins EXCEPT the fftw-3*.dll archive. If there's a choice between an x86 and an x64 version, use the x86 version. If there's a choice between AVX, AVX2 and a version without either, you'll need to know what instruction sets your processor supports. CPU-Z can tell you this if you're not sure.

Once that's done, do the same with the 64-bit versions of the plugins, except copy those to the "plugins64+" folder.

Now, open the fftw-3*.dll archive, then (as noted on the QTGMC page) extract the libfftw3f-3.dll file. Make a copy of it and rename it as "FFTW3.dll". Place the files "libfftw3f-3.dll" and "FFTW3.dll" in the SysWow64 folder.

Extract the 32-bit AvsPMod archive to wherever you want to run it from, and then extract the 64-bit version to a different directory. If you want to associate .avs files with AvsPMod, I would generally recommend doing so with the 32-bit version, but if you work primarily in 64-bit, then you should probably use that version.

Now, for the tricky part: setting up both the 32 and 64-bit versions of FFMPEG to run from any directory on your computer. We're going to do this with batch files. Also, kudos to Jon Hall's tutorial blog post on FFMPEG setup (currently defunct) for showing me basically how to do this.

First, open the 32-bit FFMPEG archive, then open the long-named folder within.

Create a folder somewhere on your system called "ffmpeg32". Personally, I put it in Program Files (x86).

Copy the "bin" and other folders from the opened FFMPEG archive to your ffmpeg32 folder.

Create a new text file, then rename it to "ffmpeg32.bat".

Right-click on the batch file and select "edit".

Write some version of the following into the notepad window:

@ECHO OFF
"C:\Program Files (x86)\ffmpeg32\bin\ffmpeg.exe" %*
Adjust the path as needed depending on where you installed 32-bit FFMPEG. Save, close batch file. Keep the explorer window showing the contents of your ffmpeg32 folder open.

Do the above steps for the 64-bit version of FFMPEG, except change the folder name to "ffmpeg64" and the batch file name to "ffmpeg64.bat". In the batch file, put some version of the following:

@ECHO OFF
"C:\Program Files\ffmpeg64\bin\ffmpeg.exe" %*
As you can see, I put ffmpeg64 in Program Files, but again, you can put it wherever you want.

Save, and close the batch file. Keep the explorer window showing the contents of your ffmpeg64 folder open.

Now, to add both versions of FFMPEG to your system path:
  1. Press the Windows and R keys.
  2. Type "control sysdm.cpl,,3". 
  3. Click "Run".
  4. Click on "Environment Variables".
  5. Select "Path" under "System variables" and click "Edit".
  6. Go to where your ffmpeg32.bat file is. 
  7. Select and copy the folder's path address from the address bar towards the top of the window.
  8. Back in the "Edit environment variable" window, click "New" and paste in the folder path. 
  9.  Repeat steps 6-8, but use the location of your ffmpeg64.bat file.
  10. Click OK on all the windows you opened to get here.
To make sure everything worked, open a command prompt (or Powershell, whatever your preference), then type ffmpeg32. If a long list of options is shown after a moment, cool. Do the same with ffmpeg64. If neither shows an error message like "command not found", you should be good to go.

Now, whenever you make your .bat file to run ffmpeg, you can specify whether you want to run the 32-bit version of both FFMPEG and AVISynth by calling ffmpeg32, like so:

    ffmpeg32 -i "videofile.avs" -c:v prores -profile:v 3 -pix_fmt yuv422p10le "output.mov"

If you want to run the 64-bit versions of FFMPEG and AVISynth, just call ffmpeg64 instead, like so:

    ffmpeg64 -i "videofile.avs" -c:v prores -profile:v 3 -pix_fmt yuv422p10le "output.mov"

PS: FFMPEG doesn't generate "official" ProRes files, so if it will be the last stop in your export chain, consider using a different workflow if the file is going to a major TV channel. Some channels have reportedly (on Reddit's /r/editors subreddit) said that FFMPEG ProRes files won't pass QC with them.

Wednesday, October 17, 2018

Tutorial - Alternate Setup for FFMPEG, Alternate Install for AVISynth+

Hey folks - just wanted to let you know that this tutorial is now officially outdated.  I'm leaving it up here are for up historical interest, but here's a link to a post that I will maintain from this point forward with the current instructions for setting up AVISynth and QTGMC:



============================================



There are a few setup options that I didn't cover in my last tutorial that I do on my own system to make my life easier when dealing with AVISynth and FFMPEG.

I like to set up FFMPEG to run on any folder on my system, as opposed to having to drop the ffmpeg.exe binary in the folder every time. I also like using the Univsersal AVISynth installer, which allows me to easily install/uninstall different versions of AVISynth, and is just generally cleaner than the official AVISynth+ installer.

DISCLAIMER: 

This process may not work, may crash, or do other things to your system. I check for viruses before using any software, but malicious hackers have been known to break into developer accounts and insert code into previously benign programs, and even regular programs can have bugs.

This is a post accompanying a YouTube tutorial. Video is here:



First, let's set up FFMPEG. I basically already covered this in my now-archived original method for setting up QTGMC, but here's a recap: 
  1. Download and virusscan the latest nightly 32-bit static build of FFMPEG. 

    Update: since Zeranoe has shut down, I will be recommending compiling 32-bit FFMPEG from source using https://github.com/m-ab-s/media-autobuild_suite . Since this tutorial is getting a little long in the tooth any ways, I'll just leave this here as a placeholder until I create a newer and better version. 

  2. Open the downloaded FFMPEG archive. Open the long-named folder within. 
  3. Create a new FFMPEG folder somewhere on your main drive. 
  4. Copy all the files in the opened archive folder to your new FFMPEG folder. 
  5. Press the Windows and R keys or go to the start menu and type "run" and click on the run option. 
  6. Type "control sysdm.cpl,,3". Click "Run". 
  7. Click on "Environment Variables". 
  8. Select "Path" under "System variables" and click "Edit". 
  9. Go back to your open folder where ffmpeg.exe is located. Select and copy the folder's path address from the address bar towards the top of the window. 
  10. Back in the "Edit environment variable" window, click "New" and paste in the folder path. Click OK on all the windows you opened to get here. 
When that's done, you can now run FFMPEG from any directory on your computer, and your .bat files that call FFMPEG will do the same.


Now, for the Universal AVISynth Installer (which I will refer to as the UAI for the rest of this post).

  1. Grab the UAI archive file from here. Virus scan it. 
  2. Open the file. You'll notice there's a folder inside called "AVISynthRepository". 
  3. Open another window with the location where you want the UAI to go. Copy the AVISynthRepository folder over to that location. 
  4. Close the archive window. Open up the folder from where you just copied it to. 
  5. Right-click on the setavs.bat and select "Edit". This will open the .bat file in Notepad. 
  6. Look for the line that says ":set AVS_SRC_DIR=%~dp0". Remove the colon so it now reads: "set AVS_SRC_DIR=%~dp0". Save and close Notepad. 
  7. Right-click on the .bat file and select "Run as administrator". Say yes to the UAC prompt. 
  8. Type 6, hit enter. 
  9. Open up the AVSPLUS_x86 folder, then the plugins folder. 
  10. Copy over all your desired AVISynth plugins (aka filters). 
  11. Set up any additional system .dll files as necessary.
To uninstall:
  1. Right-click on the .bat file and select "Run as administrator".
  2. Say yes to the UAC prompt. 
  3. Type 8 to uninstall any 32-bit versions of AVISynth.
  4. Type 9 to uninstall any 64-bit version. 
  5. Hit enter. Type y, hit enter. 

Please note that you can install 64-bit AVISynth+ either instead of or alongside the 32-bit version. Its filters would then go in the plugins folder inside the AVSPLUS_x64 folder. To preview a script with 64-bit filters, you'll need the 64-bit version of AVSPmod. To render using 64-bit AVISynth, you'll need to use the 64-bit version of FFMPEG. You can follow the above setup instructions for FFMPEG I've described above, or go to this post to see how to set up both the 32 and 64-bit versions at the same time and use either at will.



Bonus unnecessary info:

If you need to do step 11 of the setup process a lot, you can copy the files over to the directory of whatever version of AVISynth you're running (in the case of the above tutorial, AVSPLUS_x86), then add entries to the .bat file to have them copied over and uninstalled as part of the script. To do so, edit the .bat file.

For example, if I wanted to add the FFTW3 library files to the install, I would change:

) else (
echo copying %avs% files to "%WINDIR%\SysWow64"...
echo copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\SysWow64"

so it becomes:


) else (
echo copying %avs% files to "%WINDIR%\SysWow64"...
echo copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\FFTW3.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\libfftw3f-3.dll" "%WINDIR%\SysWow64"

To allow the installer to uninstall those files, I would change:

) else (
echo removing %avs% files from "%WINDIR%\SysWow64"...
del "%WINDIR%\SysWow64\avisynth.dll"
del "%WINDIR%\SysWow64\devil.dll"

so it becomes:

) else (
echo removing %avs% files from "%WINDIR%\SysWow64"...
del "%WINDIR%\SysWow64\avisynth.dll"
del "%WINDIR%\SysWow64\devil.dll"
del "%WINDIR%\SysWow64\libfftw3f-3.dll"
del "%WINDIR%\SysWow64\FFTW3.dll"

Friday, September 21, 2018

Tutorial - Deinterlacing and upscaling with 32-bit QTGMC revisited

Hey folks - just wanted to let you know that this tutorial is now officially outdated.  I'm leaving it up here are for up historical interest, but here's a link to a post that I will maintain from this point forward with the current instructions for setting up AVISynth and QTGMC:



================================================


After more than a year and a lot more experience with my SD to HD workflow, I’ve made a few changes. That means it’s time for an update.

Some of the larger changes include switching to AVISynth+ instead of standard AVISynth plus AVISynth MT, dropping the “source match” and “lossless” presets from QTGMC, and updating a whole mess of plug-ins. In total, these changes result in better speed, stability, and image quality.

BIG DISCLAIMER: This process may not work, may crash, or do other things to your system. I've had an issue with intermittent audio dropouts in the resulting files, but it seems to only happen with Quicktime ProRes files from a certain source. Always check your files before submitting/uploading them.

Virus scan everything you download. It's not a 100% guarantee that you'll avoid getting a malware infection, but it's a lot better than not checking at all.

You have been warned. 

If you're on a deadline (and using Premiere Pro, After Effects, or Final Cut Pro) probably your best best is to use a paid plugin like FieldsKit. And no, they aren't paying me to say that.

Also, this tutorial is for Windows 10. Most of the steps work for previous versions of Windows, but may require slight modifications. Users of MacOS and other OSes should look elsewhere.


Here's the video version of the setup and a basic QTGMC deinterlacing workflow:



And here's a video about cropping and upscaling:



 First of all, we're going to need to get AVISynth+. You can grab it from here:

https://github.com/pinterf/AviSynthPlus/releases

Then, we'll need to get all the filters (plugins) needed:

FFMPEGSource

This is what will allow AVISynth+ to load our video files. Works with almost any container/codec combination, but read the "Known Issues" section for things to look out for. Also, don't bother with the "10-bit hack version", as we won't be working in 10-bit color.

11/6/2018 Update: looks like Jiangmin antivirus is currently flagging FFMpegSource with a warning on VirusTotal. Given that no other antivirus engines have spotted anything, I'm cautiously calling this a false positive, especially because one of the top search results for Jiangmin on Google is a post about the problems with reporting false positives to them.

QTGMC

The deinterlacing plugin of choice. Requires a whole host of additional plugins, of which you will be using the 32-bit versions (if there's a choice). For most uses, however, only the "Core Plugins and scripts" are necessary. Thaks to one anonymous commenter, I should mention that if you're trying to import YUY2 colorspace video (some pro video codecs use this) without converting, you'll also need the AnimeITVC plugin.

Update: the 64-bit version of QTGMC and related programs are now stable, and slightly faster. You can find info on how to install those versions here:

https://macilatthefront.blogspot.com/2018/10/64-bit-avisynth-and-qtgmc-update-and.html

For the SmDegrain link, go to the page and click on the tiny "download" link next to the "raw" link. When you save the file to your computer, rename the .txt extension to .avsi.

If you decide to grab the optional plugins, then for the AnimeITVC pastebin link, select the text of the link and copy it, then right-click on the link and do "Save Page As", select "All Files" in the Save As drop-down box, paste the name of the file, delete any spaces from the front of the filename, then save the file. Most people won't need this plugin, thankfully.

Whatever you do, DO NOT forget to download the 32-bit FFTW3 library as well. Without it, QTGMC will not run.

If you need to sharpen the image, I recommend LimitedSharpen (Technically "LimitedSharpenFaster"). Get the x86 version in order for it to work within a script using 32-bit QTGMC.

With all the AVISynth filters and scripts grabbed, it's time to get the supporting software:

AvsPMod

This is like an IDE for AVISynth scripts, and is pretty much essential IMO. Grab the 32-bit version for this tutorial.

FFMPEG

Update: since Zeranoe has shut down, I will be recommending compiling 32-bit FFMPEG from source using https://github.com/m-ab-s/media-autobuild_suite . Since this tutorial is getting a little long in the tooth any ways, I'll just leave this here as a placeholder until I create a newer and better version. 


7-zip

If you don't have 7-zip already installed, you won't be able to open many of the downloaded archives. The version you get here doesn't matter, so maybe just do the 64-bit one.

After virus scanning everything, install:

7-zip
AVISynth+

Just follow the default options in both cases. Then, go to the plugins directory for AVISynth+. On my system, the default installer creates a plugin folder at

C:\Program Files(x86)\AVISynth+\plugins+\

Extract all .dll and .avsi files to the plugins directory from all plugins EXCEPT the fftw-3*.dll archive. If there's a choice between x86 and x64, use the x86 version. If there's a choice between AVX, AVX2 and a version without AVX, you'll need to know what instruction sets your processor supports. CPU-Z can tell you this if you're not sure.

Now, open the fftw-3*.dll archive, then (as noted on the QTGMC page) extract the libfftw3f-3.dll file. Make a copy of it and rename it as "FFTW3.dll". Place the files "libfftw3f-3.dll" and "FFTW3.dll" in the SysWow64 folder. Don't ask me why you have to do this, I agree that is seems pointlessly tedious.

Extract the AvsPMod archive to wherever you want to run it from.

Finally, open the ffmpeg archive, navigate to the "bin" directory, and extract the ffmpeg.exe file to whatever directory your video file/files are located in.

Alternatively, you can extract the archive to somewhere on your system and then set up FFMPEG to run from any directory by adding it to your PATH variable:
  1. Press the Windows and R keys.
  2. Type "control sysdm.cpl,,3". 
  3. Click "Run".
  4. Click on "Environment Variables".
  5. Select "Path" under "System variables" and click "Edit".
  6. Go to where you extracted ffmpeg.exe. 
  7. Select and copy the folder's path address from the address bar towards the top of the window.
  8. Back in the "Edit environment variable" window, click "New" and paste in the folder path. Click OK on all the windows you opened to get here.
Now that everything's ready, let's go to the directory with your video files and make an .avs script. Right-click anywhere in the directory, select New, then AVISynth Script. Alternatively, you can just create a new text file and chance the .txt extension to .avs.

Right-click on the .avs script, choose "Open With", then "Choose Another App", then check "Always use this app to open .avs files", then scroll down the list of apps until you see "More Apps". Click on that, scroll some more until you see "Look for another app on this PC". Click on that, navigate to where you extracted AvsPmod, select avspmod.exe and click OK. Your .avs scripts will now automatically open in AvsPMod when you double-click on them.

In a few moments, you should now see your blank script open in AvsPmod.

Here's my boilerplate .avs script settings for deinterlacing:

    SetFilterMTMode ("QTGMC", 2)
    FFMPEGSource2("videofile.avi", atrack=1)
    ConvertToYV12()
    AssumeBFF()
    QTGMC(preset="Slower", EdiThreads=1)
    BilinearResize(720,540)
    Prefetch(10)


The Prefetch number should be set to 1 or 2 less than the number of "logical processors" in your system. To check what that is, go to Task Manager in Windows, select the Performance tab, then click on the CPU item. You'll see down below in the window an entry for the number of logical processors in your system. For some people, it will be the same as the number of physical cores, for others it might be double that if your CPU supports Hyperthreading. In my case, I have 12 logical processors, so I set Prefetch to 10.

On the other hand, EdiThreads is supposed to be set to half the number of physical cores in your system, and if so can give a mild speed boost. With the current workflow, I've been able to set it to 3 with no issues, but your mileage may vary. If you experience any random rendering freezes (not overall system freezes), then lower this number first.

Also, a quick note here: Amazon and some other streaming services prefer 640x480 over 720x540 for SD content. I use the latter because I consider the resulting file a new "master" file that can be used to create future derivative versions, but if you're going to send the file directly to a distributor or service, read/ask for their deliverables spec to see what resolution and framerate they want.

If you need to output 29.97fps rather than 59.94fps at this stage, then add FPSDivisor=2 to the QTGMC command like so:

    QTGMC(preset="Slower", FPSDivisor=2, EdiThreads=1)

Anyways, here's what to add if you want to upscale to HD with a center crop:

    Crop(0,68,0,-68)
    Spline64Resize(1280,720)

Note that the numbers in the crop command refer to left,top,right,bottom respectively, and the right and bottom numbers are negative, while the left and top numbers are positive. Don't ask me why AVISynth does this, it just does.

The above settings will give you as close to a 16x9 frame as you can get out of this resolution. Technically, 720x405 is true 16x9, but the crop command doesn't like odd numbers, so 720x404 is the closest you can get.

Also, this may crop off more than you want, so feel free to play around with the settings. If you want to frame a different part of the image (like the top or bottom versus the middle), then just adjust the crop numbers accordingly by adding what you subtract from one number to the other, or vice versa. For example, to use just the top part of the frame, you would do:

    Crop(0,0,0,-136)

If your initial video has noticeable compression artifacts, you might want to do BilinearResize instead of Spline64Resize to avoid accentuating said artifacts. If it's clean and you want to sharpen even more, LimitedSharpenFaster does a a good job of this.

    LimitedSharpenFaster()

It has a ton of additional features listed on the wiki page, which you can play around with if the defaults don't work for you.

Loading this script in AvsPmod will let you preview your results, and change to your preference. To preview your settings, click anywhere on the playback bar at the bottom of the window. The first time you do this, FFmpegSource will index your file, so be patient. When you're done, don't forget to save your work.

Create a new text file in the same directory and change its extension to .bat. Add the FFMPEG commands of your choice. For example, here's a command to encode an .avs script to a ProRes 422HQ Quicktime file:

    ffmpeg -i "videofile.avs" -c:v prores -profile:v 3 -pix_fmt yuv422p10le "output.mov"

If you need to convert to a different video format, search for options and further instructions on the FFMPEG Wiki.

PS: FFMPEG doesn't generate "official" ProRes files, so if it will be the last stop in your export chain, consider using a different workflow if the file is going to a major TV channel. Some channels have reportedly (at least according to editors on Reddit's /r/editors subreddit) said that FFMPEG ProRes files won't pass QC with them.

Friday, February 2, 2018

Tutorial - Using ShotCut as a ProRes transcoder

After the complexity of my previous tutorials, I thought I'd do something simpler this time, just in case there are some of you who aren't a fan of the complex AVISynth-FFMPEG workflow. It just uses one program, and a minimum of steps.

The program in question is ShotCut, a free, open-source editing program for Windows, MacOS and Linux. Like a lot of other open-source video editing apps, it uses the MLT Engine for timeline playback/editing, and FFMPEG for export. Unlike most of those apps, the Windows port is pretty stable, even with heavily compressed h.264 footage.

ShotCut is a fairly simple program, but it does have enough features that it can be used as a decent replacement for Windows Movie Maker or any of the slew of $15-$50 editing programs that flood the internet. It'll do multi-track editing, text, some basic color correction, and even supports some video output cards/devices like the Blackmagic Intensity Pro. If you're interested in learning how to do that, The ShotCut site has a tutorials page that's fairly comprehensive. For the purposes of this tutorial, I'm just treating ShotCut as a transcoding program.

BIG DISCLAIMER: 

This process may not work, may crash, or do other things to your system. I check for viruses before using any software, but malicious hackers have been known to break into developer accounts and insert code into previously benign programs.

If you are working on a professional production, the results may or may not be acceptable, especially if you're trying to send out a ProRes master to a TV station. Their QC department may reject ProRes files that haven't come from an official, licensed-by-Apple encoding app.

You have been warned. 



First, download ShotCut. I personally think the installer is the way to go, but if you want more control over were it installs everything, then you can grab the "portable" version.

Next, virus scan the file using VirusTotal or a major anti-virus/malware scanning program.

Then, install ShotCut. This is pretty easy, basically just click "next" a few times, then "finish". If you went with the portable version, extract the files into your location of choice.

Once ShotCut is installed, run it. You'll see a fairly simple interface with a few buttons at the top. At the moment, it's just showing the Source panel, and that's all we'll need to get started. Drag your video file of choice onto the blank area, and it will load and start playback. Pause it with the spacebar.

Click on the Export button, which will bring up the Export panel. Make sure that the resolution and framerate settings match your video file, then scroll the list of codecs on the left to get to "Intermediate-ProRes" and select it. If you want to change the subtype of ProRes, click on the Other panel and change the "vprofile=" number to your preference. If you need a refresher from the FFMPEG tutorial:

0 = ProRes Proxy
1 = ProRes LT
2 = ProRes 422
3 = ProRes 422HQ

If you change the codec to "Intermediate-ProRes-Kostoya", then you can also do:

4 = ProRes 444

Once you're happy with the settings, hit the Export button, name your file and save. Rendering will start, and once it's done, you should be good to go.

Best of all, because you didn't add anything to a timeline, you won't get a prompt to save your work when closing ShotCut.

The caveats to this process are that the encoder is slow - I only get about the equivalent of one core's performance, which is far slower than command-line FFMPEG. Not sure why that is, although I suspect it may have something to do with a bottleneck between the MLT engine and FFMPEG.

Also, deinterlacing is performed using YADIF, so don't expect the kind of high-res interpolation that AVISynth+QTGMC can provide, and don't expect it to frame-double. It's fine for quick and dirty conversions, but for pro work, you might want to consider using either the AVISynth+QTGMC method or Premiere Pro or Final Cut Pro X with the FieldsKit plugin installed.

Oh, and don't try to deinterlace and upscale. In my experience, it causes a chroma/colorspace shift. Upscaling progressive video should be fine, but check before using the exported video just in case.

UPDATE: I found the problem with upscaling, and it's a bug in FFMPEG. Solutions to it and other issues are covered in this post.

You can actually encode a number of different video files, but I don't recommend it. To do so, click on the Playlist button to give you a Project bin-like place to drop multiple files. Drag your files over, then switch to the Export panel. In the "From" drop-down, select "Each Playlist Item", then proceed as if you're working with a single file.

There are some significant downsides to encoding multiple files at once. You need to have the exact same resolution and framerate settings for all the files in the playlist, or the files that don't match the preset will be converted to those settings. It also doesn't automatically carry over the filenames from the original files, and will only let you enter a single filename for the exported videos with a "-1", "-2", etc appended to the end.

Which deinterlacing algorithm is the best? Part 1 - HD interlaced footage

Before I began, I'd like to give a special thanks to Aleksander Kozak for his help in testing and providing the HD footage used in this ...