Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
29th April 2021, 00:53 | #1 | Link |
Registered User
Join Date: Mar 2019
Posts: 48
|
Export to format OpenEXR or DPX
Hi,
The issues of export to lossless formats have been repeatedly discussed, but OpenEXR or DPX has not found. Plan. There is mp4. I want to delete the duplicate frames of the dedup, save it in OpenEXR or DPX format. Process it in Davinchi (Adobe...) and save it in mp4. How to implement a plan? What will the Avisynth script look like? Thank you. |
29th April 2021, 01:36 | #2 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
ffmpeg can read avs scripts if avisynth support has been included (it usually is with windows builds). So 10bit RGB dpx can be written with ffmpeg using avs input It would look something like this Code:
#source filter for MP4 #dedup, etc... . #filtering, etc.. . ConvertToRGB24(matrix="rec709") ConvertToPlanarRGB() ConvertBits(10) The ffmpeg part would look something like this Code:
ffmpeg -i input.avs -start_number 0 output%06d.dpx avs+ supports float, and ffmpeg supports exr write now, but the ffmpeg avs demuxer does not support float formats, so it cannot be done in a similar way . (Assuming you want the most common, standard EXR types - which are 16bit half float or 32bit float, sRGB, linear . EXR actually supports many more types, including integer types but float is the most common reason EXR is used. And if you were going to be using 16bit int - eg. RGB48 or RGB64(alpha) you might as use PNG instead) You can use vapoursynth if you need proper EXR support for import/export using imwri Last edited by poisondeathray; 29th April 2021 at 01:40. |
|
29th April 2021, 01:59 | #3 | Link |
Registered User
Join Date: Sep 2005
Posts: 130
|
@poisondeathray
Doesn't ImageWriter output .exr? Whether the output is a proper EXR or not, that's another issue. But this script does output .exr file that can be opened by IrfanView Code:
ColorBars() ImageWriter(file = "D:\App\AVS\AVSMeter290\Pic-", start = 5, end = 5, type = "exr") Last edited by patul; 29th April 2021 at 02:03. |
29th April 2021, 02:00 | #4 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
|
EDIT: looks like other people with much more knowledge replied while I was writing, so my answer is no longer relevant, read poisondeathray's advice.
Well it's not actually the Avisynth script that's gonna be the problem but rather the BAT file to make the EXR or DPX image sequence. To put some context here to those who might not be familiar, basically a DPX is essentially a TIFF with timecode metadata. What you would get after indexing and decimating in Avisynth and encoding in DPX is a series of folders in which there are a bunch of .dpx files (1 for each frame) usually in 10bit planar RGB in one folder, discrete 24bit 48'000Hz PCM audio tracks muxed in .wav in another and a .xml metadata file in another folder. They all make a DPX package. The problem is that I've never encoded one. I think that FFMpeg should be able to take the uncompressed A/V stream from Avisynth and encode it in DPX, but I'm not sure... The Avisynth part is easy, you just need an indexer (FFMpegSource2 or LWLibavVideoSource), something to remove dups (TDecimate), something to convert bit depth (ConvertBits), something to convert to RGB (ConverttoPlanarRGB), something to bring the audio to 48000Hz (SSRC, ResampleAudio) and something to bring it to 24bit (ConvertAudioTo24Bit). After that it's just a matter of writing a BAT to take the Avisynth output and encode to DPX. If FFMpeg can do it, that's your best shot, otherwise if other command line open source encoders can do it you can use FFMpeg to open the Avisynth script and pipe the video to whatever encoder you'll end up using. I'll let others reply, though, 'cause I've never encoded a DPX (I only received them), so I'm afraid I can't help you any further. Last edited by FranceBB; 29th April 2021 at 02:10. |
29th April 2021, 02:24 | #5 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
If you convert to planarRGB and 32bits before imagewriter, there is error saying it supports 8bit and 16bit only EXR is not listed either http://avisynth.nl/index.php/ImageWriter I do not thing it's a "proper" EXR , and imagewriter does not support half float or full float, which are the most common and main reasons for using EXR in the first place. You might as use PNG and be ensured that it will work in that case |
|
5th May 2021, 05:34 | #9 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
For EXR, you can send 8 or 10bit avs script to ffmpeg, and use -vf zscale to linearize, and scale to 32bit float, and to write the exr sequence
#8 or 10bit YUV input avs script #assume hd or 709, otherwise use matrixin=170m Code:
ffmpeg -i input.avs -vf zscale=matrixin=709:transferin=iec61966-2-1:transfer=linear,format=gbrpf32le -compression zip16 -start_number 0 out_%06d.exr |
8th May 2021, 07:06 | #12 | Link |
Registered User
Join Date: Mar 2019
Posts: 48
|
I had to use not color patterns, but my own physiological vision and convert to 24 fps
https://youtu.be/UTXZSVIIk-c |
25th May 2021, 06:45 | #13 | Link |
Registered User
Join Date: Mar 2019
Posts: 48
|
Hello,
I have tried applying color correction, ColorMatrix, Levels, HDRAGC, RGBAdjust, ConvertToRGB32 (). Ccd (). ACOBW (). ConvertToYV12 () but the result did not satisfy me. Comparison https://youtu.be/hhP49HDNgFw Source https://www.dropbox.com/sh/x8kd1gtj2...PR-k3Hf2a?dl=0 What is the most correct color correction? What is the most correct resolution? Which script to use? Yours faithfully, Evgeny |
25th May 2021, 08:19 | #14 | Link |
Registered User
Join Date: Sep 2005
Posts: 130
|
Well, it wont be perfect, but I think you did a great job on cleaning & stabilizing the video. Can you share the script you use for that if it's okay to you?
Probably you can try DeOldify as in this FranceBB's thread. I know it colorizes grayscale, but I tried several frames and I think it looked okay and worth to try. |
25th May 2021, 09:17 | #15 | Link |
Registered User
Join Date: Mar 2019
Posts: 48
|
To stabilize video (EXR), you can use both Moka Pro and Nuke...
I wanted to colorize the video "Die Pest in Florenz" (1919) https://youtu.be/vYZZbapThk8 but DeOldify does not export EXR) |
25th May 2021, 18:35 | #16 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
The main issue is the red channel, so adjust that separately Often color manipulation is subjective , but some things are less subjective and critical assuming you want a more natural look (ie you're not purposefully createing a stylized grade) - 1) Shadow detail is crushed in the "after" version - I would spread the shadow tonal range, while keeping the darkest blacks for contrast. When you see a solid line in a waveform (when there wasn't one before) it indicates crushed detail problem eg. you can see the top left detail im the glass is all "black" crushed detail, and it correlates with the "line" in the waveform https://i.postimg.cc/Pq5r93yS/Bielef...g-Fw001728.png 2) Red channel is unbalanced . You can check red reference objects, like "red" woolworth letters ~1:33, red railing ~ 3:16, red flowers ~ 3:53. Adjust the red channel separately Look at RGB histogram for source - it's all shifted to the right. The main thing you need to do is adjust the red input black level, or use red curves Check other scenes that Red, Blue, Green reference objects look correct (check "blue" sky) eg. I'm not saying this is perfect, but it's "less bad" , more natural, and a better starting point https://i.postimg.cc/nL9hYd1g/5588comp.png You can massage it to how you want for final look, but those 2 things are major issues. For most people, adjusting color in RGB is easier and more intuitive than YUV corrections. You have total control in resolve, but these are basic manipulations that you can do in almost any program. Curves is the most powerful , because of non linear changes |
|
25th May 2021, 23:20 | #17 | Link |
Registered User
Join Date: Mar 2019
Posts: 48
|
poisondeathray Thank you so much
My mistakes were: 1. Edits with two views, the left is the source, and the right view (my right eye) physiologically added information from the red channel of the source (my left eye) 2. I wanted to edit one scene so that it fits (identically) all scenes. |
Tags |
avisynth, dpx, openexr |
|
|