Re: [FFmpeg-user] Re-writing hot .ts file that rotates every 24 hours in realtime

2021-02-15 Thread Korn Moffle

Hi,

thank you for your reply:

What I am trying to do:

a. copy the file in realtime ? So, ffmpeg would be rewriting file1.ts into 
file2.ts as file1.ts is constantly being written into.
b. tell ffmpeg to read the file with a constant 3 second delay from the most 
updated frame?
c. if a new file appears, detect it and switch to it?

My existing solution of using -re and -sseof has several disadvantages:

  1.  if use -sseof and -re together, I am missing the beginning of the file
  2.  if use only -re, then I need to launch ffmpeg few seconds after the new 
file is created otherwise I would be constantly hours behind.
  3.  I am sure there are a lot of other issues that I am not seeing

What is OS?
TS files are written on Windows 10 64 bit

What language the program is written in?
The program is written in GNU C++ (GCC) , but we can either use the library of 
if there is a way to do it from MSDOS shell - even better!

Thank you!


Sent from Outlook


From: ffmpeg-user  on behalf of Michael Glenn 
Williams 
Sent: Friday, February 12, 2021 7:18 PM
To: FFmpeg user questions 
Subject: Re: [FFmpeg-user] Re-writing hot .ts file that rotates every 24 hours 
in realtime

Hi Korn,

We need additional info to help you. What O/S are you working with?
This is relevant to the buffered input and output when reading from stdin
and writing to stdout.
What language are you writing your script/program in?
This is relevant to what capabilities your tool will have access to.

Thank you for your question!
___
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 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] Filter documentation -- PTSs

2021-02-15 Thread Chris Angelico
On Tue, Feb 16, 2021 at 1:23 PM Mark Filipak (ffmpeg)
 wrote:
>
> On 02/15/2021 08:54 PM, Chris Angelico wrote:
> > On Tue, Feb 16, 2021 at 12:45 PM Mark Filipak (ffmpeg)
> >  wrote:
> -bigsnip-
> >> The rest of 'C' syntax, and precedent, and operators, etc. I know. It's 
> >> just pointers that mystify
> >> me. Now I understand what a struct actually is but pointers?... not so 
> >> much. I thought I understood,
> >> but '**' fuddled it. I'm afraid I'm one of the people who, for example, 
> >> actually prefer BNF to
> >> textual descriptions.
> >
> > A pointer, ultimately, is just a number - the address of the next
> > thing. So the pointer-to-pointer is saying "at this address, you can
> > find the address you want".
> >
> > If this isn't helpful, feel free to ignore it; I'm sure there's BNF
> > around somewhere to explain it, but I'm not sure I could write it that
> > way, sorry.
>
> Hahaha... I brought up BNF just to illustrate how anal compulsive I am. For 
> example, documentation
> that's just for my eyes is full of regex & BNF.
>
> You've given me a good push. Thanks so much. I hope I can pull a thorn out of 
> your paw some day.

Or out of someone else's. Pass it forward, help the next person! :)
Happy to help!

ChrisA
___
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] Filter documentation -- PTSs

2021-02-15 Thread Mark Filipak (ffmpeg)

On 02/15/2021 08:54 PM, Chris Angelico wrote:

On Tue, Feb 16, 2021 at 12:45 PM Mark Filipak (ffmpeg)
 wrote:

-bigsnip-

The rest of 'C' syntax, and precedent, and operators, etc. I know. It's just 
pointers that mystify
me. Now I understand what a struct actually is but pointers?... not so much. I 
thought I understood,
but '**' fuddled it. I'm afraid I'm one of the people who, for example, 
actually prefer BNF to
textual descriptions.


A pointer, ultimately, is just a number - the address of the next
thing. So the pointer-to-pointer is saying "at this address, you can
find the address you want".

If this isn't helpful, feel free to ignore it; I'm sure there's BNF
around somewhere to explain it, but I'm not sure I could write it that
way, sorry.


Hahaha... I brought up BNF just to illustrate how anal compulsive I am. For example, documentation 
that's just for my eyes is full of regex & BNF.


You've given me a good push. Thanks so much. I hope I can pull a thorn out of 
your paw some day.

The ffmpeg source code and header files remind me of minified json. Everything is there, but it's 
all so abstract that it's nearly impossible to read.


Take care, and thanks again,
Mark.

--
Any journey, no matter how long, is just a series of small steps.
"Government is the problem!" -- 1982 and onward.
"___ is the enemy of the people!" -- 2016 and onward.
"You have to fight like hell or you're not going to have a country!" -- Jan 6, 
2021.
It isn't the distance that's important, it's the direction.
___
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] Trying to stream to rtmp from my rsp4 and a GoPro

2021-02-15 Thread Mark Filipak (ffmpeg)

On 02/15/2021 06:29 PM, Mike Soultanian wrote:
-bigsnip-

You can - easily - let the audio stream start with 0 but the problem
is that the result will not play in-sync, see the setps documentation.


What is 'setps'? A filter, a protocol, a muxer, what? I've searched through all the docs and can't 
find it.


Thanks!

--
Any journey, no matter how long, is just a series of small steps.
"Government is the problem!" -- 1982 and onward.
"___ is the enemy of the people!" -- 2016 and onward.
"You have to fight like hell or you're not going to have a country!" -- Jan 6, 
2021.
It isn't the distance that's important, it's the direction.
___
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] Filter documentation -- PTSs

2021-02-15 Thread Chris Angelico
On Tue, Feb 16, 2021 at 12:45 PM Mark Filipak (ffmpeg)
 wrote:
>
> On 02/15/2021 06:47 PM, Chris Angelico wrote:
> > On Tue, Feb 16, 2021 at 8:44 AM Mark Filipak (ffmpeg)
> >  wrote:
> >>
> >> On 02/15/2021 04:32 PM, Carl Zwanzig wrote:
> >>> On 2/15/2021 1:26 PM, Mark Filipak (ffmpeg) wrote:
>  Yes, I'm aware of C++. It's sort of a 'C' language architecture hack, 
>  isn't it?
> >>> More like butchery ...
> >>
> >> O... that's harsh.  :-)
> >>
> >>> Glad it's making more sense now.
> >>>
> >>> z!
> >>
> >> Thanks for the confirmation. Now, regarding pointers-to-pointers and '*' 
> >> as a unary operator.
> >>
> >
> > A pointer, at its core, is a number representing a place in memory. A
> > pointer to a pointer is a number representing the place in memory
> > where you can find another number that'll tell you where you want to
> > go. You want to know where the Sword Master can be found, but I won't
> > tell you where he is; all I'll tell you is that the shopkeeper knows
> > where to find the Sword Master. I point you to the shopkeeper, and
> > then you ask him to point you to the Sword Master.
> >
> > The asterisk, as a unary operator, is one step in that process.
> > Something like this:
> >
> > int **trial = find_sword_master();
>
> Oops, I'm getting lost in the story of the Sword Master. You're describing 
> indirection. I have no
> problem with indirection. The problem I have is simply with syntax 
> interpretation because to me,
> every variable (or constant) in every language is a location in memory, so 
> when you write that a
> number represents a place in memory, to me it's undistinguished, it's not any 
> different than any
> other variable (in any location in memory).
>
> Does '*' (a unary operator) that precedes a variable's name indicate that the 
> named variable is a
> pointer? Or do I have that bit wrong?

Yes, it does. For "*trial" to be meaningful, "trial" has to be a pointer.

> Is '**' also a unary operator? Or is it 2 unary operators, '*'+'*'? I suspect 
> that '**' is the
> infamous pointer-to-pointer (i.e. doubly indirect), or do I have that bit 
> wrong?

It's two separate unary operators, which is why I wrote it in one
place as *(*trial) - has the same meaning. Yes, "**trial" implies that
trial is a pointer to a pointer.

> > "trial" is a number that says where in memory the shopkeeper is.
> > What's that number?
> >
> > printf("Shopkeeper is at %p\n", trial);
>
> I have no idea what '%p' means or what you're trying to demonstrate by the 
> code. I don't know why
> the printf has a 2nd arg: 'trial'. '%' is modulo, but modulo is a binary 
> operator, not a unary
> operator. That it's in a string just adds to the mystery.

Ah, printf is doing formatted output, so it interpolates a value.
Sorry, if you're not familiar with that, just ignore it.

> > "*trial" is the number that can be found there. What's that number?
> >
> > printf("Sword Master is at %p\n", *trial);
>
> Okay, now I'm lost. is 'trial' a variable or a pointer?

Both. In the same way that "int x = 5;" has x as a variable and an integer.

> Specifically, is '*trial' a pointer that's
> labeled "trial" or is it a pointer to a variable that's labeled "trial"?

It's a pointer that's labelled "trial". The name refers to the
variable that has the first pointer - or if you prefer, it refers to
the variable that has the address of the second step.

> Or are both labeled
> "trial"? Or does the string "*trial" just represent an entity that's just a 
> relative memory address
> that neither the compiler nor the runtime system normally discloses? If your 
> 'printf' functions
> print, what do they print? ...Yes, I know that 'print' doesn't mean print on 
> a printer. The only
> thing I can guess is that "%p" is some sort of token, but I don't know its 
> meaning.

Don't worry about the printf stuff, that's just a quick way to print
out the numbers involved.

> The rest of 'C' syntax, and precedent, and operators, etc. I know. It's just 
> pointers that mystify
> me. Now I understand what a struct actually is but pointers?... not so much. 
> I thought I understood,
> but '**' fuddled it. I'm afraid I'm one of the people who, for example, 
> actually prefer BNF to
> textual descriptions.
>

A pointer, ultimately, is just a number - the address of the next
thing. So the pointer-to-pointer is saying "at this address, you can
find the address you want".

If this isn't helpful, feel free to ignore it; I'm sure there's BNF
around somewhere to explain it, but I'm not sure I could write it that
way, sorry.

ChrisA
___
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] Trying to stream to rtmp from my rsp4 and a GoPro

2021-02-15 Thread Mike Soultanian

On 2/15/2021 5:47 PM, Chris Angelico wrote:


Not sure if it's the same cause, but a friend of mine has a similar
setup, and she had the same sort of problem when streaming on Twitch.
Her solution was to set it to 4k 30fps and select recording video mode
(without actually recording).

ChrisA


Hey Chris,

I was having problems well before even trying to stream to Twitch - I 
was just trying to capture (record) audio and video being captured from 
my HDMI output and it just wouldn't work.  Had I just unplugged my USB 
capture device, it would have started work :/


___
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] Trying to stream to rtmp from my rsp4 and a GoPro

2021-02-15 Thread Chris Angelico
On Tue, Feb 16, 2021 at 10:35 AM Mike Soultanian  wrote:
>
> Well.. that was extremely frustrating. I've seriously been going at this
> for probably 16 hours, scouring the net for documentation and trying
> other people's tutorials, wondering why my setup wasn't working as well
> as all the examples that described all the cool stuff you could do with
> ffmpeg.  It was only after I purchased another capture card (Elgato Cam
> Link 4k) that I found I found this article when searching for *ffmpeg
> elgato cam link* and found this page:
>
> https://blog.eigenvalue.net/ffmpeg-elgato-camlink-4k/
>
> What was so crucial was one little tidbit towards the end of the page
> where the author writes (referring to running the ffmpeg command):
>
> > Unfortunately, most of the time it will get stuck after two frames.
> > After some random experimentation, I noticed that unplugging the
> > device allowed me to record once, most of the time. I think that it is
> > due to syncing the audio / video stream. The video source seems to
> > request key frames doesn't get the expected data afterwards. Or
> > something else.
> >
>
> This was *exactly* the behavior I was running into, but I had no idea
> that I was actually running into that particular issue!  This whole time
> I had a gut feeling that there was somewhat inconsistent behavior
> (sometimes it would seem to work and then on the next run with the same
> settings it would have very low FPS), but I'm a total newbie to this so
> I didn't know if this was just normal behavior or something was wrong.

Not sure if it's the same cause, but a friend of mine has a similar
setup, and she had the same sort of problem when streaming on Twitch.
Her solution was to set it to 4k 30fps and select recording video mode
(without actually recording).

ChrisA
___
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] Filter documentation -- PTSs

2021-02-15 Thread Mark Filipak (ffmpeg)

On 02/15/2021 06:47 PM, Chris Angelico wrote:

On Tue, Feb 16, 2021 at 8:44 AM Mark Filipak (ffmpeg)
 wrote:


On 02/15/2021 04:32 PM, Carl Zwanzig wrote:

On 2/15/2021 1:26 PM, Mark Filipak (ffmpeg) wrote:

Yes, I'm aware of C++. It's sort of a 'C' language architecture hack, isn't it?

More like butchery ...


O... that's harsh.  :-)


Glad it's making more sense now.

z!


Thanks for the confirmation. Now, regarding pointers-to-pointers and '*' as a 
unary operator.



A pointer, at its core, is a number representing a place in memory. A
pointer to a pointer is a number representing the place in memory
where you can find another number that'll tell you where you want to
go. You want to know where the Sword Master can be found, but I won't
tell you where he is; all I'll tell you is that the shopkeeper knows
where to find the Sword Master. I point you to the shopkeeper, and
then you ask him to point you to the Sword Master.

The asterisk, as a unary operator, is one step in that process.
Something like this:

int **trial = find_sword_master();


Oops, I'm getting lost in the story of the Sword Master. You're describing indirection. I have no 
problem with indirection. The problem I have is simply with syntax interpretation because to me, 
every variable (or constant) in every language is a location in memory, so when you write that a 
number represents a place in memory, to me it's undistinguished, it's not any different than any 
other variable (in any location in memory).


Does '*' (a unary operator) that precedes a variable's name indicate that the named variable is a 
pointer? Or do I have that bit wrong?


Is '**' also a unary operator? Or is it 2 unary operators, '*'+'*'? I suspect that '**' is the 
infamous pointer-to-pointer (i.e. doubly indirect), or do I have that bit wrong?



"trial" is a number that says where in memory the shopkeeper is.
What's that number?

printf("Shopkeeper is at %p\n", trial);


I have no idea what '%p' means or what you're trying to demonstrate by the code. I don't know why 
the printf has a 2nd arg: 'trial'. '%' is modulo, but modulo is a binary operator, not a unary 
operator. That it's in a string just adds to the mystery.



"*trial" is the number that can be found there. What's that number?

printf("Sword Master is at %p\n", *trial);


Okay, now I'm lost. is 'trial' a variable or a pointer? Specifically, is '*trial' a pointer that's 
labeled "trial" or is it a pointer to a variable that's labeled "trial"? Or are both labeled 
"trial"? Or does the string "*trial" just represent an entity that's just a relative memory address 
that neither the compiler nor the runtime system normally discloses? If your 'printf' functions 
print, what do they print? ...Yes, I know that 'print' doesn't mean print on a printer. The only 
thing I can guess is that "%p" is some sort of token, but I don't know its meaning.


The rest of 'C' syntax, and precedent, and operators, etc. I know. It's just pointers that mystify 
me. Now I understand what a struct actually is but pointers?... not so much. I thought I understood, 
but '**' fuddled it. I'm afraid I'm one of the people who, for example, actually prefer BNF to 
textual descriptions.


--
Any journey, no matter how long, is just a series of small steps.
"Government is the problem!" -- 1982 and onward.
"___ is the enemy of the people!" -- 2016 and onward.
"You have to fight like hell or you're not going to have a country!" -- Jan 6, 
2021.
It isn't the distance that's important, it's the direction.
___
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] Filter documentation -- PTSs

2021-02-15 Thread Chris Angelico
On Tue, Feb 16, 2021 at 8:44 AM Mark Filipak (ffmpeg)
 wrote:
>
> On 02/15/2021 04:32 PM, Carl Zwanzig wrote:
> > On 2/15/2021 1:26 PM, Mark Filipak (ffmpeg) wrote:
> >> Yes, I'm aware of C++. It's sort of a 'C' language architecture hack, 
> >> isn't it?
> > More like butchery ...
>
> O... that's harsh.  :-)
>
> > Glad it's making more sense now.
> >
> > z!
>
> Thanks for the confirmation. Now, regarding pointers-to-pointers and '*' as a 
> unary operator.
>

A pointer, at its core, is a number representing a place in memory. A
pointer to a pointer is a number representing the place in memory
where you can find another number that'll tell you where you want to
go. You want to know where the Sword Master can be found, but I won't
tell you where he is; all I'll tell you is that the shopkeeper knows
where to find the Sword Master. I point you to the shopkeeper, and
then you ask him to point you to the Sword Master.

The asterisk, as a unary operator, is one step in that process.
Something like this:

int **trial = find_sword_master();

"trial" is a number that says where in memory the shopkeeper is.
What's that number?

printf("Shopkeeper is at %p\n", trial);

"*trial" is the number that can be found there. What's that number?

printf("Sword Master is at %p\n", *trial);

The number you found when you asked the shopkeeper is the address of
the Sword Master. So if you want to actually learn what the sword
master can teach you, you'd have to go to that address.

printf("Sword Master can teach you: %d\n", *(*trial));

and since the parentheses do nothing there, that's just the same as "**trial".

The unary asterisk is the technique of following a pointer to find out
what it points to, and you can do it more than once.

There's a lot of monkeying around in C, but most of it comes down to a
few simple operations, done lots and lots of times. So if you're stuck
thinking there are no clever tricks that could help you, don't worry -
there are, you just might have never learned them. And that's a
solvable problem.

ChrisA
(I post like a dairy farmer.)
___
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] Trying to stream to rtmp from my rsp4 and a GoPro

2021-02-15 Thread Mike Soultanian
Well.. that was extremely frustrating. I've seriously been going at this 
for probably 16 hours, scouring the net for documentation and trying 
other people's tutorials, wondering why my setup wasn't working as well 
as all the examples that described all the cool stuff you could do with 
ffmpeg.  It was only after I purchased another capture card (Elgato Cam 
Link 4k) that I found I found this article when searching for *ffmpeg 
elgato cam link* and found this page:


https://blog.eigenvalue.net/ffmpeg-elgato-camlink-4k/

What was so crucial was one little tidbit towards the end of the page 
where the author writes (referring to running the ffmpeg command):


Unfortunately, most of the time it will get stuck after two frames. 
After some random experimentation, I noticed that unplugging the 
device allowed me to record once, most of the time. I think that it is 
due to syncing the audio / video stream. The video source seems to 
request key frames doesn't get the expected data afterwards. Or 
something else.




This was *exactly* the behavior I was running into, but I had no idea 
that I was actually running into that particular issue!  This whole time 
I had a gut feeling that there was somewhat inconsistent behavior 
(sometimes it would seem to work and then on the next run with the same 
settings it would have very low FPS), but I'm a total newbie to this so 
I didn't know if this was just normal behavior or something was wrong.  
I really wonder how many people run into this kind of issue because not 
only did this slow me down big time, but I also feel bad for wasting 
other people's time on something for which there's a super-simple fix. 
I'm not sure if it isn't already in the documentation, but it would 
probably be smart to make mention of this somewhere.  Also, if there's 
any way for ffmeg to detect that it's in this kind of state, I think 
that would be great if it were to throw a warning that something is up.  
I'm not sure if it's possible, but I felt it worth mentioning.


Soo, after running this nifty command before running ffmpeg:

sudo sh -c "echo 0 > /sys/bus/usb/devices/2-1/authorized";sudo sh -c 
"echo 1 > /sys/bus/usb/devices/2-1/authorized";


voila!  It captures at 30fps, and with my cheap-o capture card!  I'll be 
returning the Elgato Cam Link 4k because it seems like it only outputs 
at 4k, and if I'm understanding things correctly, that means I'm 
expending extra CPU cycles to down-convert it to 720p instead of it 
already being at 720p.  Plus, why spend $99 if I don't need to!?


So Carl, to answer your questions:

To answer your questions:

I was thinking about yuv420p but I don't know how you want to encode
(and what you plan to do with the resulting file).


My ultimate goal is to stream my GoPro into my Raspberry Pi, then send 
that over a mobile link up to Twitch for my IRL live stream. I just 
tried streaming to Twitch from my GoPro through the Raspberry Pi (with a 
direct Internet connection) this morning and it works!  Oddly, the 
timestamps are different, but the audio does seem to be synced so I 
guess I'll run with it?!  Now that I got things working I will start 
with the wiki guide for streaming on the ffmpeg site.



It would seem like both my capture card and my logitech support
the same formats, but the logitech 920 also lists h264 (listed below)
- is that why it's allowing it to work?

That's completely unrelated but has the advantage that you don't have
to encode.


Got it!



What I don't understand is why I'm able to record either video or audio
from the capture card, but when they're both together it's not happy.

How should FFmpeg mux audio and video if one has timestamps
starting with 0 and the other with 1000?
You can - easily - let the audio stream start with 0 but the problem
is that the result will not play in-sync, see the setps documentation.


Fortunately it seems like this isn't an issue now that I got things 
resolved by unplugging the unit before running it...


Thanks for your patience on this!  I appreciate the help so far - lots 
of learning going on here!


___
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] Filter documentation -- PTSs

2021-02-15 Thread Chris Angelico
On Tue, Feb 16, 2021 at 8:29 AM Mark Filipak (ffmpeg)
 wrote:
>
> On 02/15/2021 06:38 AM, Chris Angelico wrote:
> > On Mon, Feb 15, 2021 at 9:21 PM Mark Filipak (ffmpeg)
> >  wrote:
> >> On 02/15/2021 01:56 AM, Chris Angelico wrote:
> >>> On Mon, Feb 15, 2021 at 5:32 PM Mark Filipak (ffmpeg)
> >>>  wrote:
> > frame->pts = (
> > (s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time) +
> > av_rescale(outlink->frame_count_in, s->ts_unit.num, 
> > s->ts_unit.den);
> 
>  I don't know what this: 'frame->pts', means. ...
> >>>
> >>> struct FrameyThingyWhatsit {
> >>>   int foo;
> >>>   int bar;
> >>>   void *quux;
> >>>   int pts;
> >>>   const char *flurble;
> >>> };
> >
> > "frame" is a variable, declared to be a pointer to a
> > FrameyThingyWhatsit, and assigned to something. It might be something
> > like this:
> >
> > struct FrameyThingyWhatsit *frame;
> >
> > frame = malloc(sizeof(FrameyThingyWhatsit));
> >
> > That'll allocate enough memory for the entire structure, and then
> > "frame" is a pointer to the start of that structure. Just like with
> > arrays ...
>
> "Thunk"!   ...The sound of pieces falling in place.
>
> So this:
>
> struct FrameyThingyWhatsit {...int pts;...}   ...a 'C' structure referenced by
> 'FrameyThingyWhatsit->pts'
>
> is equivalent to this:
>
> FrameyThingyWhatsit = [...pts,...]   ...an array referenced by 
> 'FrameyThingyWhatsit[3]' (except that
> mixed datatypes in arrays are verboten)
>
> or maybe better analogy, to this:
>
> FrameyThingyWhatsit = {...pts,...}   ...an object referenced by 
> 'FrameyThingyWhatsit.pts'
>
> >... you hang onto a pointer to the base of it, and then you index
> > into it; the compiler knows the layout of the structure, so when you
> > say "frame->pts", it knows exactly how many bytes above the base of
> > the structure to find that member.
>
> Ah, so there can be
> struct thisframe {...int pts;...}
> struct thatframe {...int pts;...}
> struct otherframe {...int pts;...}
> referenced by 'thisframe->pts', 'thatframe->pts', and 'otherframe->pts', and 
> the 3 'pts's are
> independent of one another, sort of like 3 namespaces.
>
> I think I have it right, or do I?

Yes. The "pts" in each case has no meaning on its own, and the
compiler understands it specifically by knowing the type of the
variable that you're looking at.

(Other languages work differently, but this is C's way of doing things.)

> >>> But I think Carl's point was that you can't simply look at an
> >>> expression and decode it as algebra. To understand this line of code,
> >>> you not only have to interpret the syntax of this exact line, but -
> >>> and probably more importantly - you have to understand what the
> >>> av_rescale function is doing.
> >>
> >> Well, I think I know what 'av_rescale()' is doing (at least for the 
> >> 'minterpolate=fps=48/1.001' &
> >> 'telecine' filters). I ran some tests. Look:
> >
> > Uhh. cool. This is the part where I'm the one who has no clue
> > what's going on, so I'm just going to do the whole "smile and nod"
> > thing, and trust that you know what's going on :)
>
> Well, here's the thing: At times PTSs are perfect [1], or sometimes they're 
> bollixed but the video
> nonetheless plays properly [2], or sometimes it doesn't play properly [3].
> [1] 60/1.001fps example: MPV shows "FPS: 59.940 (specified) 59.940 
> (estimated)"
> [2] 60/1.001fps example: MPV shows "FPS: 60.025 (specified) 59.940 
> (estimated)"
> [3] 60/1.001fps example: MPV shows "FPS: 59.940 (specified) ...wanders... 
> (estimated)"
>
> That playback behavior is the 1st clue I got that PTSs are key. Why are there 
> MPV differences
> remains a mystery -- I assume that it indicates that the PTSs are (may be) 
> correct but the video's
> metadata is wrong. Of course, my inference may be wrong -- ffmpeg 
> investigation is like reading a
> murder mystery.

Ahh, yep, gotcha.

> > Glad I could help! You're on your own for the next part, but if I've
> > been of any value at all, that's awesome. All the best!
> >
> > ChrisA
>
> You did well, Chris, and you did good. Thanks so much. I feel I know what 'C' 
> structures are and how
> the '->' operator works -- before you, I didn't even know that '"struct 
> "+label+"{ "+type+" "+var"
> }"' and 'label+"->"+var"' were related. The bottom line is this: A struct is 
> the 'C'-way to
> instantiate an object -- Yes, I'm aware of C++. It's sort of a 'C' language 
> architecture hack, isn't
> it?
>

In object-oriented languages, an object has methods (functions, code)
as well as data members, but C just has the members, the pure data.
But yes, it's basically the C way to do this.

ChrisA
___
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] Filter documentation -- PTSs

2021-02-15 Thread Mark Filipak (ffmpeg)

On 02/15/2021 04:32 PM, Carl Zwanzig wrote:

On 2/15/2021 1:26 PM, Mark Filipak (ffmpeg) wrote:

Yes, I'm aware of C++. It's sort of a 'C' language architecture hack, isn't it?

More like butchery ...


O... that's harsh.  :-)


Glad it's making more sense now.

z!


Thanks for the confirmation. Now, regarding pointers-to-pointers and '*' as a 
unary operator.

--
Any journey, no matter how long, is just a series of small steps.
"Government is the problem!" -- 1982 and onward.
"___ is the enemy of the people!" -- 2016 and onward.
"You have to fight like hell or you're not going to have a country!" -- Jan 6, 
2021.
It isn't the distance that's important, it's the direction.
___
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] Filter documentation -- PTSs

2021-02-15 Thread Carl Zwanzig

On 2/15/2021 1:26 PM, Mark Filipak (ffmpeg) wrote:

Yes, I'm aware of C++. It's sort of a 'C' language architecture hack, isn't it?

More like butchery than hack, but yes.

Glad it's making more sense now.

z!
___
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] Filter documentation -- PTSs

2021-02-15 Thread Mark Filipak (ffmpeg)

On 02/15/2021 06:38 AM, Chris Angelico wrote:

On Mon, Feb 15, 2021 at 9:21 PM Mark Filipak (ffmpeg)
 wrote:

On 02/15/2021 01:56 AM, Chris Angelico wrote:

On Mon, Feb 15, 2021 at 5:32 PM Mark Filipak (ffmpeg)
 wrote:

frame->pts = (
(s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time) +
av_rescale(outlink->frame_count_in, s->ts_unit.num, s->ts_unit.den);


I don't know what this: 'frame->pts', means. ...


struct FrameyThingyWhatsit {
  int foo;
  int bar;
  void *quux;
  int pts;
  const char *flurble;
};


"frame" is a variable, declared to be a pointer to a
FrameyThingyWhatsit, and assigned to something. It might be something
like this:

struct FrameyThingyWhatsit *frame;

frame = malloc(sizeof(FrameyThingyWhatsit));

That'll allocate enough memory for the entire structure, and then
"frame" is a pointer to the start of that structure. Just like with
arrays ...


"Thunk"!   ...The sound of pieces falling in place.

So this:

struct FrameyThingyWhatsit {...int pts;...}   ...a 'C' structure referenced by 
'FrameyThingyWhatsit->pts'


is equivalent to this:

FrameyThingyWhatsit = [...pts,...]   ...an array referenced by 'FrameyThingyWhatsit[3]' (except that 
mixed datatypes in arrays are verboten)


or maybe better analogy, to this:

FrameyThingyWhatsit = {...pts,...}   ...an object referenced by 
'FrameyThingyWhatsit.pts'


... you hang onto a pointer to the base of it, and then you index
into it; the compiler knows the layout of the structure, so when you
say "frame->pts", it knows exactly how many bytes above the base of
the structure to find that member.


Ah, so there can be
struct thisframe {...int pts;...}
struct thatframe {...int pts;...}
struct otherframe {...int pts;...}
referenced by 'thisframe->pts', 'thatframe->pts', and 'otherframe->pts', and the 3 'pts's are 
independent of one another, sort of like 3 namespaces.


I think I have it right, or do I?


But I think Carl's point was that you can't simply look at an
expression and decode it as algebra. To understand this line of code,
you not only have to interpret the syntax of this exact line, but -
and probably more importantly - you have to understand what the
av_rescale function is doing.


Well, I think I know what 'av_rescale()' is doing (at least for the 
'minterpolate=fps=48/1.001' &
'telecine' filters). I ran some tests. Look:


Uhh. cool. This is the part where I'm the one who has no clue
what's going on, so I'm just going to do the whole "smile and nod"
thing, and trust that you know what's going on :)


Well, here's the thing: At times PTSs are perfect [1], or sometimes they're bollixed but the video 
nonetheless plays properly [2], or sometimes it doesn't play properly [3].

[1] 60/1.001fps example: MPV shows "FPS: 59.940 (specified) 59.940 (estimated)"
[2] 60/1.001fps example: MPV shows "FPS: 60.025 (specified) 59.940 (estimated)"
[3] 60/1.001fps example: MPV shows "FPS: 59.940 (specified) ...wanders... 
(estimated)"

That playback behavior is the 1st clue I got that PTSs are key. Why are there MPV differences 
remains a mystery -- I assume that it indicates that the PTSs are (may be) correct but the video's 
metadata is wrong. Of course, my inference may be wrong -- ffmpeg investigation is like reading a 
murder mystery.



Glad I could help! You're on your own for the next part, but if I've
been of any value at all, that's awesome. All the best!

ChrisA


You did well, Chris, and you did good. Thanks so much. I feel I know what 'C' structures are and how 
the '->' operator works -- before you, I didn't even know that '"struct "+label+"{ "+type+" "+var" 
}"' and 'label+"->"+var"' were related. The bottom line is this: A struct is the 'C'-way to 
instantiate an object -- Yes, I'm aware of C++. It's sort of a 'C' language architecture hack, isn't 
it?


--
Any journey, no matter how long, is just a series of small steps.
"Government is the problem!" -- 1982 and onward.
"___ is the enemy of the people!" -- 2016 and onward.
"You have to fight like hell or you're not going to have a country!" -- Jan 6, 
2021.
It isn't the distance that's important, it's the direction.
___
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] I do not want to receive mail anymore.

2021-02-15 Thread Rob Hallam
On Mon, 15 Feb 2021 at 21:00, MERT Gürtürk  wrote:

> Hi,
> I do not want to receive mail anymore.
> Please remove me from your mail notifications

In the footer of every email sent by the list:

"""
___
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".

"""

There's how!

Cheers,
Rob
___
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] I do not want to receive mail anymore.

2021-02-15 Thread MERT Gürtürk


Hi,


I do not want to receive mail anymore.


Please remove me from your mail notifications



Best Regards,

Mert.




Res. Asis. Mert Gurturk

Yildiz Technical University
Faculty of Civil Engineering
Dept. of Geomatic Engineering

e-mail: mgurt...@yildiz.edu.tr
Tel: +902123835310
web: http://avesis.yildiz.edu.tr/mgurturk/


___
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] Unable to sync audio and video

2021-02-15 Thread Nicolas George
Livio Tenze (12021-02-15):
> -The audio source comes from alsa: here I see really strange behaviour. The
> pts value of the second packet with respect to the first pts packet seems
> to be "delayed" from 0.4s to 1.8s. I don't understand this behaviour: I
> checked the time from start to the second packet and the elapsed time
> cannot be justified (ms and not s).

Can you observe the same phenomenon using ffprobe?

ffprobe -f alsa -i default -show_packets -of compact | head -n 50 | less -S

would be a good way to look.

Do you observe warnings on the console?

How does your application handle parallelism between encoding and
reading from devices?

> -Finally, when I write audio and video in the output MP4 stream (I use
> libx264 and libfdk_aac for video and audio respectively) the audio stream
> is delayed.

Do the timestamps between audio and video match before encoding?

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] Filter documentation -- PTSs

2021-02-15 Thread Rob Hallam
On Mon, 15 Feb 2021 at 14:48, Phil Rhodes via ffmpeg-user <
ffmpeg-user@ffmpeg.org> wrote:

>>  On Monday, 15 February 2021, 13:58:30 GMT, Michael Koch <
astroelectro...@t-online.de> wrote:
>>  A few developers (not all!) are actively fighting against any changes
in the documentation. It seems
>>  they are really convinced that the documentation is perfect as it is.

> The ffmpeg example is very extreme but I don't really see what can be
done about it. It's their project. They can do anything they want.

Absolutely true.

There is always the suboptimal option of creating parallel documentation.

There's a number of options that can coexist and sometimes overlap, off the
top of my head:
 - individual collections of examples and observations (like Michael Koch's
PDF or the glossary Mark Filipak was/is thinking of creating; or something
like the Arch wiki's examples)
 - parallels/forks of official facets of documentation (eg "The Unofficial
FFmpeg Wiki", ordocumentation)
 - self-answered questions on QA sites that serve as examples of a
particular filter, features, etc

There are other options too, but they are all also suboptimal [1]. Will
people actually use them? [2] Will they be accurate if they are written and
supported by people with an incomplete understanding of the codebase? Would
it have enough people on board to fully support the endeavour- that is
write it and maintain it?

The barrier to entry is low, as all you need is space on a webserver [3].
But considering the fate of most forks, it's worth asking: is it worth it?
In some ways, it might be beneficial for all involved (from both FFmpeg and
those wanting to improve it POV) as it might obviate certain frustrations
on both sides.

Different projects have different documentation philosophies. Project A
might prefer to be terse at the cost of lacking information for some users;
whereas Project B might prefer to be verbose at the cost of potential
inaccuracy.

I don't endorse a particular action, I don't suggest a particular
philosophy is best; this is just food for thought.

Take care,
Rob

[1] : I recall someone setting up a Discord channel for troubleshooting
FFmpeg issues a couple of years ago, though an IRC channel already existed.
There's very little to stop someone doing something similar with forums, QA
software, or whatever. Because while the mailing list works, is searchable,
and can be very helpful; it does have a few pain points around top-posting,
folks needing reminded to use up-to-date versions of ffmpeg, including full
uncut output, not using -hide_banner etc.

Heck, every time I mail the list I'm not sure whether to manually break
lines at 72 characters or not.

[2]: When writing this I went to look something else up, and by chance
stumbled upon this comment thread from a day ago:
https://old.reddit.com/r/linux/comments/lj4v0w/some_nifty_stuff_ffmpeg_can_do/gnbkbwe
(tl;dr - P1: ffmpeg is awesome! P2: it is, tho I wish the docs were
better...)

[3]: Admittedly you need the funds to rent this space and associated
bandwidth and any domains, knowledge of keeping things secure and updated
and free of spam, etc
___
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] Unable to sync audio and video

2021-02-15 Thread Livio Tenze
Dear group,

I am trying to write a code to encode (in realtime) a stream with audio and
video in Linux environment.
-The video source is read with av_read_frame and the /dev/videoX is opened.
The pts values with respect to the first packed seem to be reasonable.
-The audio source comes from alsa: here I see really strange behaviour. The
pts value of the second packet with respect to the first pts packet seems
to be "delayed" from 0.4s to 1.8s. I don't understand this behaviour: I
checked the time from start to the second packet and the elapsed time
cannot be justified (ms and not s).
-Finally, when I write audio and video in the output MP4 stream (I use
libx264 and libfdk_aac for video and audio respectively) the audio stream
is delayed.

I don't know what to check. Please give me suggestions to solve this issue.
What can I check?

Thanks in advance and best regards.
Livius
___
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] Same output bit depth and sampling frequency as input?

2021-02-15 Thread Paul B Mahol
On Mon, Feb 15, 2021 at 5:03 PM Marco Mircoli  wrote:

> I think it is not a bug.
> It is normal that dynaudnorm and loudnorm gives differents results, they
> are 2 different instruments and they have different parameters and actions.
>

I never claimed different. Using both filters at same time does not make
sense.


> Thanks.
> S.
>
>
>
> Il giorno dom 14 feb 2021 alle ore 12:08 Paul B Mahol 
> ha
> scritto:
>
> > On Sun, Feb 14, 2021 at 12:01 PM Marco Mircoli 
> > wrote:
> >
> > > Yes, the result Is not leveled to the target loudness value
> > >
> >
> > Than that issue should be reported to our issue tracker, as loudnorm bug.
> >
> >
> > >
> > > Il Ven 12 Feb 2021, 19:26 Paul B Mahol  ha scritto:
> > >
> > > > On Fri, Feb 12, 2021 at 7:17 PM Marco Mircoli 
> > > > wrote:
> > > >
> > > > > Il giorno ven 12 feb 2021 alle ore 10:53 Paul B Mahol <
> > > one...@gmail.com>
> > > > > ha
> > > > > scritto:
> > > > >
> > > > > > On Fri, Feb 12, 2021 at 12:48 AM Marco Mircoli <
> > nuvolab...@gmail.com
> > > >
> > > > > > wrote:
> > > > > >
> > > > > > > Hello everybody,
> > > > > > >  wondering how to set the same output audio specs (sample rate
> > > anche
> > > > > bit
> > > > > > > depth) as input.
> > > > > > >
> > > > > > > I tried like that
> > > > > > >
> > > > > > > ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.
> > > > > > > 5:TP=-1.5:LRA=7 -sample_fmt s16 -ar 44100 FILE_TO
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > if I have a 48KHZ input, the output is 44100, so doesn't work
> for
> > > my
> > > > > > needs
> > > > > > >
> > > > > > > Tried without
> > > > > > >
> > > > > > >
> > > > > > > ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.
> > > > > > > 5:TP=-1.5:LRA=7  FILE_TO
> > > > > > >
> > > > > > > The result is: same bit depth of input file but 192Khz sample
> > rate.
> > > > > (file
> > > > > > > input sr is 48khz)
> > > > > > >
> > > > > > > Anybody can give me a suggest?
> > > > > > >
> > > > > >
> > > > > > Use shell scripting.
> > > > > >
> > > > > > Also using those 2 filters at same time is entirely invalid and
> > > > > pointless.
> > > > > >
> > > > > >
> > > > > >
> > > > > Unfortunately, don't know ho to use shell. I'm a newbe. Any
> resource
> > > that
> > > > > can help me to start with shell scriping?
> > > > >
> > > > > ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.5:TP=-1.5:LRA=7
> > > > FILE_TO
> > > > >
> > > > > Cannot understand why this Is invalid.
> > > > > 1st filter (dynaudnorm), level the audio changing the volume every
> > > frame
> > > > > window
> > > > > 2nd filter (loudnorm) set an offset to the gain to let the loudness
> > go
> > > to
> > > > > 16.5lkfs
> > > > >
> > > > > I've miss something?
> > > > >
> > > >
> > > > Is there any difference when you remove dynaudnorm?
> > > >
> > > >
> > > > >
> > > > > Thanks.
> > > > > S:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > > Thanks,
> > > > > > > S.
> > > > > > > ___
> > > > > > > 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 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 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 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 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 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 mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link 

Re: [FFmpeg-user] Same output bit depth and sampling frequency as input?

2021-02-15 Thread Marco Mircoli
I think it is not a bug.
It is normal that dynaudnorm and loudnorm gives differents results, they
are 2 different instruments and they have different parameters and actions.
Thanks.
S.



Il giorno dom 14 feb 2021 alle ore 12:08 Paul B Mahol  ha
scritto:

> On Sun, Feb 14, 2021 at 12:01 PM Marco Mircoli 
> wrote:
>
> > Yes, the result Is not leveled to the target loudness value
> >
>
> Than that issue should be reported to our issue tracker, as loudnorm bug.
>
>
> >
> > Il Ven 12 Feb 2021, 19:26 Paul B Mahol  ha scritto:
> >
> > > On Fri, Feb 12, 2021 at 7:17 PM Marco Mircoli 
> > > wrote:
> > >
> > > > Il giorno ven 12 feb 2021 alle ore 10:53 Paul B Mahol <
> > one...@gmail.com>
> > > > ha
> > > > scritto:
> > > >
> > > > > On Fri, Feb 12, 2021 at 12:48 AM Marco Mircoli <
> nuvolab...@gmail.com
> > >
> > > > > wrote:
> > > > >
> > > > > > Hello everybody,
> > > > > >  wondering how to set the same output audio specs (sample rate
> > anche
> > > > bit
> > > > > > depth) as input.
> > > > > >
> > > > > > I tried like that
> > > > > >
> > > > > > ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.
> > > > > > 5:TP=-1.5:LRA=7 -sample_fmt s16 -ar 44100 FILE_TO
> > > > > >
> > > > > >
> > > > > >
> > > > > > if I have a 48KHZ input, the output is 44100, so doesn't work for
> > my
> > > > > needs
> > > > > >
> > > > > > Tried without
> > > > > >
> > > > > >
> > > > > > ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.
> > > > > > 5:TP=-1.5:LRA=7  FILE_TO
> > > > > >
> > > > > > The result is: same bit depth of input file but 192Khz sample
> rate.
> > > > (file
> > > > > > input sr is 48khz)
> > > > > >
> > > > > > Anybody can give me a suggest?
> > > > > >
> > > > >
> > > > > Use shell scripting.
> > > > >
> > > > > Also using those 2 filters at same time is entirely invalid and
> > > > pointless.
> > > > >
> > > > >
> > > > >
> > > > Unfortunately, don't know ho to use shell. I'm a newbe. Any resource
> > that
> > > > can help me to start with shell scriping?
> > > >
> > > > ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.5:TP=-1.5:LRA=7
> > > FILE_TO
> > > >
> > > > Cannot understand why this Is invalid.
> > > > 1st filter (dynaudnorm), level the audio changing the volume every
> > frame
> > > > window
> > > > 2nd filter (loudnorm) set an offset to the gain to let the loudness
> go
> > to
> > > > 16.5lkfs
> > > >
> > > > I've miss something?
> > > >
> > >
> > > Is there any difference when you remove dynaudnorm?
> > >
> > >
> > > >
> > > > Thanks.
> > > > S:
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > >
> > > > > > Thanks,
> > > > > > S.
> > > > > > ___
> > > > > > 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 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 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 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 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 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 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] Filter documentation -- PTSs

2021-02-15 Thread Phil Rhodes via ffmpeg-user
 On Monday, 15 February 2021, 13:58:30 GMT, Michael Koch 
 wrote:
 

 > A few developers (not all!)
> are actively fighting against any changes in the documentation. It seems> 
> they are really convinced that the documentation is perfect as it is.

Agreed. I think it's an extension of a situation that's existed for, eh, over 
ten years, probably. It happens on a lot of open source projects; the core 
development team form a clique so intense and insular that any help from 
outside is viewed as a threat. The level of vitriolic, very personal 
unpleasantness is mildly shocking until you get used to it.

It's no exaggeration to say that this problem is negatively affecting the 
entire field of open source software as it is very common. The ffmpeg example 
is very extreme but I don't really see what can be done about it. It's their 
project. They can do anything they want.

P  
___
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] Filter documentation -- PTSs

2021-02-15 Thread Michael Koch

Jim,

I am in the camp that believes that the measure of adequate FFmpeg 
documentation is that it describes what an FFmpeg user needs to know 
about the behaviour of that filter, in all respects, without having to 
read the source code. By that measure, I believe that FFmpeg's 
documentation for almost all filters is inadequate.


I absolutely agree to this. But as a non-developer it's hopeless to 
contribute to the official documentation. A few developers (not all!) 
are actively fighting against any changes in the documentation. It seems 
they are really convinced that the documentation is perfect as it is.


The documentation I wrote for the fps filter might be a useful case 
study: >. (The 
case study is not limited to PTSs.)


That's very good. Please add it to the Wiki!
https://trac.ffmpeg.org/

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] Filter documentation -- PTSs

2021-02-15 Thread Phil Rhodes via ffmpeg-user
 

On Monday, 15 February 2021, 11:39:05 GMT, Chris Angelico 
 wrote:  
> > and then 'frame' would be a pointer to an in-memory structure of that
> > type. When you refer to 'frame->pts', that means 'look at the spot in
> > memory three words in from where frame points, and assign to that'.
>
> Well, that makes perfect sense. Thank you, Chris! You've removed most of the 
> mystery. One thing
> remains: What links the label "frame" to the structure "FrameyThingyWhatsit"? 
> Is there a linker
> directive somewhere, and what would it look like?
I've always felt that pointers were simple in concept but that the c syntax for 
them can be pretty unhelpful. It's not the end of the world; it works, but by 
the time you've worked out what all the punctuation means it can become a bit 
of a brain-teaser.
P  
___
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] Filter documentation -- PTSs

2021-02-15 Thread Chris Angelico
On Mon, Feb 15, 2021 at 9:21 PM Mark Filipak (ffmpeg)
 wrote:
>
> On 02/15/2021 01:56 AM, Chris Angelico wrote:
> > On Mon, Feb 15, 2021 at 5:32 PM Mark Filipak (ffmpeg)
> >  wrote:
> >>> frame->pts = (
> >>>(s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time) +
> >>>av_rescale(outlink->frame_count_in, s->ts_unit.num, 
> >>> s->ts_unit.den);
> >>
> >> I don't know what this: 'frame->pts', means. I have written a ton of 
> >> assembly code for various
> >> micros and people tell me, "It's easy, Mark. 'frame->pts' is a 'pointer' 
> >> to memory as in assembly",
> >> but I don't see the analog of a memory address register in it. If 'pts' is 
> >> a pointer, then how can
> >> 'frame' be written through that pointer and where does it get written? 
> >> It's a mystery to me. Or is
> >> 'frame' the pointer and 'pts' the memory location?
> >
> > 'frame' is a pointer to a structure of some sort, and 'pts' is a named
> > element within that structure. So you might have something like:
> >
> > struct FrameyThingyWhatsit {
> >  int foo;
> >  int bar;
> >  void *quux;
> >  int pts;
> >  const char *flurble;
> > };
> >
> > and then 'frame' would be a pointer to an in-memory structure of that
> > type. When you refer to 'frame->pts', that means 'look at the spot in
> > memory three words in from where frame points, and assign to that'.
>
> Well, that makes perfect sense. Thank you, Chris! You've removed most of the 
> mystery. One thing
> remains: What links the label "frame" to the structure "FrameyThingyWhatsit"? 
> Is there a linker
> directive somewhere, and what would it look like?

"frame" is a variable, declared to be a pointer to a
FrameyThingyWhatsit, and assigned to something. It might be something
like this:

struct FrameyThingyWhatsit *frame;

frame = malloc(sizeof(FrameyThingyWhatsit));

That'll allocate enough memory for the entire structure, and then
"frame" is a pointer to the start of that structure. Just like with
arrays, you hang onto a pointer to the base of it, and then you index
into it; the compiler knows the layout of the structure, so when you
say "frame->pts", it knows exactly how many bytes above the base of
the structure to find that member.

(It's not necessarily going to be the sum of the sizes of the
preceding elements, due to alignment requirements and padding. But if
there's any complexities to it, it's the compiler's job to know about
them. As the programmer, you just use the name of the member, and
it'll figure out the details.)

> Oh, one thing I should clarify. All the folks who tried to explain pointers 
> to me were firmware
> writers. Perhaps that explains why they referred to memory, eh? Hahaha... 
> never thought about it
> before until you showed me the real codewright's view.

Heh maybe. I mainly work in high level languages, preferring to dip
into C only when necessary (such as when implementing an interpreter
for an HLL!); but I've also taught data structures and algorithms
using a combination of JavaScript and, I kid you not, a deck of cards
on a desk. With a webcam mounted vertically on a hacked-up lamp arm.
But if you've ever tried to comprehend quicksort by reading through a
highly optimized C implementation, you'll appreciate the WAY easier
explanation that doesn't look at memory at all :)

(Seriously, quicksort is actually a very simple algorithm. It's just
that it becomes almost completely opaque when you look at an in-place
implementation.)

> > But I think Carl's point was that you can't simply look at an
> > expression and decode it as algebra. To understand this line of code,
> > you not only have to interpret the syntax of this exact line, but -
> > and probably more importantly - you have to understand what the
> > av_rescale function is doing.
>
> Well, I think I know what 'av_rescale()' is doing (at least for the 
> 'minterpolate=fps=48/1.001' &
> 'telecine' filters). I ran some tests. Look:

Uhh. cool. This is the part where I'm the one who has no clue
what's going on, so I'm just going to do the whole "smile and nod"
thing, and trust that you know what's going on :)

> I imagine the rest of the code is involved in initialization of certain 
> things that aren't already
> defined, and scaling for things that could be represented as floats but are 
> initialized as scaled
> integers in order to improve the speed of the pipeline. Do those 
> rationalizations sound reasonable
> to you?

Yeah, they definitely sound plausible, but I haven't looked at the code.

> So, to wrap up, for the documentation, what would be good is the changes to 
> PTSs for ordinary (or
> usual) processing. Numbers like '2' & '4/5'. In the cases above, the numbers 
> are simple, but in
> other cases, the numbers are hard to suss out and seem to be inconsistent. 
> And regarding VFR, well,
> what would the numbers be? How would they be calculated?
>
> If the VFR numbers can be expressed simply, that would be great. If 
> expressing them requires 

Re: [FFmpeg-user] "most insulting comment" [was: Re: Filter documentation -- PTSs]

2021-02-15 Thread Mark Filipak (ffmpeg)

On 02/15/2021 05:22 AM, Nicolas George wrote:

Jim DeLaHunt (12021-02-14):

Oh, my dear Carl


Indeed, you managed to be even more insulting in just four words and
half an hour.


Will you take a pill, please. Or a bong hit.
___
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] "most insulting comment" [was: Re: Filter documentation -- PTSs]

2021-02-15 Thread Nicolas George
Jim DeLaHunt (12021-02-14):
> Oh, my dear Carl

Indeed, you managed to be even more insulting in just four words and
half an hour.

-- 
  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] Filter documentation -- PTSs

2021-02-15 Thread Mark Filipak (ffmpeg)

On 02/15/2021 01:56 AM, Chris Angelico wrote:

On Mon, Feb 15, 2021 at 5:32 PM Mark Filipak (ffmpeg)
 wrote:

frame->pts = (
   (s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time) +
   av_rescale(outlink->frame_count_in, s->ts_unit.num, s->ts_unit.den);


I don't know what this: 'frame->pts', means. I have written a ton of assembly 
code for various
micros and people tell me, "It's easy, Mark. 'frame->pts' is a 'pointer' to memory 
as in assembly",
but I don't see the analog of a memory address register in it. If 'pts' is a 
pointer, then how can
'frame' be written through that pointer and where does it get written? It's a 
mystery to me. Or is
'frame' the pointer and 'pts' the memory location?


'frame' is a pointer to a structure of some sort, and 'pts' is a named
element within that structure. So you might have something like:

struct FrameyThingyWhatsit {
 int foo;
 int bar;
 void *quux;
 int pts;
 const char *flurble;
};

and then 'frame' would be a pointer to an in-memory structure of that
type. When you refer to 'frame->pts', that means 'look at the spot in
memory three words in from where frame points, and assign to that'.


Well, that makes perfect sense. Thank you, Chris! You've removed most of the mystery. One thing 
remains: What links the label "frame" to the structure "FrameyThingyWhatsit"? Is there a linker 
directive somewhere, and what would it look like?


Oh, one thing I should clarify. All the folks who tried to explain pointers to me were firmware 
writers. Perhaps that explains why they referred to memory, eh? Hahaha... never thought about it 
before until you showed me the real codewright's view.



But I think Carl's point was that you can't simply look at an
expression and decode it as algebra. To understand this line of code,
you not only have to interpret the syntax of this exact line, but -
and probably more importantly - you have to understand what the
av_rescale function is doing.


Well, I think I know what 'av_rescale()' is doing (at least for the 'minterpolate=fps=48/1.001' & 
'telecine' filters). I ran some tests. Look:


24p-original timestamps.txt
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 
23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)

frames.frame.0.best_effort_timestamp_time="0:00:00.00"
frames.frame.479.best_effort_timestamp_time="0:00:19.978000"
ms/frame = 19978/479 = 41.708 = ms/frame(48p-minterpolate48)*2   <<==

48p-minterpolate48 timestamps.txt
Stream #0:0: Video: hevc (Main), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 
47.95 fps, 47.95 tbr, 1k tbn, 47.95 tbc (default)

frames.frame.0.best_effort_timestamp_time="0:00:00.00"
frames.frame.955.best_effort_timestamp_time="0:00:19.916000"
ms/frame = 19916/955 = 20.854 = ms/frame(24p-original)/2   <<==

60p-minterpolate48,telecine timestamps.txt
Stream #0:0: Video: hevc (Main), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 
59.94 fps, 59.94 tbr, 1k tbn, 59.94 tbc (default)

frames.frame.0.best_effort_timestamp_time="0:00:00.00"
frames.frame.1194.best_effort_timestamp_time="0:00:19.92"
ms/frame = 19920/1194 = 16.683 = ms/frame(48p-minterpolate48)*4/5   <<==

See? PTS factors of '2' & '4/5'; just what one would expect. Those are the 
numbers that matter.

I imagine the rest of the code is involved in initialization of certain things that aren't already 
defined, and scaling for things that could be represented as floats but are initialized as scaled 
integers in order to improve the speed of the pipeline. Do those rationalizations sound reasonable 
to you?


So, to wrap up, for the documentation, what would be good is the changes to PTSs for ordinary (or 
usual) processing. Numbers like '2' & '4/5'. In the cases above, the numbers are simple, but in 
other cases, the numbers are hard to suss out and seem to be inconsistent. And regarding VFR, well, 
what would the numbers be? How would they be calculated?


If the VFR numbers can be expressed simply, that would be great. If expressing them requires some 
textual explanation, that would still be very helpful no matter how difficult.


All of the foregoing assumes that PTSs are key. Since no one has commented on that part of my OP, I 
assume that PTSs *are* key. If so, they should be expressed for each filter. I would help to do that 
by running tests, but I would need to know going in that there's a home in the documentation for my 
research. Otherwise, I'm not going to spend any more of my lifetime.


That's enough writing. Now it's bedtime (past bedtime). Thanks so much for your insights. You've 
really cleared up pointers -- simple!


Mark.

--
Any journey, no matter how long, is just a series of small steps.
"Government is the problem!" -- 1982 and onward.
"___ is the enemy of the people!" -- 2016 and onward.
"You have to fight like hell or you're not going to have a country!" -- Jan 6, 
2021.
It isn't the