Apple ProRes 422 HQ to .mp4 for YouTube

prairiedogpics wrote on 5/18/2015, 7:55 PM
Hi All,
I just had some Super 8 film scanned; the final scan is a 1920x1080 24 fps .mov file (Apple ProRes 422 HQ).

I can load it into Vegas 10 just fine, but whatever render I do to a 1080p .mp4 file shows a lot of blocky artifacts and increased contrast.

I would really like to preserve the (finer) grain of the Tri-X film in the final render, but I can't seem to get a very decent looking render...

Any render settings suggestions for a high quality 1080p render for YouTube from this Apple ProRes file?

Comments

john_dennis wrote on 5/18/2015, 8:12 PM
Which render template are you using? Mainconcept AVC/AAC or Sony AVC/MVC?
prairiedogpics wrote on 5/18/2015, 8:28 PM
Doesn't matter to me...whichever will lend better quality for YouTube...

So far I've tried this method, changing the script (as I understand it) for 1920 x 1080 (instead of 1280 x 720)...:

http://www.bubblevision.com/underwater-video/Vegas-YouTube-Vimeo.htm#MeGUI

EDIT: video link removed

Not bad, but I still think it could be better...the film grain as I view it in Vegas is finer...
john_dennis wrote on 5/18/2015, 8:52 PM
So the encode from Vegas Pro 10 and the re-encode at youtube is exacerbating the grain (noise)?

This is blasphemy, but maybe you should minimize the noise before the render. Nick's method produces better results at low bit rates than either of the encoders in Vegas 10.

What bit rate is the file that you upload to youtube?
musicvid10 wrote on 5/18/2015, 9:06 PM
You won't get grain or superfine detail to play right on Youtube.
The reason is that grain is the biggest bandwidth hog present in interframe encoding, and YouTube has to fit as many simultaneous streams into the pipe as it can.

For example, a grainy movie like Fargo might end up three times larger than is typical for h264 movies of the
same temporal quality.

So your Tri-X grain (which used to be cursed rather than coveted), is simply rendered to mushy artifacts; my water-motion video suffered the same fate on YT. Unfortunately, most of these x264-like encoders probably have no minimum bitrate control.
NickHope wrote on 5/19/2015, 2:49 AM
I would try denoising it in AviSynth with MDegrain3, which can really work wonders. In theory you could put this code into the same AviSynth script you've already used, but it might get a bit unwieldy. Maybe better to render to a lossless intermediate .avi file. My current codec of choice is MagicYUV.

Here's a script I've used successfully, and included sharpening after the denoising. I used LimitedSharpenFaster instead of the more recent LSFmod which I normally use. Can't remember why. Try LSFmod first and fall back to LimitedSharpenFaster if there's a problem.


SetMemoryMax(1024)
SetMTMode(3, 6)

#JAN 2013 - I JUST COULDN'T GET LUMINANCE RIGHT WITH DIRECT FILE OPENING. ONLY BY FRAMESERVING
AviSource("d:\fs.avi")

SetMTMode(2)

ConvertToYV12 #For frameserved RGB to lossless avi in VirtualDub

super = MSuper()
#super = MSuper(pel=2, sharp=1) #Parameters set in an old example on the MVTools page

backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
backward_vec4 = MAnalyse(super, isb = true, delta = 4, overlap=4)
forward_vec4 = MAnalyse(super, isb = false, delta = 4, overlap=4)
backward_vec6 = MAnalyse(super, isb = true, delta = 6, overlap=4)
forward_vec6 = MAnalyse(super, isb = false, delta = 6, overlap=4)

# Higher thSAD = more denoising. Default 400 works well on 1080p. 600 works well on DV. 800 for very heavy DV grainy noise.
# Set thSCD1higher than default 400 to stop heavy noise triggering scene change
MDegrain3(super,backward_vec2,forward_vec2,backward_vec4,forward_vec4,backward_vec6,forward_vec6,thSCD1=400,thSAD=400)

LSFmod(strength=300) #Sharpen - 300 works well - try 200 to 500. If this line fails, try the line below
#LimitedSharpenFaster(strength=300)

#Render 1080p in VirtualDub with lossless codec


p.s. Of course, this doesn't help you retain the grain look. There are ways to add grain back in in AviSynth etc., but as others have observed, this will likely lead to problems when encoded for the web.
musicvid10 wrote on 5/19/2015, 4:16 AM
I agree with Nick that some denoising will improve temporal quality greatly because the available bits won't be hijacked chasing grain.

NLMeans is showing promise in Handbrake although it's a bit weak and slow.
The old standby, Neat Video, is worth a look also.

Streaming HD video and preserving grain might be more feasible when we're receiving hevc over gigabit connections.
prairiedogpics wrote on 5/19/2015, 8:45 AM
Gotta love this forum! I wake up to find some great insight from all the veterans. Thx so much!

I'll poke around with some of your suggestions (although I'm no wiz with Avisynth; I'm just decent at following tutorials...)

One question for musicvid10: when you say that denoising will improve "temporal quality"...what, in layman's terms is "temporal quality"?

Thanks again all of you for taking the time to respond. :-)
musicvid10 wrote on 5/19/2015, 11:03 AM
Temporal means "over the course of time," same root as "temporary."
I use it to describe compression artifacts because they often affect individual or small groups of frames, so the effect of viewing over time is worse than might show up in an individual frame.

Here's my Luminance/RGB clipping demo that fails miserably on Youtube at 00:10 and again at 00 :25 because of bit saturation. It's useless on YT, yet the original mp4 is tack-sharp. High-complexity stuff just can't handle the stream compression, yet.



prairiedogpics wrote on 5/19/2015, 12:21 PM
So, forgetting YouTube for a moment...is there a way to stream an Apple ProRes 422 HQ .mov file to my HDTV (outside of using the "external monitor" function in Vegas)?

I just really want to watch the original scan in all its glory on my 1080p HDTV. Any way to change/convert the .mov wrapper losslessly so you can stream the file or burn and play it from disc on, say, a PS3?

Otherwise, what good is the scan if any conversion (render) is going to introduce artifacts? How does Hollywood deal with film scans to digital without artifacts? $$$ and big equipment you'll probably say... ;-)
john_dennis wrote on 5/19/2015, 12:38 PM
Since I don't have any Apple devices, I can't watch MOV files from my camera without a render. I render to the Mainconcept AVC/AAC Blu-ray 1920x1080-24p, 25 Mbps template. I use AC3 for the audio as separate elementary streams and mux them together into an .m2ts wrapper. All my Blu-ray players and TVs play these files without complaining. (Wireless can be problematic, but I have a wired network.) Windows Media Player will even stream these files using Right-Click - Play To.

The same can be done using the Sony AVC/MVC render template but only up to 21.9 Mbps.

I also encode using One-click frameserving from Vegas to Handbrake found on the forum.
prairiedogpics wrote on 5/19/2015, 12:52 PM
Yes, I did render to a Blu-ray elementary stream last night; can't remember if it was Sony or MC...I played the file on the desktop and it looked horrendous..But I will try again tonight making sure to use MC and will burn it to disc this time.

I do have an iPhone and an Apple TV...I'll try dumping the .mov file into iTunes for streaming from the PC to Apple TV to HDTV, but I'm doubtful that will work...

Thanks for the suggestions.
john_dennis wrote on 5/19/2015, 1:12 PM
Your file may be 24p while the Blu-ray templates are 23.97. Turn off resample? Use 25 Mbps.
balazer wrote on 5/20/2015, 4:50 PM
"I just really want to watch the original scan in all its glory on my 1080p HDTV. Any way to change/convert the .mov wrapper losslessly so you can stream the file or burn and play it from disc on, say, a PS3?"

ffmpeg can do a very high quality conversion from ProRes to 8-bit h.264. It's not lossless, but it's about as good as you can get for a playable file.
ffmpeg -i prores_input.mov -vcodec libx264 -x264opts qp=14:ipratio=1:pbratio=1:keyint=17 -pix_fmt yuv420p -b:a 256k output.mp4


You can do a lossless conversion from ProRes to 10-bit uncompressed YUV AVI, which Vegas can read:
ffmpeg -i prores_input.mov -vcodec v210 output.avi
You could then use Vegas to convert that to XAVC Intra or XAVC Long, to save space. That conversion preserves the source's 10-bit precision if you do it in a 32-bit project.

I use Zeranoe ffmpeg.

Quicktime files are decoded very poorly in Vegas. An inexplicable gamma shift is added, it decodes with low precision resulting in bad banding, and doesn't always use the right Y'CbCr to RGB conversion matrix. Quicktime for Windows is a disgrace. If you care at all about quality, you should always transcode or transmux to a format that Vegas can read natively.


Rendering with Handbrake is nice and all, but frame serving from Vegas quantizes to 8 bits RGB before the conversion to Y'CbCr. That's an unnecessary and lossy conversion that doesn't happen when you render directly from Vegas in a 32-bit project. XAVC S is my go-to renderer, with very high quality at 50-60 Mbps for HD. XAVC S files can be played directly or uploaded to YouTube. If you need lower bit rates, you'll get the best quality by first rendering to uncompressed YUV or XAVC S or 80-Mbps MPEG-2 and then transcoding with ffmpeg to a lower bit rate.
prairiedogpics wrote on 5/22/2015, 8:54 AM
Thx, balazer, I'll check it out!
Wolfgang S. wrote on 5/23/2015, 8:01 AM
You could also use the free Cineform codec, available if you install the free GoProStudio version. cineform is decodec in Vegas with 10bit too. To convert the ProRes to Cineform I use TMPGenc, what works fine.

Desktop: PC AMD 3960X, 24x3,8 Mhz * RTX 3080 Ti (12 GB)* Blackmagic Extreme 4K 12G * QNAP Max8 10 Gb Lan * Resolve Studio 18 * Edius X* Blackmagic Pocket 6K/6K Pro, EVA1, FS7

Laptop: ProArt Studiobook 16 OLED * internal HDR preview * i9 12900H with i-GPU Iris XE * 32 GB Ram) * Geforce RTX 3070 TI 8GB * internal HDR preview on the laptop monitor * Blackmagic Ultrastudio 4K mini

HDR monitor: ProArt Monitor PA32 UCG-K 1600 nits, Atomos Sumo

Others: Edius NX (Canopus NX)-card in an old XP-System. Edius 4.6 and other systems

balazer wrote on 5/23/2015, 7:43 PM
With Cineform products no longer for sale, I certainly wouldn't recommend the codec as something with any long-term viability. XAVC is better supported in Vegas.
videoITguy wrote on 5/23/2015, 8:56 PM
Cineform license today is free - does not cost a cent to use...can be less problematic than other file types and codecs. It IS an SMPTE standard.
NormanPCN wrote on 5/23/2015, 10:29 PM
...and Vegas directly supports Cineform AVI files by bypassing the 8-bit Video for Windows interface, via the Cineform SDK. According to Cineform, Vegas started doing this at around V10.
prairiedogpics wrote on 6/4/2015, 9:52 AM
Thanks for your indulgence on my current obsession with this Super8 film scan...

I did muddle my way through a long series and iterations of renders by frameserving to AVISynth using scripts modified and stolen from Nick Hope and JohnMeyer, but the results were never too pleasing; mainly due to the grain inherent in Tri-X. (I learned a lot and it was painful sussing out the basics of AVISynth!)
It was always a fine line...too much denoising and the flying arrows in the film would disappear; too little and the .mp4 had way too many intrusive blocky artifacts.

Eventually, I found this link: http://www.reduser.net/forum/showthread.php?70894-YouTube-Video-Codecs-Resolutions-amp-Data-Rates

and decided, what the heck, lets see if this works.

So, I uploaded the raw Apple ProRes 422 HQ film .mov film scan to YouTube, and, even though it complained during the upload that it MAY not be able to process the upload since it was not sure if it recognized that type of file, YouTube did accept and post the file. It still doesn't do justice to what the viewer sees when the film is actually projected, but at least it's one less compression step.

Here's the link:

Thanks for listening. I will be trying a scan with Kodak Vision 50D Super8 film in the near future; anxious to see if less actual film grain will lead to a more render-friendly scan...

UPDATE: for those interested in Super8..this was just posted and DEFINITELY worth a look:
It's footage from the new shoot-the-moon Logmar S8 camera
balazer wrote on 6/4/2015, 7:37 PM
I've rewritten the TemporalDegrain script for very grainy HD footage. I could send you my script or you could send me the video, if you want to give it a try.
prairiedogpics wrote on 6/5/2015, 8:41 AM
Hi balazer,
Yes, please email me the script; I'd love to try it. Just click on my forum username here to send me an email.
Thanks!