Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Jan Ekström" <jeebjp@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] ffmpeg: set user-set rotation for encoded streams too
Date: Sun, 15 May 2022 15:21:40 +0300
Message-ID: <CAEu79SanjJVzXz46TH4NwGb_wiKtJLuimZPbQBZ1AXUth0WZCQ@mail.gmail.com> (raw)
In-Reply-To: <a92114f4-c57d-a177-afe4-ab3ebd797c4b@gyani.pro>

On Sun, May 15, 2022 at 2:58 PM Gyan Doshi <ffmpeg@gyani.pro> wrote:
>
>
>
> On 2022-05-15 04:29 pm, Jan Ekström wrote:
> > On Thu, May 12, 2022 at 11:19 AM Anton Khirnov <anton@khirnov.net> wrote:
> >> Quoting Gyan Doshi (2022-05-12 09:01:31)
> >>> A substitute option for metadata rotate would accept a single rotation
> >>> value.
> >>> If adding an option for matrix, we should allow flips too.
> >> I see no reason not to have both. You can have a simple option for just
> >> the rotation and an advanced option for specifying full matrix.
> >>
> > FYI I had thought about arguments-to-side data earlier, and as I saw
> > this thread I decided to make a proof-of-concept that has one layer
> > which constructs an AVBufferRef of the side data itself based on an
> > AVDictionary (constructor, basically), and then another which then
> > goes over type-arguments sort of dictionary and attaches things (to an
> > AVFrame in this case). AVPacket and AVFrame side data is slightly
> > different, so I guess you'd have to split one layer which generates an
> > AVBufferRef, and then that'd be utilized (discarded or not) by the
> > utilizing function.
> >
> > I do wonder if AVOptions wouldn't be better for something like this,
> > but at least it lets you play around with the idea. My initial API
> > user ended up being the setparams filter.
> >
> > Link to PoC branch:
> > https://github.com/jeeb/ffmpeg/commits/arguments_to_side_data
> >
> > Usage example:
> > ffmpeg -v verbose -i INPUT -map 0:v:0 -vf
> > setparams=side_data=displaymatrix=angle=34.34,showinfo -vframes 1 -f
> > null -
>
> The metadata hack uses avutil/display API to set the matrix and then
> attach it to the *stream* as side data  A filter will force encoding.
> Since this is usability/display info for the consumer , it should remain
> available for streamcopy.

Yes, that is why I noted that there probably needs to be a separation
of APIs between the AVBufferRef and the "final" one. For re-encoding a
video filter would lead to the first AVFrame having it, and then that
could be utilized in the encoder initialization - just like my changes
pushing the video encoding later enabled color space information to be
passed on. For stream copy, it should be set either to the AVPacket(s)
or AVStream, yes. Anton talked about a bit stream filter but I have
not looked into that side of things.

This was just a proof-of-concept so people can see how string
arguments to side data might look, since IMHO we are badly lacking
such an interface (while the C APIs might be OK, we are clearly
lacking stuff to do string based object generation, which is more or
less required for CLI etc usage).

Jan
_______________________________________________
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-05-15 12:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 11:40 Gyan Doshi
2022-05-11 11:56 ` Anton Khirnov
2022-05-11 12:18   ` Gyan Doshi
2022-05-11 18:49     ` Anton Khirnov
2022-05-11 19:15       ` Gyan Doshi
2022-05-12  5:25         ` Anton Khirnov
2022-05-12  7:01           ` Gyan Doshi
2022-05-12  8:19             ` Anton Khirnov
2022-05-15 10:59               ` Jan Ekström
2022-05-15 11:58                 ` Gyan Doshi
2022-05-15 12:21                   ` Jan Ekström [this message]
2022-05-17 12:16                     ` Jan Ekström
2022-05-11 16:30 ` Gyan Doshi
2022-05-11 18:44   ` Anton Khirnov

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=CAEu79SanjJVzXz46TH4NwGb_wiKtJLuimZPbQBZ1AXUth0WZCQ@mail.gmail.com \
    --to=jeebjp@gmail.com \
    --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