There is BD in 1080p. It is very old and remastered mopic, it real size is 1438×1078 (2px in top and left/rigth both 241px). I cropped to image size and want to upscale to make valid image ratio 4:3. But if I set left rectangle position to 241 I have got 1px black line on the right, if 242 there is the same line on the left. This is problem with scale. What to do with this to make valid image?
Code:-vf "crop=1438:1078:241:2,scale=1440x1080:flags=bicubic,setsar=1:1"
+ Reply to Thread
Results 1 to 10 of 10
-
-
Code:
Video #1 ID : 4113 (0x1011) Menu ID : 1 (0x1) Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.1 Format settings : CABAC / 3 Ref Frames Format settings, CABAC : Yes Format settings, Reference fra : 3 frames Format settings, GOP : M=3, N=24 Codec ID : 27 Duration : 1 h 3 min Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate : 23.976 (24000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive format_identifier : HDMV Source : 00003.m2ts / 00003.m2ts
When I tried offset 240, black line on the left appeared.
Maybe above MediaInfo will be helpful? I don't understand this stream -
It's what jagabo said, the chroma subsampling prevent you from cropping by single pixels
The "dimensions" of the planes are different for 4:2:0 chroma subsampling
Y=1920x1080
Cb=960x540
Cr=960x540
A workaround is if you convert to 4:4:4, you can and crop by single pixels (and back to 4:2:0 if desired) . This "resamples" the CbCr planes so they are 1920x1080 too.
Code:-vf "format=yuv444p,crop=1438:1078:241:2,scale=1440x1080:flags=bicubic,setsar=1:1,format=yuv420p"
-
Note that converting to yuv 4:4:4, cropping on odd boundaries, and converting back to yuv 4:2:0, will blur the chroma. Scaling by small percentages will also create moire artifacts and blurring of chroma and luma. I hope you have a good reason to be doing this.
-
-vf "crop=1438:1078:0:0,setsar=1:1"
-
Thanks guys! All is fixed by exact crop parameter. Now image is perfect, without any black strips or other artifacts.
Similar Threads
-
[solved] Convert video changing Scale and Bitrates - Ffmpeg
By parvares in forum Newbie / General discussionsReplies: 10Last Post: 8th Apr 2021, 17:35 -
HELP: FFMPEG Scale and Chromakey syntax?
By DotMatrix in forum Newbie / General discussionsReplies: 0Last Post: 20th May 2020, 11:54 -
crop feature in ffmpeg
By batemanj in forum Video ConversionReplies: 5Last Post: 20th Feb 2019, 13:15 -
FFMpeg scale filter makes video lose color
By FEWP in forum Video ConversionReplies: 3Last Post: 19th Apr 2018, 08:37 -
DAR: why scale down width rather than scale up height?
By chconnor in forum Video ConversionReplies: 15Last Post: 20th Feb 2017, 19:40