0x09 / resdet

Detect source resolution of upscaled images
GNU Lesser General Public License v2.1
236 stars 10 forks source link

y4m invalid image? #3

Closed meeech closed 7 years ago

meeech commented 7 years ago

Hi. Trying to use with a y4m. Generated one as per example in readme, but when i point resdet at it i get Invalid Image. image.y4m.zip

I've tried building a few different ways. Once i built with

./configure --disable-libpng --disable-libjpeg

Testing for cc... ok
Testing for ar... ok
Testing for pkg-config... ok

CC is "/usr/bin/cc"
AR is "/usr/bin/ar"
CFLAGS is "-Ofast -march=native -mtune=native -std=gnu99 "
PREFIX is "/usr/local"
BINPREFIX is "/usr/local/bin"
LIBPREFIX is "/usr/local/lib"
INCPREFIX is "/usr/local/include"
SHAREPREFIX is "/usr/local/share/resdet"
PCPREFIX is "/usr/local/lib/pkgconfig"

Testing for fftw3f... not found
Testing for magic.h... ok
Testing for magic... ok
Testing for mjpegtools... ok
Testing for MagickWand... ok
Testing for m... ok

it would then recognize png files (otherwise, it was giving invalid image for pngs too)

Let me know what other info I can provide.

Using OSX 10.12

0x09 commented 7 years ago

FFmpeg created a 10 bit y4m here, which mjpegtools doesn't support. I'll amend the example, but you can force the output to 8 bit by adding -pix_fmt yuv420p to the FFmpeg arguments (this source is 4:2:2, but only the Y plane is used, so the chroma subsampling is harmless.)

If you have an example of a png that doesn't work with the libpng reader I can take a look at what's going wrong there. I should probably change the default to only use libpng/libjpeg when ImageMagick isn't available, although I'd like them to be reliable fallbacks.

meeech commented 7 years ago

here is link to png https://send.firefox.com/download/6036d14ade/#8pC6tq-eiYUXqShIFzvw6A

meeech commented 7 years ago

and thanks! that change worked! it detected the upscaled vid. (at least on my 1 test case :D ) so thats a good start.

0x09 commented 7 years ago

Thanks -- I hadn't been setting filters to convert 16 bit pngs correctly (this came up with alpha also but I didn't realize the root of the issue). It's fixed now, but since you're already using it with ImageMagick instead there's not much point in updating.

meeech commented 7 years ago

great.