Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: John Coiner <jpcoiner@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: cus@passwd.hu
Subject: Re: [FFmpeg-devel] [PATCH] libavformat/mpegtsenc.c -- correctly re-emit extradata ahead of IDR pictures
Date: Sat, 11 Feb 2023 11:38:42 -0500
Message-ID: <CAEP=B=E15oa=qWL7PVzjCHgai5g_COAPKsPLB3RmEyjbF0AXuA@mail.gmail.com> (raw)
In-Reply-To: <ee6d7322-8135-a75d-a79e-cb50c4f056ac@passwd.hu>

On Sun, Feb 5, 2023 at 6:33 PM Marton Balint <cus@passwd.hu> wrote:
> Your code duplicates AUD-s if they are already present and sps is also
> added:
>
> if original packet had
> [AUD][IDR]
> it will become
> [AUD][SPS][PPS][AUD][IDR].
>
> Regards,
> Marton

Hi Marton,

You're right, this is not compliant. The H.264 spec (section
7.4.1.2.3) is clear about this, it says:
 - There should be at most one AUD per access unit
 - Each access unit should include a picture. (We can't produce a fake
"access unit" to carry the SPS and PPS alone; that's not allowed.)
 - When AUD is present, it should be the first NAL in the access unit.
(We can't just prepend SPS and PPS ahead of the AUD.)

Perhaps you knew all this; I am just learning. :-)

So if the original packet has [AUD][IDR], then we should produce
[AUD][SPS][PPS][IDR].

And if the original packet has [SEI][AUD][IDR], then we should produce
[AUD][SPS][PPS][SEI][IDR] -- chopping out the original AUD, and then
inserting the prefix with the new AUD. Tests show x264 producing the
[SEI][AUD][IDR] sequence, despite it being contrary to the spec's
recommendation that AUD should be first.

Does that seem like the correct handling? If so I'll post a v2 patch
for it. Thanks again.

John
_______________________________________________
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:[~2023-02-11 16:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 12:45 John Coiner
2023-02-05 23:33 ` Marton Balint
2023-02-11 16:38   ` John Coiner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-01-30 15:13 John Coiner
2023-01-30 17:36 ` John Coiner
2023-01-30 21:12   ` Marton Balint
2023-02-02 17:43     ` John Coiner
2023-01-27 21:18 John Coiner
2023-01-29 12:30 ` Marton Balint
2023-01-26 19:16 John Coiner
2023-01-26 18:43 John Coiner

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='CAEP=B=E15oa=qWL7PVzjCHgai5g_COAPKsPLB3RmEyjbF0AXuA@mail.gmail.com' \
    --to=jpcoiner@gmail.com \
    --cc=cus@passwd.hu \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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