Hi, the cats
but
Code:FFImageSource("C:\Users\Administrator\Desktop\Nuova cartella (7)\1_E.E.-Hiolle_Narciso.jpg") ConvertToYUY2(interlaced=false) colorMatrix(mode="Rec.601->Rec.709") ColorYUV(levels="PC->TV")
[Attachment 86327 - Click to enlarge]
what can it be?
+ Reply to Thread
Results 1 to 17 of 17
-
-
4:2:2 YUV video must be mod2 in width. So crop a pixel from the width, or add one.
-
I'm a poor cat.
In what way I have to crop a pixel from the width, or add one ? -
I modified your script so it should crop 1 pixel from the left of an image IF its width is not mod2 (making it mod2)
Code:clip=FFImageSource("C:\Users\Administrator\Desktop\Nuova cartella (7)\1_E.E.-Hiolle_Narciso.jpg") cropV=int(Fmod(clip.Width,2)) clip=clip.crop(cropV,0,0,0) clip=clip.ConvertToYUY2(interlaced=false) clip=clip.colorMatrix(mode="Rec.601->Rec.709") clip.ColorYUV(levels="PC->TV")
-
Code:
clip=FFImageSource("v:\SMPTE bars .jpg") cropV=int(Fmod(clip.Width,2)) clip=clip.crop(cropV,0,0,0) return (clip) #converttoYV24() #convert to planar converttoYV16() #convert to planar z_convertformat(interlaced=false,colorspace_op="170m:709:709:l=>709:709:709:l") ColorYUV(levels="PC->TV")
[Attachment 86338 - Click to enlarge]
but can tell to the z_convertformat
in the "z_convertformat(interlaced=false,colorspace_op="1 70m:709:709:l=>709:709:709:l"" line
to do what do the "ColorYUV(levels="PC->TV")"? thanks
Last edited by marcorocchini; 28th Mar 2025 at 11:14.
-
See in your other thread how to convert your SMPTE bars .jpg
https://forum.videohelp.com/threads/417936-comparting-frame-to-frame-in-edius-between-...th#post2771234
You don't need colorYUV(levels= ....)
Conversions are described here
http://avisynth.nl/index.php/Avsresize
Scroll down to the Examples.Last edited by Sharc; 28th Mar 2025 at 12:41.
-
ww thansk, I have modify to don't execute the line ColorYUV(levels="PC->TV")
-
A simple trick to crop one pixel off the width of a clip:
Code:Crop(0,0,width/2*2,height)
For conversion to YV12 (YUV 4:2:0) you can do the same with the height. -
[Attachment 86369 - Click to enlarge]
I use
Code:ffmpeg.exe -an -y -i "C:\Users\Administrator\Desktop\Nuova cartella (7)\SMPTE bars .jpg" -vf scale=w=-2:h=1080:in_range=tv:out_range=pc,colormatrix=bt470bg:bt709,pad="width=ceil(iw/2)*2:height=ceil(ih/2)*2" -frames:v 1 -update 1 -q:v 1 -huffman 1 -intra_matrix 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 -color_range 2 v:\ref.jpg
but If I try to use the same line but with the final output file ref.TGA
I get that: levels of ref.TGA are different to the ref.JPG, even if the commandline if the same
Can Someone explain to the poor cat if is there a way to get the same levels?
[Attachment 86370 - Click to enlarge]
thanks
-
also have try
Code:ffmpegOCT2024.exe -an -v 32 -stats -loglevel fatal -y -i "C:\Users\Administrator\Desktop\Nuova cartella (7)\SMPTE bars .jpg" -vf zscale=w=-2:h=1080:f=spline36:r=full:d=ordered:in_range=tv:out_range=pc,colormatrix=bt470bg:bt709 -frames:v 1 -f image2 -update 1 -c:v targa -rle 0 uscitatarga.tga
-
You change the levels range from TV(limited) to PC(full) or vice versa.
When you do colorspace conversions you should be clear about
1. The colorspace and range of the source
2. How your source filter possibly affects the colorspace and range
3. What exactly you want to do (from->to)
4. Set up the conversion (avisynth, ffmpeg ......) accordingly, knowing what you are doing
5. Watch the result using the correct matrix and range (decoder, renderer).
If any of above is not clear your conversion becomes a surprise.Last edited by Sharc; 30th Mar 2025 at 04:39.
-
ffmpeg.exe -an -y -i "SMPTE bars .jpg" -vf scale=-2:1080,colormatrix=bt470bg:bt709 -sws_flags lanczos+accurate_rnd -frames:v 1 -f image2 -update 1 -c:v mjpeg -q:v 1 -huffman 1 -intra_matrix 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8 out.jpg
I get a out.jpg file "raw 420 JFIF from .JPG"
Can I get a 422 or 444 instead of 420? -
Your source "SMPTE bars .jpg" from your other thread is 4:2:0.
If you want 4:2:2 or 4:4:4 you need to upsample it, or use a 4:2:2 or 4:4:4 pixel format right from start.
https://ffmpeg.org/ffmpeg-filters.html#allrgb_002c-allyuv_002c-color_002c-colorchart_0...02c-yuvtestsrc
For 4:2:2 bars, for example
Code:ffmpeg -f lavfi -i smptehdbars=duration=30:rate=25.0 -vf scale=1920:1080,setdar=16/9 -an -c:v utvideo -pix_fmt yuv422p "smpte_HDbars.avi"
Code:colorbarsHD(1920,1080,"YV24").
Last edited by Sharc; 30th Mar 2025 at 12:31. Reason: rate and DAR added to the ffmpeg commandline
-
Similar Threads
-
Help with error when trying to use AviSynth AiUpscale v1.2.0
By Marcio.ciconne in forum RestorationReplies: 10Last Post: 10th May 2024, 16:43 -
AviSynth error with upgrade from 2.6.6.6 to 2.6.8.4
By dukeroyal in forum Newbie / General discussionsReplies: 14Last Post: 21st Jun 2021, 21:35 -
avisynth error code 126 ?!
By themaster1 in forum RestorationReplies: 3Last Post: 12th Nov 2020, 04:54 -
multiAVCHD avisynth error!
By hdfills in forum Authoring (Blu-ray)Replies: 17Last Post: 16th May 2020, 05:39 -
AviSynth script... automatically resize height based on desired width
By syrist in forum Video ConversionReplies: 10Last Post: 26th Apr 2020, 13:06