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. |
20th September 2020, 23:15 | #1 | Link |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Encode UHD prores 444(4)
Hi, I am trying to encode a UHD (3840x2160) video filtered with Avisynth+ and encode prores444 (or 4444) but the only thing I can get is the Prores as "YUV 8-bit 4:2:0" to work and the needed info gets lost.
This is how it looks in "External encoder"; -> "Edit external encoder profile", Command Arguments: -f rawvideo -s %(width)x%(height) -r %(fpsnum)/%(fpsden) -i - -c:v prores_ks -profile:v 4 -pix_fmt yuv444p10 "%(tempvideofile)" Under the "video"-tab I want to use "yuv444p16le - 16-bit YUV 4:4:4" but this just makes VDUB2 crash instantly when trying to encode. Error: Oops -- VirtualDub has crashed... Or out of memory error. Just for test I have tried "yuv444p - 8-bit YUV 4:4:4", this gives me a green-blueish tinted image and "yuv422p - 8-bit YUV 4:2:2" gives me a green-tinted image. Is it even possible to encode in higher than 8-bit and 4:4:4 prores (or DNXHR) in VirtualDub2 (Build 44282)? Thanks |
21st September 2020, 09:49 | #3 | Link |
Registered User
Join Date: Mar 2015
Posts: 775
|
This should work, no idea the for the reason of crash. Do you run x64 version? Otherwise low memory could be the issue.
For the command line you have to also put pix_fmt of the rawvideo: example ffv1 Code:
-f rawvideo -pix_fmt %(pix_fmt) -s %(width)x%(height) -r %(fpsnum)/%(fpsden) -i - -c:v ffv1 %(tempvideofile) Code:
-f rawvideo -pix_fmt %(pix_fmt) -s %(width)x%(height) -r %(fpsnum)/%(fpsden) -i - -c:v prores_ks -profile:v 4 -pix_fmt yuv444p10 "%(tempvideofile)"
__________________
VirtualDub2 |
21st September 2020, 18:46 | #5 | Link |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Thank you both.
@poisondeathray When I use the vdub2 FFMpeg / Apple ProRes option under video=>compression and "save video" as video.mov I get memory error "Out of memory (unable to allocate 66359312 bytes)". Too old computer? I would love to use ffmpeg directly with avs input but all I get is error when I try it: "ffmpeg outputfile #0 does not contain any stream" and it doesn't write any frames. Code:
ffmpeg prorestest.avs prores_ks -c:v -profile:v 4 -pix_fmt yuv444p10 test.mov I used your line Code:
-f rawvideo -pix_fmt %(pix_fmt) -s %(width)x%(height) -r %(fpsnum)/%(fpsden) -i - -c:v prores_ks -profile:v 4 -pix_fmt yuv444p10 "%(tempvideofile)" Last edited by anton_foy; 21st September 2020 at 18:49. |
21st September 2020, 18:53 | #6 | Link |
Registered User
Join Date: Mar 2015
Posts: 775
|
If you have to run 32-bit, maybe look at Option->Performance->Video buffering (change to minimum 4)
Not sure what else could help to save memory.
__________________
VirtualDub2 |
21st September 2020, 19:04 | #7 | Link | |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Quote:
If I edit my avs-file to 8-bit I have no problem but as soon as I change it to deep color it refuses. |
|
21st September 2020, 21:00 | #8 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
Typos ? It should be like this Code:
|
|
21st September 2020, 21:17 | #9 | Link |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
@poisondeathray
Thanks, I probably do it wrong somehow but I have the avs-script in the same folder as ffmpeg.exe and in the Command Prompt I pasted your line but I now get error: prorestest.avs: unknown error occured I found another person here in the forums getting this and he renamed ffmpeg.exe to ffmpeg32.exe to make it work but it does not work for me. |
21st September 2020, 22:08 | #11 | Link |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
@poisondeathray
Thank you now it works !!! I had dragged and dropped the exe-file in the wrong place, the old x64 was still there and I mixed them up. But should it say below input: Stream #0:0 Video: rawvideo (Y3[11][16] / 0x100B3359), yuv420p16le...? The encoding section shows yuv444p10le which is fine I guess ( because FFMPEG cannot encode prores 4444 in higher than 10 bit?) Last edited by anton_foy; 21st September 2020 at 22:24. |
21st September 2020, 23:02 | #13 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
It should be yuv444p10le, not yuv420p16le . Otherwise you are letting ffmpeg downconvert the bit depth and upsample the chroma, instead of specifying how you want it to be done. e.g. what algorithm are you using to upscale ? Did you want to dither down ? What algorithm to dither (or not) Code:
Stream #0:0: Video: rawvideo (Y3[0][10] / 0xA003359), yuv444p10le, 3840x2160 , 24 fps, 24 tbr, 24 tbn, 24 tbc Last edited by poisondeathray; 21st September 2020 at 23:05. |
|
22nd September 2020, 07:32 | #15 | Link | |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Quote:
Code:
ConverttoYUV444() Convertbits(10, dither=1) EDIT: Here is my script Code:
### Avisynth+ 3.6.1 (r3300, 3.6, I386) ### SetFilterMTMode("DEFAULT_MT_MODE", 2) #Index LSMASHVideoSource("F:\sony\C1031.mp4") trim(17,24) convertbits(16) Levels(0, 1, 65280, 0, 65280, coring=false, dither=false) ### DENOISE ### neo_dfttest(sigma=16,sigma2=16,f0beta=1.0,tbsize=1,sbsize=120,sosize=90, y=2 , u=3, v=3) #sbsize=120,sosize=90 / sbsize=24,sosize=18 mergeluma(TemporalSoften(3, 4, 8, mode=2)) ### TOPSHARP ### shrp=sharpen(1.0) vid1 = last shine1 = vid1.Overlay(shrp, mode="blend", opacity=1.0) emask1 = vid1.mt_edge(mode="prewitt",thy1=0,thy2=65280).mt_expand().fastgaussblur(10) result1 = mt_merge(vid1,shine1,emask1, U=2,V=2) merge(result1) ### SHINE ### blr=mt_expand().Blur(1.56).Blur(1.56).Blur(1.56).Blur(1.56).Blur(1.56).Blur(1.56).Blur(1.56) #BinomialBlur(varY=4.5, varC=6.5, Y=3, U=2, V=2, useMMX=true) vid = last shine = vid.Overlay(blr, mode="blend", opacity=0.9) emask = vid.mt_edge(mode="prewitt",thy1=0,thy2=65280).mt_expand().mt_expand().mt_expand().fastgaussblur(20) result = mt_merge(vid,shine,emask, U=2,V=2) return(result) #Debanding neo_f3kdb(range=15, Y=45, Cb=30, Cr=30, grainY=0, grainC=0, sample_mode=2, blur_first=true, dynamic_grain=false, mt=true) #Chroma Upscaling ConverttoYUV444() Prefetch(4) ConvertBits(bits=10, dither=1) Last edited by anton_foy; 22nd September 2020 at 19:59. Reason: Added the avs-script |
|
23rd September 2020, 17:09 | #16 | Link |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Could the MT-mode interfere with the last part: Converttoyuv444() and Convertbits(bits=10, dither=1)
or is there another reason why FFMPEG interprets my input as "yuv420p16le" instead of "yuv444p10le"? Thanks |
23rd September 2020, 19:00 | #18 | Link | |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Quote:
Its footage from my Sony A6300 camera. XAVC S: 3840 x 2160p / 25 fps (100 Mbps), 4:2:0, 8 bit. As seen in my avs-script I filter it in 16-bits and then convert into 10-bit yuv444. Yes I can show before and after clip as soon as I come home from work. I have imported the clip in Davinci Resolve and compared it to avisynth filtered in 8bit and the new one is indeed in 10 bits. I am just concerned that ffmpeg does not interpret it as yuv444 10-bit input clip which it should. |
|
23rd September 2020, 20:27 | #19 | Link |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Here is the link with the videos, processed and unprocessed: https://we.tl/t-yOeb6Tolr4
|
23rd September 2020, 22:37 | #20 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Maybe a problem with your ffmpeg binary. What does info() report ?
Code:
Blankclip(pixel_type="YV12").KillAudio() convertbits(16) ConverttoYUV444() Prefetch(4) ConvertBits(bits=10, dither=1) Why don't you have ConvertBits before prefetch ? |
|
|