Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Marton Balint <cus@passwd.hu>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avformat/mxfenc: add h264_mp4toannexb bitstream filter if needed when muxing h264
Date: Fri, 23 Feb 2024 20:55:10 +0100 (CET)
Message-ID: <29f39ed4-a2d3-e675-6b9a-2e54f6bec09f@passwd.hu> (raw)
In-Reply-To: <GV1P250MB0737BC1CE552F20A22C1AF448F552@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM>



On Fri, 23 Feb 2024, Andreas Rheinhardt wrote:

> Marton Balint:
>> Partially fixes ticket #10395.
>> 
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  libavformat/mxfenc.c | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>> 
>> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
>> index 61ed6fc3db..adc31c1cf4 100644
>> --- a/libavformat/mxfenc.c
>> +++ b/libavformat/mxfenc.c
>> @@ -3542,6 +3542,16 @@ static int mxf_interleave(AVFormatContext *s, AVPacket *pkt,
>>      return mxf_interleave_get_packet(s, pkt, flush);
>>  }
>> 
>> +static int mxf_check_bitstream(AVFormatContext *s, AVStream *st, const AVPacket *pkt)
>> +{
>> +    if (st->codecpar->codec_id == AV_CODEC_ID_H264) {
>> +        if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&
>> +                              AV_RB24(pkt->data) != 0x000001)
>> +            return ff_stream_add_bitstream_filter(st, "h264_mp4toannexb", NULL);
>> +    }
>> +    return 1;
>> +}
>> +
>>  #define MXF_COMMON_OPTIONS \
>>      { "signal_standard", "Force/set Signal Standard",\
>>        offsetof(MXFContext, signal_standard), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, .unit = "signal_standard"},\
>> @@ -3623,6 +3633,7 @@ const FFOutputFormat ff_mxf_muxer = {
>>      .p.flags           = AVFMT_NOTIMESTAMPS,
>>      .interleave_packet = mxf_interleave,
>>      .p.priv_class      = &mxf_muxer_class,
>> +    .check_bitstream   = mxf_check_bitstream,
>>  };
>>
>>  const FFOutputFormat ff_mxf_d10_muxer = {
>> @@ -3656,4 +3667,5 @@ const FFOutputFormat ff_mxf_opatom_muxer = {
>>      .p.flags           = AVFMT_NOTIMESTAMPS,
>>      .interleave_packet = mxf_interleave,
>>      .p.priv_class      = &mxf_opatom_muxer_class,
>> +    .check_bitstream   = mxf_check_bitstream,
>>  };
>
> I sent the very same patch long ago [1]. Tomas Härdin opposed it [2],
> [3], because he sees stuff like this as hack.
>
> - Andreas
>
> [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2021-November/287638.html
> [2]: https://ffmpeg.org/pipermail/ffmpeg-devel/2021-November/287702.html
> [3]: https://ffmpeg.org/pipermail/ffmpeg-devel/2021-November/287703.html

Maybe we should discuss this again, define what is missing 
exactly, considering that we both think this is a step in the right 
direction.

The specs says this:

The Picture Element Values shall be the AVC NAL unit stream or the AVC 
byte stream. The bit streams carried in the Value field shall contain 
complete NAL units including their relevant parameter sets, other 
Supplemental Enhancement Information (SEI) and padding zeroes.

(https://pub.smpte.org/doc/st381-3/20170830-pub/)

Regards,
Marton
_______________________________________________
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:[~2024-02-23 19:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23  0:19 Marton Balint
2024-02-23  1:26 ` Andreas Rheinhardt
2024-02-23 19:55   ` Marton Balint [this message]
2024-02-24 11:38     ` Tomas Härdin
2024-02-24 14:13       ` Andreas Rheinhardt
2024-03-05 23:14         ` Marton Balint
2024-03-06 21:59         ` Tomas Härdin
2024-03-08  1:27           ` Marton Balint

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=29f39ed4-a2d3-e675-6b9a-2e54f6bec09f@passwd.hu \
    --to=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