* [FFmpeg-devel] sendcmd filter now can send metadata
@ 2023-05-02 20:30 Сергей Солтанов
2023-05-14 9:31 ` Stefano Sabatini
0 siblings, 1 reply; 2+ messages in thread
From: Сергей Солтанов @ 2023-05-02 20:30 UTC (permalink / raw)
To: ffmpeg-devel
[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]
Hi!
I googled tonnes of information about how to forward data from one filter
to another, but nothing possible. The only way is to send some current
frame data as a command with sendcmd filter, but most of it accessible by
filters themselves.
Most of interesting data prepared by some analysing filters like
cropdetect, signalstats etc. and saved in frame metadata.
It could be a good idea to send it somehow to next filters in filtergraph.
So I added a small code to sendcmd filter, so it can evaluate function
meta(key) in its commands when [expr] flag is used, e.g.:
-------------------
ffmpeg ... -vf cropdetect=reset=1,\
sendcmd=c='0 [expr] crop x 10+meta(lavfi.cropdetect.x),\
[expr] crop y meta(lavfi.cropdetect.y)+meta(lavfi.cropdetect.h)/2,\
[expr] crop w meta(lavfi.cropdetect.w)-10\
[expr] crop h 0.5*meta(lavfi.cropdetect.h)'\
,crop
-------------------
I don't know how to use git here, so just cloned last version (v5.1) and
edited f_sendcmd.c.
If my contribution is interesting, I'll try to upload it into repository,
but I need some help, or maybe someone will do it?
Please, find updated file in attachment.
--
regarts,
Sergey Soltanov.
I'm Winston Wolf, I solve problems.
M2CONNECT.RU
[-- Attachment #2: f_sendcmd.c --]
[-- Type: application/octet-stream, Size: 21905 bytes --]
[-- Attachment #3: 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".
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [FFmpeg-devel] sendcmd filter now can send metadata
2023-05-02 20:30 [FFmpeg-devel] sendcmd filter now can send metadata Сергей Солтанов
@ 2023-05-14 9:31 ` Stefano Sabatini
0 siblings, 0 replies; 2+ messages in thread
From: Stefano Sabatini @ 2023-05-14 9:31 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On date Tuesday 2023-05-02 23:30:41 +0300, Сергей Солтанов wrote:
> Hi!
> I googled tonnes of information about how to forward data from one filter
> to another, but nothing possible. The only way is to send some current
> frame data as a command with sendcmd filter, but most of it accessible by
> filters themselves.
> Most of interesting data prepared by some analysing filters like
> cropdetect, signalstats etc. and saved in frame metadata.
> It could be a good idea to send it somehow to next filters in filtergraph.
>
> So I added a small code to sendcmd filter, so it can evaluate function
> meta(key) in its commands when [expr] flag is used, e.g.:
> -------------------
> ffmpeg ... -vf cropdetect=reset=1,\
> sendcmd=c='0 [expr] crop x 10+meta(lavfi.cropdetect.x),\
> [expr] crop y meta(lavfi.cropdetect.y)+meta(lavfi.cropdetect.h)/2,\
> [expr] crop w meta(lavfi.cropdetect.w)-10\
> [expr] crop h 0.5*meta(lavfi.cropdetect.h)'\
> ,crop
> -------------------
>
> I don't know how to use git here, so just cloned last version (v5.1) and
> edited f_sendcmd.c.
> If my contribution is interesting, I'll try to upload it into repository,
> but I need some help, or maybe someone will do it?
>
> Please, find updated file in attachment.
It's easier to review this if you send a patch:
https://ffmpeg.org/git-howto.html#Basics-Usage
This is the process:
git clone https://git.ffmpeg.org/ffmpeg.git
cd ffmpeg
# edit edit edit test edit
git diff
git commit -a
git format-patch HEAD~1
Then you send the generated patch as an attachment to your reply. We
also need documentation changes (in doc/filters.texi) to provide
context and examples for the feature.
Thanks.
_______________________________________________
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".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-14 9:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-02 20:30 [FFmpeg-devel] sendcmd filter now can send metadata Сергей Солтанов
2023-05-14 9:31 ` Stefano Sabatini
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