Where/when should I specify unsharpen when converting images to video? Edit: its not liking it when I specify .exr as the output file....not sure if there's a fix to support exr in ffmpeg. Just pretends its .png then unless you can help with that as well

Hi so I transcoded a 30 min video into a 16 bit 1080p.exr image strip. I then plan on upscaling these images with ffmpeg to 4k. I then want to render it out again as an 8 bit h.264 .avi.

Somewhere here I want to apply sharpening to make the upscale a bit cleaner (this command looked nice when applied to the exr on their own):

-filter "unsharp=1x=13:ly=13"la=2.0"


Will unsharpening re-encode? Because my final video output is h.264 8/10bit I don't want to re-encode that.   

My question is where in my commands should I be applying the unsharp? And should I only apply it once or as many times throughout that it makes things look nice?

I thought for simplicity I would divide my commands up, but maybe they should be done as a single command? Will a single command lessen the number of re-encodes any?  

Step 1. Upscale:

ffmpeg -i %d.exr -vf scale=3840:-1 C:\Users\Me\Desktop\Test\output_3840.exr


Step 2: Turn images into .avi (not sure if this works for avi, i kno it works for mkv tho)

ffmpeg -framerate 500/21 -i %d.exr -c:v libx264 -crf 18 -pix_fmt yuv422p10le output.avi


Step 3: Unsharpen...but when/where?

-filter "unsharp=1x=13:ly=13"la=2.0"


I'm not even sure how to combine these, or like I said if doing so will limit the re-encodes. Is there a single command I can/should be using here based on the 3 above? I'll just do the audio as a separate command with -c copy so it doesn't re-encode, it makes it less confusing for me.
Just do it all as one step and forget about up-sampling to 16 bit. That just adds complexity, processing time, extra storage and for no gain in quality in the end result that anyone could possibly perceive. 

fmpeg myinputVideo.avi -vf "scale=3840:2160,unsharp=1x=13:ly=13"la=2.0" myoutput.mp4


The internal process of ffmpeg works basically like this: 

 _______              ______________
|       |            |              |
| input |  demuxer   | encoded data |   decoder
| file  | ---------&gt; | packets      | -----+
|_______|            |______________|      |
                                           v
                                       _________
                                      |         |
                                      | decoded |
                                      | frames  |
                                      |_________|
 ________             ______________       |
|        |           |              |      |
| output | &lt;-------- | encoded data | &lt;----+
| file   |   muxer   | packets      |   encoder
|________|           |______________|


The "decoded frames" box basically is where the pixels in the image are stored in memory as uncompressed RGB or YUV (or whatever) samples. That's the point where your footage is as good as it is going to get. Any extra filtering or processing will notionally degrade the image due to quantisation loss, or compression etc.. That image is what is sent to the filter chain. What you're doing is:

demux → decode → [decoded frames] → resample → encode → mux → save → 
demux → decode → [decoded, resampled frames] → upscale → sharpen → encode → mux → save


so you're applying your filters to frames that have had an extra resample and encode step added, not to mention taking up a whole bunch'a space on your HDD.

When you filter something the output of one filter goes to the input of the next filter in the chain, so if you put scale first the scaled image is then sent to the sharpen filter. 

 _______        ________        _________        ________
|       |      |        |      |         |      |        |
| input | ---&gt; | scale  | ---&gt; | sharpen | ---&gt; | output |
|_______|      |________|      |_________|      |________|


You can get more complex by using -filter_complex which allows you to have various inputs and outputs for filters.

https://ffmpeg.org/ffmpeg.html#Filtering for more ascii-art empowered knowledge