Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] Include field_mode information in NUT stream info
Date: Mon, 10 Mar 2025 21:18:46 +0100
Message-ID: <20250310201846.GM4991@pb2> (raw)
In-Reply-To: <20250310164423.1998883-1-anders@onemimir.com>


[-- Attachment #1.1: Type: text/plain, Size: 2056 bytes --]

Hi

On Mon, Mar 10, 2025 at 05:44:22PM +0100, Anders Rein wrote:
> This will make it possible to transmit raw video over NUT without losing
> the field order information.

[...]

> diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
> index 55efb114c3..abe4e3fb98 100644
> --- a/libavformat/nutenc.c
> +++ b/libavformat/nutenc.c
> @@ -21,6 +21,7 @@
>  
>  #include <stdint.h>
>  
> +#include "libavcodec/defs.h"
>  #include "libavutil/intreadwrite.h"
>  #include "libavutil/mathematics.h"
>  #include "libavutil/mem.h"
> @@ -560,12 +561,22 @@ static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id) {
>              count += add_info(dyn_bc, "Disposition", ff_nut_dispositions[i].str);
>      }
>      if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
> +        const char* field_order;
>          uint8_t buf[256];
>          if (st->r_frame_rate.num>0 && st->r_frame_rate.den>0)
>              snprintf(buf, sizeof(buf), "%d/%d", st->r_frame_rate.num, st->r_frame_rate.den);
>          else
>              snprintf(buf, sizeof(buf), "%d/%d", st->avg_frame_rate.num, st->avg_frame_rate.den);
>          count += add_info(dyn_bc, "r_frame_rate", buf);
> +
> +        // Since the NUT specifications (nut.txt) do not support field order information,
> +        // the stream_info side channel is used as a means to transfer this information.
> +        // This is strictly not a part of the NUT specifications and should not be required.
> +        field_order = ff_nut_serialized_field_order_value_or_null(st->codecpar->field_order);
> +        if (field_order != NULL) {
> +            count += add_info(dyn_bc, "field_order", field_order);
> +        }

either send a patch to nut.txt or it should be "X-field_order" for non
standard fields

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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:[~2025-03-10 20:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-08 21:00 Anders Rein
2025-03-09 18:08 ` Michael Niedermayer
2025-03-10 16:44   ` Anders Rein
2025-03-10 20:18     ` Michael Niedermayer [this message]
2025-03-10 20:24       ` Anders Rein
2025-03-10 20:55         ` Michael Niedermayer
2025-03-10 22:35           ` Anders Rein
2025-03-10 22:46       ` Anders Rein

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=20250310201846.GM4991@pb2 \
    --to=michael@niedermayer.cc \
    --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