Page 1 of 1

transcoding mjpg-avi with correct chroma settings I420/J420

Posted: 10 Apr 2015 22:24
by roman86
I have a quite old digicam that produces mjpg videos that are played correctly in vlc, meaning that black is really black and white is really white.
vlc says the avi is "planar 4:2:0 YUV full scale".

if I transcode the video to h264 (but it also happens with when transcoding to other formats), black gets some kind of dark gray and white some kind of light grey.
vlc says the transcoded file is "planar 4:2:0 YUV". -> "full scale" is missing.

obviously the chroma from the source file is interpreted right when playing, but wrong when transcoding.

I understand the thing with the different chroma modes I420 (16-240 / analog) and J420 (0-255 / digital),
but how can I adjust the chrome for the input and/or the output file?
I'm doing

Code: Select all

vlc.exe -I dummy -vvv mjpeg.avi --sout #transcode{vcodec=h264,vb=1000,acodec=mp3,ab=128}:standard{access=file,mux=ts,dst=h264_mp3.ts}
but remember, as I mentioned above, the problem persists if I transcode in a different format, so in my opinion it has got nothing to do with h264.

thanks for your help!

Re: transcoding mjpg-avi with correct chroma settings I420/J420

Posted: 20 Apr 2015 22:17
by Jean-Baptiste Kempf
VLC does not do that, yet.

Re: transcoding mjpg-avi with correct chroma settings I420/J420

Posted: 22 Apr 2015 21:12
by roman86
thanks for this information.
does someone has an recommendation which other tool I should try? ffmpeg? mplayer? something else?
thanks

Re: transcoding mjpg-avi with correct chroma settings I420/J420

Posted: 11 Oct 2015 21:11
by roman86
in the meantime I solved the problem by using ffmpeg with the argument

Code: Select all

-pix_fmt yuvj420p
at the end of the

Code: Select all

-c:v libx264
arguments.