filter pipeline 'PTS' -- int64_t?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

filter pipeline 'PTS' -- int64_t?

Mark Filipak (ffmpeg)
The ffmpeg filter pipeline assigns a 'PTS' to each frame, frame by frame. Is *that* 'PTS' an int64_t?

Things I have found.

https://ffmpeg.org/ffmpeg-filters.html#fps-1
   "...trim any frames with a negative PTS."
That implies that PTS can be negative (ergo, is a signed integer).

http://svn.ffmpeg.org/doxygen/1.0/structAVFrame.html
Is AVFrame the structure of frames in the filter pipeline? If so, then
"int64_t pts
" presentation timestamp in time_base units (time when frame should be shown to user) If
"AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed."
appears to answer my question, unless it's a different 'frame'...

...What exactly is 'AVFrame'?

http://svn.ffmpeg.org/doxygen/1.0/avformat_8h-source.html
   "00320 typedef struct AVFrac {
   "00321     int64_t val, num, den;
   "00322 } AVFrac;"
http://svn.ffmpeg.org/doxygen/1.0/structAVFrac.html#_details
   "The exact value of the fractional number is: 'val + num / den'."
That appears to be a definition of something called "PTS" but seems to not be what's assigned to a
frame in the filter pipeline.

The label (name) of what is actually assigned to frames in the filter pipeline as 'PTS' is unknown
to me.

Thanks for the guidance,
Mark.

--
In U.S. History: The House Un-American Activities Committee was a committee of the House of
Representatives that engaged in un-American activities.
_______________________________________________
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: filter pipeline 'PTS' -- int64_t?

Jim DeLaHunt-2

On 2021-03-01 16:43, Mark Filipak (ffmpeg) wrote:
> The ffmpeg filter pipeline assigns a 'PTS' to each frame, frame by
> frame. Is *that* 'PTS' an int64_t?

I don't know how to answer this question. I don't know of a single piece
of code which is the "ffmpeg filter pipeline". I understand that term to
refer to a collection of design parameters which organises the
interaction of code modules. It is the code modules which store
Presentation Timestamps (PTSs).

It is meaningful, I believe, to ask if the code modules store PTS values
as int64_t types. I believe the answer is generally "yes".

The C++ standards define int64_t as a "signed integer type with width of
exactly… 64 bits… with no padding bits and using 2's complement for
negative values". Source:
https://en.cppreference.com/w/cpp/types/integer . Thus data values of
type int64_t are capable of storing negative integer values.


> Things I have found.
>
> https://ffmpeg.org/ffmpeg-filters.html#fps-1
>   "...trim any frames with a negative PTS."
> That implies that PTS can be negative (ergo, is a signed integer).

Yes, I believe that FFmpeg will accept and generate streams which have
negative values for PTS.


> http://svn.ffmpeg.org/doxygen/1.0/structAVFrame.html
> Is AVFrame the structure of frames in the filter pipeline? If so, then
> "int64_t     pts
> "     presentation timestamp in time_base units (time when frame
> should be shown to user) If "AV_NOPTS_VALUE then frame_rate =
> 1/time_base will be assumed."
> appears to answer my question, unless it's a different 'frame'...
>
> ...What exactly is 'AVFrame'?

I am not sure. I won't try to answer this question.


> http://svn.ffmpeg.org/doxygen/1.0/avformat_8h-source.html
>   "00320 typedef struct AVFrac {
>   "00321     int64_t val, num, den;
>   "00322 } AVFrac;"
> http://svn.ffmpeg.org/doxygen/1.0/structAVFrac.html#_details
>   "The exact value of the fractional number is: 'val + num / den'."
> That appears to be a definition of something called "PTS" but seems to
> not be what's assigned to a frame in the filter pipeline.

That code looks to me like it defines a data type for storing rational
numbers. The copyright notice on that module says year 2001, and
"Fabrice Bellard", the original developer of FFmpeg. That hints that
this module is old code. A mention of PTS there is perhaps a statement
of 20-year-old intentions, rather than a claim about what the current
code does. The fact that the code defines a data type does not say
whether the code actually uses that data type.


> The label (name) of what is actually assigned to frames in the filter
> pipeline as 'PTS' is unknown to me.

I don't know how to answer this question. See above about the concept of
a "filter pipeline".


Best regards,
       —Jim DeLaHunt

_______________________________________________
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: filter pipeline 'PTS' -- int64_t?

Carl Eugen Hoyos-2
In reply to this post by Mark Filipak (ffmpeg)
Am Di., 2. März 2021 um 01:47 Uhr schrieb Mark Filipak (ffmpeg)
<[hidden email]>:
>
> The ffmpeg filter pipeline assigns a 'PTS' to each frame,
> frame by frame.

This may not be completely unreasonable but some
comments are still necessary:
The sentence sounds to me as if the the filter pipeline always
assigns timestamps to frames, but this is neither true (many
filters do not care about timestamps and you do not have to
insert a filter which does) nor does it make the filter pipeline
special: Timestamps often come from the demuxer and / or
the decoder and may or may not change in the filterchain
(and - as I believe you realized by now - because of the
chosen output format; and also the chosen encoder - for
which you did not post a question yet).

Frames may not have a timestamp assigned - you posted
the relevant part of the documentation.

Concerning some of your other comments:

The timestamps in MPEG streams may be negative.

There is no AVFrac in the (current) codebase.

Carl Eugen
_______________________________________________
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: filter pipeline 'PTS' -- int64_t?

Paul B Mahol
On Tue, Mar 2, 2021 at 8:59 PM Carl Eugen Hoyos <[hidden email]> wrote:

> Am Di., 2. März 2021 um 01:47 Uhr schrieb Mark Filipak (ffmpeg)
> <[hidden email]>:
> >
> > The ffmpeg filter pipeline assigns a 'PTS' to each frame,
> > frame by frame.
>
> This may not be completely unreasonable but some
> comments are still necessary:
> The sentence sounds to me as if the the filter pipeline always
> assigns timestamps to frames, but this is neither true (many
> filters do not care about timestamps and you do not have to
> insert a filter which does) nor does it make the filter pipeline
> special: Timestamps often come from the demuxer and / or
> the decoder and may or may not change in the filterchain
> (and - as I believe you realized by now - because of the
> chosen output format; and also the chosen encoder - for
> which you did not post a question yet).
>
> Frames may not have a timestamp assigned - you posted
> the relevant part of the documentation.
>
> Concerning some of your other comments:
>
> The timestamps in MPEG streams may be negative.
>
> There is no AVFrac in the (current) codebase.
>
>
Funny how he look at ultra old svn code dump, good luck with that,

How he even managed to find links to svn stuff ....




> Carl Eugen
> _______________________________________________
> 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: filter pipeline 'PTS' -- int64_t?

Carl Eugen Hoyos-2
Am Di., 2. März 2021 um 21:42 Uhr schrieb Paul B Mahol <[hidden email]>:
>
> On Tue, Mar 2, 2021 at 8:59 PM Carl Eugen Hoyos <[hidden email]> wrote:

> > There is no AVFrac in the (current) codebase.
> >
> Funny how he look at ultra old svn code dump, good luck with that,
>
> How he even managed to find links to svn stuff ....

svn.ffmpeg.org is just an alias for ffmpeg.org, the
documentation for old releases is available.

Carl Eugen
_______________________________________________
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".