[FFmpeg-devel] [PATCH]Fix interlaced flag when remuxing yuv4mpeg
Michael Niedermayer
michaelni at gmx.at
Sat Feb 2 01:58:46 CET 2013
On Sat, Feb 02, 2013 at 12:21:07AM +0100, Carl Eugen Hoyos wrote:
> Hi!
>
> Attached patch fixes the yuv4mpeg interlaced flag when remuxing interlaced
> streams, both with -vcodec copy and -vcodec rawvideo, see ticket #2190.
>
> Please comment, Carl Eugen
> yuv4mpeg.c | 67 ++++++++++++++++++++++++++-----------------------------------
> 1 file changed, 29 insertions(+), 38 deletions(-)
> 19ad57430c0e62322d1d3da96fa8814aa96e5803 patchyuv4mpeginterlaced3.diff
> diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
> index e2ab8e3..0dc5179 100644
> --- a/libavformat/yuv4mpeg.c
> +++ b/libavformat/yuv4mpeg.c
> @@ -28,11 +28,6 @@
> #define Y4M_FRAME_MAGIC "FRAME"
> #define Y4M_LINE_MAX 256
>
> -struct frame_attributes {
> - int interlaced_frame;
> - int top_field_first;
> -};
> -
> #if CONFIG_YUV4MPEGPIPE_MUXER
> static int yuv4_generate_header(AVFormatContext *s, char* buf)
> {
> @@ -58,6 +53,12 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf)
> inter = 'p'; /* progressive is the default */
> if (st->codec->coded_frame && st->codec->coded_frame->interlaced_frame)
> inter = st->codec->coded_frame->top_field_first ? 't' : 'b';
> + if (st->codec->field_order > AV_FIELD_UNKNOWN)
> + if (st->codec->field_order > AV_FIELD_PROGRESSIVE) {
> + inter = st->codec->field_order == AV_FIELD_TT || st->codec->field_order == AV_FIELD_TB ? 't' : 'b';
> + } else {
> + inter = 'p';
> + }
iam not sure > with these constants is a good idea
except that patch ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130202/c22664ed/attachment.asc>
More information about the ffmpeg-devel
mailing list