Hi there so I have a bit of an archaic workflow so please let me know if there is a better way. I'm editing certain frames of a video and would like to render it in x264.
My workflow is as follows: VirtualDub > Export JPEGs in RGB > Edit in Photoshop > Import image sequence in VirtualDub > Export to external encoder ffmpeg to x264.
How do I and where do I reconvert the images from RGB back to YUV? OR is there a way to edit YUV frames in an image editor and then just encode them without any colorspace conversion? The output needs to be rec.709 otherwise the colors are a tad bit too red.
Thanks, I'd really appreciate it.
+ Reply to Thread
Results 1 to 16 of 16
Are you using vdub for any other operations ? If not, ffmpeg can read an image sequence directly if they are sequentially numbered , you can do the manipulations and colorspace conversions, and encode using libx264
You can use ffmpeg to convert RGB to YUV using a specified matrix using sws flags
eg. this would convert to YUV 4:2:0 using 709
So it might look something like this if the input files were
where %04d are the number of "placeholder" digits
ffmpeg -r 30 -i img%04d.png -vf scale=out_color_matrix=bt709,format=yuv420p -c:v libx264 -crf 18 output.mp4
If you want it slightly more accurate, but slower for the colorspace conversion, specify -sws_flags full_chroma_int+accurate_rnd
Yes I have my multiplexers and A/V external encoders all set up in vdub so I would like to stick to it.
So nowhere in the code do you have to specify that the source is RGB 888? And will specifying -sws_flags full_chroma_int+accurate_rnd give the best conversion or are there other switches?
Also do I have to add any metadata/flags manually?
If you open an 8bit image sequence in vdub2 directly - like PNG, TIFF, JPG - it should be RGB24 already
Did you know you can use vdub2 to encode directly ? It has x264, x265 , aac encoding and can export MP4 or MKV directly (vdub2 , not classic vdub)
When you select x264 8bit , hit the pixel format button and it will give you options. You would use 4:2:0 , 709, limited range.
Very few reasons to use the external encoder these days.
for the VUI flags and metadata (these don't affect the conversion, they are just "labels") :
if you're using ffmpeg, you can use -x264opts colorprim=bt709:transfer=bt709:colormatrix=bt709
if you're using x264cli , or vdub x264 GUI you can use --colorprim bt709 --transfer bt709 --colormatrix bt709 (or add to external commandline box for the vdub x264 GUI)
You can add any other flags in the box, just like you would for the CLI version
avisynth , or vapoursynth
There are too many dependencies and plugins required for it to run on other applications independently (so you'd never find it with ffmpeg or vdub alone for example)
It's the best overall for general use . I wouldn't recommend anything else unless there were specific circumstances, specific sources that required something else
Oh okay thanks ! I really appreciate it.
Last edited by johnny27depp; 22nd May 2019 at 11:17. Reason: Found solution
Hey there. So I'm trying to use the DGHDRtoSDR filter in an avisynth script and opening it up in vdub2. What source filter can I use as my card does not work with DGDecodeNV? If I open the HDR file directly in vdub2 then it does work so whatever source filter is being used in vdub2 should work? Thanks!
ffms2 or lsmash are alternative source filters