Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Chema Gonzalez <chemag@gmail.com>
To: ffmpeg-devel@ffmpeg.org, ffmpeg@gyani.pro
Cc: Chema Gonzalez <chemag@fb.com>
Subject: [FFmpeg-devel] [PATCH] avformat/yuv4mpegdec: increase header limit
Date: Thu, 20 Oct 2022 09:06:37 -0700
Message-ID: <20221020160637.1835527-1-chemag@gmail.com> (raw)

From: Chema Gonzalez <chemag@fb.com>

Allows demuxing UHD F1000000000:33333333 fps yuvj420p files

ffmpeg (at HEAD as of now) is creating this:

```
$ ffmpeg -y -i source.265 /tmp/foo.y4m >& /dev/null
...
$ xxd /tmp/raw.y4m |less
00000000: 5955 5634 4d50 4547 3220 5731 3932 3020  YUV4MPEG2 W1920
00000010: 4831 3038 3020 4631 3030 3030 3030 3030  H1080 F100000000
00000020: 303a 3333 3333 3333 3333 2049 7020 4130  0:33333333 Ip A0
00000030: 3a30 2043 3432 306d 7065 6732 2058 5953  :0 C420mpeg2 XYS
00000040: 4353 533d 3432 304d 5045 4732 2058 434f  CSS=420MPEG2 XCO
00000050: 4c4f 5252 414e 4745 3d4c 494d 4954 4544  LORRANGE=LIMITED
00000060: 0a46 5241 4d45 0a82 8282 8282 8282 8282  .FRAME..........
...
```

Which cannot be parsed by the same ffmpeg decoder:
```
$ ffmpeg -i /tmp/foo.y4m /tmp/bar.y4m
...
[yuv4mpegpipe @ 0x2b69a40] Header too large.
/tmp/foo.y4m: Invalid argument
```

This is kicking the ball (per 0b1ff3265e9bdad3b4b6b97ced2f126cb3599568),
but seems to work.
---
 libavformat/yuv4mpegdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/yuv4mpegdec.c b/libavformat/yuv4mpegdec.c
index b24275acc1..c0972af7de 100644
--- a/libavformat/yuv4mpegdec.c
+++ b/libavformat/yuv4mpegdec.c
@@ -27,7 +27,7 @@
 #include "yuv4mpeg.h"
 
 /* Header size increased to allow room for optional flags */
-#define MAX_YUV4_HEADER 96
+#define MAX_YUV4_HEADER 128
 #define MAX_FRAME_HEADER 80
 
 static int yuv4_read_header(AVFormatContext *s)
-- 
2.37.3

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

             reply	other threads:[~2022-10-20 16:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 16:06 Chema Gonzalez [this message]
2022-10-21 15:29 ` Paul B Mahol

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221020160637.1835527-1-chemag@gmail.com \
    --to=chemag@gmail.com \
    --cc=chemag@fb.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=ffmpeg@gyani.pro \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git