Opened 11 years ago

Closed 11 years ago

#2870 closed enhancement (fixed)

Outdated players only support yuv420p mpeg2video

Reported by: xnejp03 Owned by:
Priority: wish Component: ffmpeg
Version: git-master Keywords: mpeg2video
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

It seems that for some time now (for about 6 months) FFmpeg cannot produce a valid mpeg2video file from mjpeg source. The result plays correctly in ffplay and VLC but shows only large pink-ish pixels on some TVs (reproduced on Sony and Panasonic). This use to work before.

ffmpeg -v 9 -loglevel 99 -i mjpeg.AVI -c:v mpeg2video -c:a mp2 -f mpegts d:\tmp\out.mpg

This is reproducible with pretty much any mjpeg videos.

Attachments (1)

ffmpeg-20130816-003631.zip (44.2 KB ) - added by xnejp03 11 years ago.

Download all attachments as: .zip

Change History (7)

by xnejp03, 11 years ago

Attachment: ffmpeg-20130816-003631.zip added

comment:1 by Carl Eugen Hoyos, 11 years ago

Please provide an input file.

comment:2 by xnejp03, 11 years ago

Uploaded file mjpeg_pink_artifacts.avi

Version 0, edited 11 years ago by xnejp03 (next)

comment:3 by Carl Eugen Hoyos, 11 years ago

Component: undeterminedFFmpeg
Keywords: mpeg2video added
Priority: normalwish
Reproduced by developer: set
Status: newopen
Summary: MJPEG to MPEG2 produces pixelated videoOutdated players only support yuv420p mpeg2video
Type: defectenhancement
Version: unspecifiedgit-master

Please test the following:

$ ffmpeg -i mjpeg_pink_artifacts.avi -vcodec mpeg2video -pix_fmt yuv420p -vb 800k out.mpg

or

$ ffmpeg -mjpeg_pink_artifacts.avi -vb 800k out.mpg

(The bitrate setting is there only because I think the default is slightly to small, it will also work without, producing bad quality output.)

I will copy e4f5aa5e for this use case if nobody beats me.

comment:4 by xnejp03, 11 years ago

Yes, that fixes it. So shall I add this option to all my commands where target is mpeg2video (just to stay on the safe side)?

in reply to:  4 comment:5 by Carl Eugen Hoyos, 11 years ago

Replying to xnejp03:

Yes, that fixes it. So shall I add this option to all my commands where target is mpeg2video (just to stay on the safe side)?

Only to the ones where quality loss is no problem / where you need compatibility with outdated players. ffmpeg by default tries to keep as much information (quality) as possible, if you need a different behaviour, you have to specify the output pixel format you want.

comment:6 by Carl Eugen Hoyos, 11 years ago

Resolution: fixed
Status: openclosed

A warning is printed since 47f9a5b.

Note: See TracTickets for help on using tickets.