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. |
![]() |
#1 | Link |
Registered User
Join Date: Jul 2010
Posts: 9
|
X264 color space problem
Hey guys
I am encoding my videos using x264 and some of these videos have an odd resolution, something like 1223*1042 or smthn. Whenever I try x264 it gives me a colorspace incompatibility message(this resolution is not compliant with colorspace i420). I am not even able to resize my videos As I am under a deadline, any help would be much appreciated. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Jul 2010
Posts: 9
|
Dude, I do need to convert these files. Can I somehow reduce or increase the resolution by say, 1 pixel, using ffmpeg or smthn and then convert using x264.
I have no idea what that means, am not an expert. Could you please give a little detail on that. |
![]() |
![]() |
![]() |
#4 | Link |
Registered User
Join Date: May 2006
Posts: 957
|
Use the crop or resize (or pad if you have a patched version) filters that x264 now has. With "mod2" he means that the frame dimensions must be a multiple of 2.
__________________
x264 log explained || x264 deblocking how-to preset -> tune -> user set options -> fast first pass -> profile -> level Doom10 - Of course it's better, it's one more. |
![]() |
![]() |
![]() |
#6 | Link | |
x264 developer
Join Date: Sep 2005
Posts: 8,667
|
Quote:
Sounds like a bug in the crop filter. |
|
![]() |
![]() |
![]() |
#7 | Link | |
Registered User
Join Date: May 2006
Posts: 957
|
Quote:
[EDIT] I just tested with 1223x1024 rgba input and there was no problem cropping 1 from the left.
__________________
x264 log explained || x264 deblocking how-to preset -> tune -> user set options -> fast first pass -> profile -> level Doom10 - Of course it's better, it's one more. Last edited by J_Darnley; 9th August 2010 at 11:34. |
|
![]() |
![]() |
![]() |
#8 | Link |
Registered User
Join Date: Jul 2010
Posts: 9
|
I wonder if thats possible. Here is the error I get. Not all the flags I use, but just to give you an idea.
C:\x264>x264 input.avi --profile high10 --vf crop:1,0,0,0 -o cropped.mp4 ffms [info]: 523x361p 0:1 @ 24/1 fps (vfr) resize [error]: resolution 523x361 is not compliant with colorspace i420 Secondly, here is a link which says its not possible to crop 1 pixel. http://mewiki.project357.com/wiki/X264_Settings#crop Can you share your code please? |
![]() |
![]() |
![]() |
#9 | Link |
Registered User
Join Date: May 2006
Posts: 957
|
That link is correct for the most common colourspace but wrong in general.
All the x264 source code is available. I just made a test video using avisynth
__________________
x264 log explained || x264 deblocking how-to preset -> tune -> user set options -> fast first pass -> profile -> level Doom10 - Of course it's better, it's one more. |
![]() |
![]() |
![]() |
#10 | Link | |
Registered User
Join Date: Jul 2010
Posts: 9
|
Quote:
|
|
![]() |
![]() |
![]() |
#11 | Link |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
that error is not even related to crop.
[Edit] the problem is related to your input colorspace, you obviously some colorspace that is unrecognized by the rest of the filtering system and so it is choosing to convert it to the default i420 one. but input source has non mod2 widths and this is incompatible with i420, so the error occurs. [/Edit] but anyways crop works as intended: Code:
$ ./x264 -o NUL ../foreman_cif_352x288.yuv --vf crop:1,0,1,0 yuv [info]: 352x288p 0:0 @ 25/1 fps (cfr) crop [error]: left crop value `1' is not a multiple of 2 $ ./x264 -o NUL ../foreman_cif_352x288.yuv --vf resize:csp=bgr/crop:1,0,1,0/resize:csp=i420 yuv [info]: 352x288p 0:0 @ 25/1 fps (cfr) resize [warning]: converting from yuv420p to bgr24 crop [info]: cropping to 350x288 resize [warning]: converting from bgr24 to yuv420p .... encoded 300 frames, 150.00 fps, 426.35 kb/s Last edited by kemuri-_9; 9th August 2010 at 13:07. |
![]() |
![]() |
![]() |
#13 | Link | |
Registered User
Join Date: Jul 2010
Posts: 9
|
Quote:
|
|
![]() |
![]() |
![]() |
#15 | Link |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
It looks like you're on a windows system so I've made a patch and applied it to a win32 build here
it should now try and convert your unknown input colorspace source to i444 which will allow the non mod2 dimensions you require. this should get you past your current issue and allow you to crop your source to mod2 dimensions to become i420 compliant for encoding with libx264. If it works, I'll get it added to Dark_Shikari's local commit tree Last edited by kemuri-_9; 10th August 2010 at 03:19. |
![]() |
![]() |
![]() |
#16 | Link | |
Registered User
Join Date: Jul 2010
Posts: 9
|
Quote:
It would be even better if x264 could directly adjust the colorspace during encode, as it does when crop filter is applied and publish non mod2 resolution, if its compatible with colorspace or automatically crop one pixel if its not. Thanks again for this. Last edited by vineet; 10th August 2010 at 09:42. |
|
![]() |
![]() |
![]() |
#17 | Link | |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
Quote:
the crop filter does not adjust the colorspace at all, it just crops pixels based on the current colorspace, you use the resize filter to change colorspaces, which is what x264cli is using to do such things. i'm not too thrilled about "automatic cropping", as we don't particularly know which pixels would be the "best" to crop for every source out there. though I will probably have a discussion with Dark_Shikari about this eventually and see what his opinions are. unless he just answers back here... |
|
![]() |
![]() |
![]() |
Tags |
colorspace, resizing, resolution, x264 |
Thread Tools | Search this Thread |
Display Modes | |
|
|