Re: [FFmpeg-user] Plotting Circles and labels on individual frames of a movie

2021-04-08 Thread Rainer M Krug
Thanks Michael - your book becomes even more valuable!


> On 8 Apr 2021, at 11:12, Michael Koch  wrote:
> 
> Am 08.04.2021 um 11:10 schrieb Rainer M Krug:
>> Hi Nicolas
>> 
>>> On 8 Apr 2021, at 10:58, Nicolas George  wrote:
>>> 
>>> Rainer M Krug (12021-04-08):
 I have found “draw_text”
 (https://ffmpeg.org/ffmpeg-filters.html#drawtext), but I have no idea
 how I could do this. We can assume that I have a text file with the
 following columns:
 
 FRAME: the frame on which the labels and circle should be plotted
 X: the x-coordinate
 Y: the y=coordinate
 LABEL: label for the point
 
 Also possibly important, there are multiple (many) particles for which
 circles and labels need to be plotted on each frame.
>>> This looks like something ASS subtitles can do easily.
> 
> Good idea!
> 
>> Interesting - could you give me some more pointers? Formats?
> 
> Chapter 2.139 in my book.
> 
> Michael
> 
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982





smime.p7s
Description: S/MIME cryptographic signature
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Plotting Circles and labels on individual frames of a movie

2021-04-08 Thread Rainer M Krug


> On 8 Apr 2021, at 10:23, Michael Koch  wrote:
> 
> Am 08.04.2021 um 09:46 schrieb Rainer M Krug:
>> Hi
>> 
>> I have a series of videos of moving particles (multiple particles per frame 
>> / movie), and would like to add a circle around each particle and add a 
>> label. At the moment I am using a script in R to plot, for each frame, these 
>> circles and labels into a png with alpha channel, combine the pngs to a 
>> movie, and overlay this movie to the original movie (see the thread 'Overlay 
>> images to frames in video’ for the background).
>> 
>> Now I realised, that the actual plotting of the labels takes up nearly 40% 
>> of the time of the R script and I would like to make this process faster.
>> 
>> I have found “draw_text” (https://ffmpeg.org/ffmpeg-filters.html#drawtext), 
>> but I have no idea how I could do this. We can assume that I have a text 
>> file with the following columns:
>> 
>> FRAME: the frame on which the labels and circle should be plotted
>> X: the x-coordinate
>> Y: the y=coordinate
>> LABEL: label for the point
>> 
>> Also possibly important, there are multiple (many) particles for which 
>> circles and labels need to be plotted on each frame.
>> 
>> I also found the “sendcmd” 
>> (https://ffmpeg.org/ffmpeg-filters.html#sendcmd_002c-asendcmd) but I do not 
>> get my head around how I can combine these two.
> 
> It's possible to do this with FFmpeg if the number of particles is known in 
> advance

Yes it is

> and constant in all frames.

No it isn’t.
But I should be able to extend the number of particles by plotting with size 0 
or outside the frame?


> Use several drawtext commands, one for each particle.

So I would have for each particle and each frame, a draw text command in the 
command,txt file which is read using the sendcmd command - is this correct?

Final point: how can I specify the frame as the start-end? I only fsaw in the 
documentation how to specify the time?

> But with a changing number of particles I have no idea how to do it. There 
> are a few examples for sendcmd in chapter 2.86 of my book:
> http://www.astro-electronic.de/FFmpeg_Book.pdf 
> 

Thanks for the link - I will loo into it, and it looks definitely useful!

Rainer

> 
> Michael
> 
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org 
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user 
> 
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org  with 
> subject "unsubscribe".

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982





smime.p7s
Description: S/MIME cryptographic signature
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Plotting Circles and labels on individual frames of a movie

2021-04-08 Thread Michael Koch

Am 08.04.2021 um 11:10 schrieb Rainer M Krug:

Hi Nicolas


On 8 Apr 2021, at 10:58, Nicolas George  wrote:

Rainer M Krug (12021-04-08):

I have found “draw_text”
(https://ffmpeg.org/ffmpeg-filters.html#drawtext), but I have no idea
how I could do this. We can assume that I have a text file with the
following columns:

FRAME: the frame on which the labels and circle should be plotted
X: the x-coordinate
Y: the y=coordinate
LABEL: label for the point

Also possibly important, there are multiple (many) particles for which
circles and labels need to be plotted on each frame.

This looks like something ASS subtitles can do easily.


Good idea!


Interesting - could you give me some more pointers? Formats?


Chapter 2.139 in my book.

Michael

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Plotting Circles and labels on individual frames of a movie

2021-04-08 Thread Rainer M Krug
Hi Nicolas

> On 8 Apr 2021, at 10:58, Nicolas George  wrote:
> 
> Rainer M Krug (12021-04-08):
>> I have found “draw_text”
>> (https://ffmpeg.org/ffmpeg-filters.html#drawtext), but I have no idea
>> how I could do this. We can assume that I have a text file with the
>> following columns:
>> 
>> FRAME: the frame on which the labels and circle should be plotted
>> X: the x-coordinate
>> Y: the y=coordinate
>> LABEL: label for the point
>> 
>> Also possibly important, there are multiple (many) particles for which
>> circles and labels need to be plotted on each frame. 
> 
> This looks like something ASS subtitles can do easily.

Interesting - could you give me some more pointers? Formats?

Rainer


> 
> Regards,
> 
> -- 
>  Nicolas George
> 

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982





smime.p7s
Description: S/MIME cryptographic signature
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Plotting Circles and labels on individual frames of a movie

2021-04-08 Thread Nicolas George
Rainer M Krug (12021-04-08):
> I have found “draw_text”
> (https://ffmpeg.org/ffmpeg-filters.html#drawtext), but I have no idea
> how I could do this. We can assume that I have a text file with the
> following columns:
> 
> FRAME: the frame on which the labels and circle should be plotted
> X: the x-coordinate
> Y: the y=coordinate
> LABEL: label for the point
> 
> Also possibly important, there are multiple (many) particles for which
> circles and labels need to be plotted on each frame. 

This looks like something ASS subtitles can do easily.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Plotting Circles and labels on individual frames of a movie

2021-04-08 Thread Michael Koch

Am 08.04.2021 um 09:46 schrieb Rainer M Krug:

Hi

I have a series of videos of moving particles (multiple particles per frame / 
movie), and would like to add a circle around each particle and add a label. At 
the moment I am using a script in R to plot, for each frame, these circles and 
labels into a png with alpha channel, combine the pngs to a movie, and overlay 
this movie to the original movie (see the thread 'Overlay images to frames in 
video’ for the background).

Now I realised, that the actual plotting of the labels takes up nearly 40% of 
the time of the R script and I would like to make this process faster.

I have found “draw_text” (https://ffmpeg.org/ffmpeg-filters.html#drawtext), but 
I have no idea how I could do this. We can assume that I have a text file with 
the following columns:

FRAME: the frame on which the labels and circle should be plotted
X: the x-coordinate
Y: the y=coordinate
LABEL: label for the point

Also possibly important, there are multiple (many) particles for which circles 
and labels need to be plotted on each frame.

I also found the “sendcmd” 
(https://ffmpeg.org/ffmpeg-filters.html#sendcmd_002c-asendcmd) but I do not get 
my head around how I can combine these two.


It's possible to do this with FFmpeg if the number of particles is known 
in advance and constant in all frames. Use several drawtext commands, 
one for each particle. But with a changing number of particles I have no 
idea how to do it. There are a few examples for sendcmd in chapter 2.86 
of my book:

http://www.astro-electronic.de/FFmpeg_Book.pdf

Michael

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] Plotting Circles and labels on individual frames of a movie

2021-04-08 Thread Rainer M Krug
Hi

I have a series of videos of moving particles (multiple particles per frame / 
movie), and would like to add a circle around each particle and add a label. At 
the moment I am using a script in R to plot, for each frame, these circles and 
labels into a png with alpha channel, combine the pngs to a movie, and overlay 
this movie to the original movie (see the thread 'Overlay images to frames in 
video’ for the background).

Now I realised, that the actual plotting of the labels takes up nearly 40% of 
the time of the R script and I would like to make this process faster.

I have found “draw_text” (https://ffmpeg.org/ffmpeg-filters.html#drawtext), but 
I have no idea how I could do this. We can assume that I have a text file with 
the following columns:

FRAME: the frame on which the labels and circle should be plotted
X: the x-coordinate
Y: the y=coordinate
LABEL: label for the point

Also possibly important, there are multiple (many) particles for which circles 
and labels need to be plotted on each frame. 

I also found the “sendcmd” 
(https://ffmpeg.org/ffmpeg-filters.html#sendcmd_002c-asendcmd) but I do not get 
my head around how I can combine these two.

Any help appreciated,

Rainer


--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982





smime.p7s
Description: S/MIME cryptographic signature
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".