Log in

View Full Version : ffmpeg doesn't keep yuyv422


leoenc
28th February 2008, 17:52
When using AVIsynth to serve a yuyv422 MPEG-2 to ffmpeg, it is converted to yuv420p.
The AVS is a simple DGDecode_mpeg2source with trims. In vdub it shows as YCbCr 4:2:2 (YUY2).
When feeding ffmpeg with the m2v directly, it keeps the yuyv422 data.

Any ideas?
Could this be a bug with ffmpeg and AVIsynth?

ffmpeg.exe -y -i mpeg2.avs -vcodec mpeg2video -pix_fmt yuyv422 "test.m2v"

Stream #0.0: Video: rawvideo, yuyv422, 720x576 [PAR 0:1 DAR 0:1], 165888 kb/s, 25.00 fps(r)
Output #0, mpeg2video, to 'test.m2v':
Stream #0.0: Video: mpeg2video, yuv420p, 720x576 [PAR 0:1 DAR 0:1], q=2-31, 200 kb/s, 25.00 fps(c)

20-40
28th February 2008, 20:30
Add

ConvertToYUY2()

as the last line in your .avs.
Without it, any Avisynth 2.5 (and I've assumed that you have it ) needs/use/ask YV12 color space.
Avisynth 2.0 works in YUY2 alltheway, but I have never noticed any drop neither in quality or speed if I let 2.5 or 2.6 to perform such color space conversion.

leoenc
28th February 2008, 23:07
Add

ConvertToYUY2()

as the last line in your .avs.


Thanks but it makes no difference.

My AVS is already being identified as YUY2, as shown in vdub and ffmpeg.
The problem is that ffmpeg, from some reason, converts it to yuv420p.

20-40
29th February 2008, 14:02
Then, I guess ffmpeg use YV12, color space 4:2:0, native for mpeg2. He even tell you that.
Do you need yuy2 so badly? yv12 is better, there is nothing wrong with neither ffmpeg or avisynth in this case.

EDIT: Next time provide needed informations such as ffmpeg and avisynth versions, my friend, I still have no idea which avisynth you have: Avisynth2 or 2.5...

leoenc
29th February 2008, 15:27
AVIsynth 2.5.7
ffmpeg - tried a few of the latest SVN and Cef's versions, no difference.

I am sure ffmpeg is capable of outputting 4:2:2 MPEG-2 because , as I wrote in my OP, feeding it directly with the 4:2:2 MPEG-2 - it keeps it as yuyv422.
I must keep the edited file as 4:2:2.

20-40
29th February 2008, 20:03
Thats all I need. OK, here is a screenshot and you can see command-line and output.
Correct name of -pix_fmt is yuv422p.
http://free-kr.t-com.hr/zeman/ffmpeg-yuv422p.jpg

leoenc
29th February 2008, 21:52
Correct name of -pix_fmt is yuv422p.


That did it! Thanks a lot, 20-40!