metadata from concat list not working

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

metadata from concat list not working

Goran Obal
Hi.

I am trying to create a video from my music files, creating audio
visualization with showfreqs and displaying current filename with drawtext.

Here is my command:

ffmpeg -f concat -safe 0 -i files.txt -filter_complex
"[0:a]showfreqs=cmode=separate:colors=cyan|orange,drawtext=text='%{metadata\:title\:blah}':font=verdana:fontsize=56:fontcolor=white:x=(main_w/2-text_w/2):y=20[outv]"
-map [outv] -map 0:a -c:v h264_nvenc -c:a copy -pix_fmt yuv420p -shortest
video.mkv

And this is my files.txt:

file 'Alarm01.wav'
file_packet_metadata title=Alarm01
file 'Alarm02.wav'
file_packet_metadata title=Alarm02

Somehow this is not working for me and I don't understand why. My video
displays text "blah", which tells me that ffmpeg can't find the metadata...

I was also reading this: https://rensa.co/projects/ccrc-weather-station/
and they have done pretty much the same, only with pictures. And it worked
for them. I tried to reproduce what they have done - with pictures - but I
again don't get the metadata drawn...

Any help would be appreciated.

Kind regards.
Goran
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: metadata from concat list not working

Nicolas George
Goran Obal (12019-09-29):
> Somehow this is not working for me and I don't understand why. My video
> displays text "blah", which tells me that ffmpeg can't find the metadata...

I suspect you are confusing stream metadata and packet metadata.

Regards,

--
  Nicolas George

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: metadata from concat list not working

Goran Obal
Hi Nicolas,

I am trying to understand what you meant, but unfortunately I don't get it.
I am still a beginner with video filters of ffmpeg and what I read in the
documentation for stream metadata and packet metadata didn't help me to see
what I was confusing.

What I would like to understand is why does it work for the weather station
(the link in my first email) and why is the same logic accepted here:
https://superuser.com/questions/1336844/is-it-possible-to-burn-a-filename-watermark-in-the-corner-of-a-concatenated-imag
as
an answer.
When I try to reproduce what the weather station has or what this second
link describes, I don't get the text in the video. The weather station even
posted its video and there you can clearly see that the metadata
from custom-list.txt is displayed on bottom-left of the video
<https://www.youtube.com/watch?v=nq4ZGtLOw6Q>.

If it worked for them, why doesn't it work when I try to reproduce it?

Best regards.
Goran


On Sun, Sep 29, 2019 at 7:39 PM Nicolas George <[hidden email]> wrote:

> Goran Obal (12019-09-29):
> > Somehow this is not working for me and I don't understand why. My video
> > displays text "blah", which tells me that ffmpeg can't find the
> metadata...
>
> I suspect you are confusing stream metadata and packet metadata.
>
> Regards,
>
> --
>   Nicolas George
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: metadata from concat list not working

Goran Obal
Hi everyone,

I apologize for spamming... I just saw that it is in fact working for me
when I do it with pictures, I was just using such examples that the text
was not visible. Sorry.
So, yes, it seems I don't understand what is different when I create video
from a bunch of pictures and when I use filter_complex to create video from
audio files and try to write text over it... I assume that the "picture
way" is then packet and the "audio visualization filter way" is then a
stream.
So I think my question should be: Can I inject metadata to a stream?

Best regards.
Goran


On Mon, Sep 30, 2019 at 10:47 AM Goran Obal <[hidden email]> wrote:

> Hi Nicolas,
>
> I am trying to understand what you meant, but unfortunately I don't get it.
> I am still a beginner with video filters of ffmpeg and what I read in the
> documentation for stream metadata and packet metadata didn't help me to see
> what I was confusing.
>
> What I would like to understand is why does it work for the weather
> station (the link in my first email) and why is the same logic accepted
> here:
> https://superuser.com/questions/1336844/is-it-possible-to-burn-a-filename-watermark-in-the-corner-of-a-concatenated-imag as
> an answer.
> When I try to reproduce what the weather station has or what this second
> link describes, I don't get the text in the video. The weather station even
> posted its video and there you can clearly see that the metadata
> from custom-list.txt is displayed on bottom-left of the video
> <https://www.youtube.com/watch?v=nq4ZGtLOw6Q>.
>
> If it worked for them, why doesn't it work when I try to reproduce it?
>
> Best regards.
> Goran
>
>
> On Sun, Sep 29, 2019 at 7:39 PM Nicolas George <[hidden email]> wrote:
>
>> Goran Obal (12019-09-29):
>> > Somehow this is not working for me and I don't understand why. My video
>> > displays text "blah", which tells me that ffmpeg can't find the
>> metadata...
>>
>> I suspect you are confusing stream metadata and packet metadata.
>>
>> Regards,
>>
>> --
>>   Nicolas George
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: metadata from concat list not working

Paul B Mahol
On 9/30/19, Goran Obal <[hidden email]> wrote:

> Hi everyone,
>
> I apologize for spamming... I just saw that it is in fact working for me
> when I do it with pictures, I was just using such examples that the text
> was not visible. Sorry.
> So, yes, it seems I don't understand what is different when I create video
> from a bunch of pictures and when I use filter_complex to create video from
> audio files and try to write text over it... I assume that the "picture
> way" is then packet and the "audio visualization filter way" is then a
> stream.
> So I think my question should be: Can I inject metadata to a stream?

Yes with ametadata and metadata filters, read their documentation.
Note that drawtext filter command you used use only frame metadata,
and frame metadata
can be added/removed/changed by mentioned filters above.
The concat demuxer can not set/remove/change frame metadata.
Also frame metadata is per each frame and can obviously disappear and
appear at any time.
AFAIK there is no way for filters to know stream metadata, so your
approach to draw text is wrong.

Stream metadata is static per stream and never changes.
Frame metadata can be available in each filtered frame.

>
> Best regards.
> Goran
>
>
> On Mon, Sep 30, 2019 at 10:47 AM Goran Obal <[hidden email]> wrote:
>
>> Hi Nicolas,
>>
>> I am trying to understand what you meant, but unfortunately I don't get
>> it.
>> I am still a beginner with video filters of ffmpeg and what I read in the
>> documentation for stream metadata and packet metadata didn't help me to
>> see
>> what I was confusing.
>>
>> What I would like to understand is why does it work for the weather
>> station (the link in my first email) and why is the same logic accepted
>> here:
>> https://superuser.com/questions/1336844/is-it-possible-to-burn-a-filename-watermark-in-the-corner-of-a-concatenated-imag
>> as
>> an answer.
>> When I try to reproduce what the weather station has or what this second
>> link describes, I don't get the text in the video. The weather station
>> even
>> posted its video and there you can clearly see that the metadata
>> from custom-list.txt is displayed on bottom-left of the video
>> <https://www.youtube.com/watch?v=nq4ZGtLOw6Q>.
>>
>> If it worked for them, why doesn't it work when I try to reproduce it?
>>
>> Best regards.
>> Goran
>>
>>
>> On Sun, Sep 29, 2019 at 7:39 PM Nicolas George <[hidden email]> wrote:
>>
>>> Goran Obal (12019-09-29):
>>> > Somehow this is not working for me and I don't understand why. My video
>>> > displays text "blah", which tells me that ffmpeg can't find the
>>> metadata...
>>>
>>> I suspect you are confusing stream metadata and packet metadata.
>>>
>>> Regards,
>>>
>>> --
>>>   Nicolas George
>>> _______________________________________________
>>> ffmpeg-user mailing list
>>> [hidden email]
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>>
>>> To unsubscribe, visit link above, or email
>>> [hidden email] with subject "unsubscribe".
>>
>>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: metadata from concat list not working

Goran Obal
OK, thanks to everyone who answered.

I couldn't figure it out any other way, so I am just sending you my
solution in case anyone is interested.

Step 1 (use for loop to create videos (mkv) from all audio files - in my
case wav, change that to what you need):
for %i in (*wav) do ffmpeg -i %i -filter_complex
"[0:a]showfreqs=cmode=separate:colors=cyan|orange,drawtext=text='%~ni':font=verdana:fontsize=56:fontcolor=white:x=(main_w/2-text_w/2):y=20[outv]"
-map [outv] -map 0:a -c:v h264_nvenc -c:a copy -pix_fmt yuv420p -shortest
%~ni.mkv

Step 2 (use for loop to create a list of all created videos):
for %i in (*mkv) do echo file '%i'>>video.txt

Step 3 (concatenate all videos into one):
ffmpeg -f concat -safe 0 -i video.txt -c copy finale.mkv

If anyone has any more suggestions how to bring this into one step, that
would be awesome, if not, this is how to do it if you need/want it.

Kind regards.
Goran


On Mon, Sep 30, 2019 at 11:44 AM Paul B Mahol <[hidden email]> wrote:

> On 9/30/19, Goran Obal <[hidden email]> wrote:
> > Hi everyone,
> >
> > I apologize for spamming... I just saw that it is in fact working for me
> > when I do it with pictures, I was just using such examples that the text
> > was not visible. Sorry.
> > So, yes, it seems I don't understand what is different when I create
> video
> > from a bunch of pictures and when I use filter_complex to create video
> from
> > audio files and try to write text over it... I assume that the "picture
> > way" is then packet and the "audio visualization filter way" is then a
> > stream.
> > So I think my question should be: Can I inject metadata to a stream?
>
> Yes with ametadata and metadata filters, read their documentation.
> Note that drawtext filter command you used use only frame metadata,
> and frame metadata
> can be added/removed/changed by mentioned filters above.
> The concat demuxer can not set/remove/change frame metadata.
> Also frame metadata is per each frame and can obviously disappear and
> appear at any time.
> AFAIK there is no way for filters to know stream metadata, so your
> approach to draw text is wrong.
>
> Stream metadata is static per stream and never changes.
> Frame metadata can be available in each filtered frame.
>
> >
> > Best regards.
> > Goran
> >
> >
> > On Mon, Sep 30, 2019 at 10:47 AM Goran Obal <[hidden email]>
> wrote:
> >
> >> Hi Nicolas,
> >>
> >> I am trying to understand what you meant, but unfortunately I don't get
> >> it.
> >> I am still a beginner with video filters of ffmpeg and what I read in
> the
> >> documentation for stream metadata and packet metadata didn't help me to
> >> see
> >> what I was confusing.
> >>
> >> What I would like to understand is why does it work for the weather
> >> station (the link in my first email) and why is the same logic accepted
> >> here:
> >>
> https://superuser.com/questions/1336844/is-it-possible-to-burn-a-filename-watermark-in-the-corner-of-a-concatenated-imag
> >> as
> >> an answer.
> >> When I try to reproduce what the weather station has or what this second
> >> link describes, I don't get the text in the video. The weather station
> >> even
> >> posted its video and there you can clearly see that the metadata
> >> from custom-list.txt is displayed on bottom-left of the video
> >> <https://www.youtube.com/watch?v=nq4ZGtLOw6Q>.
> >>
> >> If it worked for them, why doesn't it work when I try to reproduce it?
> >>
> >> Best regards.
> >> Goran
> >>
> >>
> >> On Sun, Sep 29, 2019 at 7:39 PM Nicolas George <[hidden email]> wrote:
> >>
> >>> Goran Obal (12019-09-29):
> >>> > Somehow this is not working for me and I don't understand why. My
> video
> >>> > displays text "blah", which tells me that ffmpeg can't find the
> >>> metadata...
> >>>
> >>> I suspect you are confusing stream metadata and packet metadata.
> >>>
> >>> Regards,
> >>>
> >>> --
> >>>   Nicolas George
> >>> _______________________________________________
> >>> ffmpeg-user mailing list
> >>> [hidden email]
> >>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >>>
> >>> To unsubscribe, visit link above, or email
> >>> [hidden email] with subject "unsubscribe".
> >>
> >>
> > _______________________________________________
> > ffmpeg-user mailing list
> > [hidden email]
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > To unsubscribe, visit link above, or email
> > [hidden email] with subject "unsubscribe".
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".