[FFmpeg-devel] [PATCH] Include field_mode information in NUT stream info
Anders Rein
anders at onemimir.com
Mon Mar 10 22:24:05 EET 2025
Hi! Thanks for the feedback.I have no problem adding the "X-" prefix
to the field order key, however I was just following the way
"r_frame_rate" was passed. As far as I can see this field is not
mentioned in nut.txt either and should also be using the X- prefix. Or
am I missing something?
On Mon, 10 Mar 2025 at 21:19, Michael Niedermayer
<michael at niedermayer.cc> wrote:
>
> 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
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
--
Disclaimer: This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error or are not the
named addressee, you should not disseminate, distribute or copy this email.
Please notify the author by replying to this e-mail and destroy this email
and any attachments.
More information about the ffmpeg-devel
mailing list