Hi. The attached patches implement an API to get the delay of an output format. The delay is the amount of time between when a frame is fed to the format with av_write_frame and when it is actually processed by the output format. This is especially useful for devices, where this information is necessary if there is need to maintain some kind of synchronization, for example between audio and video output. I also include the test program I used to check if that works and has the expected effect: it is supposed to output two tones alternatively, and to print on the terminal when the tone change. If av_get_delay() is replaced by 0, there is a visible lag (it may be necessary to replace "default" by "hw", as "default" is usually some kind of dmix plugin, and dmix has a very short max delay). Regards, -- Nicolas George
Le tridi 3 messidor, an CCXIX, Nicolas George a écrit :
The attached patches implement an API to get the delay of an output format. The delay is the amount of time between when a frame is fed to the format with av_write_frame and when it is actually processed by the output format.
Ping? Regards, -- Nicolas George
On Tue, Jun 21, 2011 at 08:14:09PM +0200, Nicolas George wrote:
Hi.
The attached patches implement an API to get the delay of an output format. The delay is the amount of time between when a frame is fed to the format with av_write_frame and when it is actually processed by the output format.
This is especially useful for devices, where this information is necessary if there is need to maintain some kind of synchronization, for example between audio and video output.
with the current API audio/video output "muxers" should "present" the data to the user at the pts of the given packet. your get_delay() would still be usefull for them and more so for muxers incapable of presenting at a given pts. [...]
@@ -1518,6 +1520,18 @@ int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, */ int av_write_trailer(AVFormatContext *s);
+/** + * Get the delay for the selected stream. + * The delay is the difference between the PTS of the data currently + * processed by the output format and the PTS of the last data fed to the + * muxer, assuming there was no timestamp discontinuity. + * The exact meaning of that depends on the muxer. + * It is mostly relevant for live streams, like devices or network + * protocols.
Maybe something along the following lines is clearer: the delay is the duration in timebase units of all buffered data. buffered in the sense of between what goes into the muxer and what is presented to the user or transmitted over the net.
+ * If the format does not support delay measurement, the return value is 0. + */
some value that is not a valid delay would allow distinguishing it from valid delays. some error code representing "Not implemented" maybe also the code should consider the buffering required for interleaving (by dts for example) [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus
Le decadi 10 messidor, an CCXIX, Michael Niedermayer a écrit :
with the current API audio/video output "muxers" should "present" the data to the user at the pts of the given packet.
You mean: according to the system's realtime clock rather than some device-specific internal clock? I do not think this is a good idea. To account for the skew in a sound card's clock, it would require slightly resampling the incoming data, while most application would be just happy to just sync on the sound card's clock.
Maybe something along the following lines is clearer: the delay is the duration in timebase units of all buffered data. buffered in the sense of between what goes into the muxer and what is presented to the user or transmitted over the net.
I adapted it that way: * The delay is the duration, in timebase units, of all buffered data, * i.e. data that has been submitted to the muxer but not yet presented to * the user of transmitted over the net. * The exact meaning of that depends on the muxer. * It is mostly relevant for live streams, like devices or network * protocols.
some value that is not a valid delay would allow distinguishing it from valid delays. some error code representing "Not implemented" maybe
Would simply AV_NOPTS_VALUE be ok?
also the code should consider the buffering required for interleaving (by dts for example)
You mean packets that have been submitted to av_interleaved_write_frame but that lavf has not yet submitted to oformat->write_packet? I see the concern, and I will think about it to try and come with a satisfactory solution. Regards, -- Nicolas George
Le primidi 11 messidor, an CCXIX, Nicolas George a écrit :
You mean packets that have been submitted to av_interleaved_write_frame but that lavf has not yet submitted to oformat->write_packet?
I see the concern, and I will think about it to try and come with a satisfactory solution.
I have a possible solution, but I am somewhat out of my depth, so there may be drawbacks I did not think of. The idea is to have av_interleave_packet keep track, for each stream, of the DTS of the last packets queued and dequeued. This allow a function av_get_interleave_delay to get the corresponding delay. The av_get_delay I proposed should therefore probably renamed av_get_output_delay or something. Regards, -- Nicolas George
On Wed, Jun 29, 2011 at 03:21:05PM +0200, Nicolas George wrote:
Le primidi 11 messidor, an CCXIX, Nicolas George a écrit :
You mean packets that have been submitted to av_interleaved_write_frame but that lavf has not yet submitted to oformat->write_packet?
I see the concern, and I will think about it to try and come with a satisfactory solution.
I have a possible solution, but I am somewhat out of my depth, so there may be drawbacks I did not think of.
The idea is to have av_interleave_packet keep track, for each stream, of the DTS of the last packets queued and dequeued.
This allow a function av_get_interleave_delay to get the corresponding delay.
The av_get_delay I proposed should therefore probably renamed av_get_output_delay or something.
Regards,
-- Nicolas George
avformat.h | 18 ++++++++++++++++++ utils.c | 16 ++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) f61fee398eb48bdfd30663e0b9e45e4fb19411ad 0001-libavformat-keep-track-of-DTS-while-interleaving.patch From d471f105b78248df810465383c34d0016240f51e Mon Sep 17 00:00:00 2001 From: Nicolas George <nicolas.george@normalesup.org> Date: Wed, 29 Jun 2011 14:57:09 +0200 Subject: [PATCH] libavformat: keep track of DTS while interleaving.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org> --- libavformat/avformat.h | 18 ++++++++++++++++++ libavformat/utils.c | 16 ++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index e97e75a..7467625 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -636,6 +636,17 @@ typedef struct AVStream { * NOT PART OF PUBLIC API */ int request_probe; + + /** + * DTS of the last packet that was submitted to the muxer for this stream + */ + int64_t last_dts_in; + + /** + * DTS of the last packet that was output by the muxer for this stream + */ + int64_t last_dts_out;
i think these are unneeded last_in_packet_buffer provides the last added and thus its timestamps and the muxer has to know itself whats the last on the presenttation side IMHO #[...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Observe your enemies, for they first find out your faults. -- Antisthenes
Le primidi 11 messidor, an CCXIX, Michael Niedermayer a écrit :
i didnt say that.
Sorry I misunderstood.
This doesnt seem to work very well for example when you have: a slideshow with commentary, the delay from the video stream could make quite big jumps an be constant between them. It might be better to add the remaining duration of the currently displayed frame in there or something
What about something like that then: /** * Get the delay for the selected stream, in time_base units. * The exact meaning of that delay depends on the format. * For real-time muxers, data submitted to the muxer more than delay ago * should have been output (e.g. presented to the user), while data * submitted less than delay ago should be still somewhere in the muxer or * some hardware buffer. * Note that packets interleaving may introduce an additional delay. * If the format does not support delay measurement, the return value is * AV_NOPTS_VALUE. */ int64_t av_get_output_delay(AVFormatContext *s, int stream); ?
i think these are unneeded last_in_packet_buffer provides the last added and thus its timestamps
Indeed.
and the muxer has to know itself whats the last on the presenttation side IMHO
Some muxers may not care to keep track. Anyway, for this last part, unless I am mistaken, there is a strict separation: delay_total = delay_interleave + delay_output The original patch gives delay_output, and is useful by itself. Maybe the delay_interleave part can wait until someone actually needs it and therefore can test it for usability. Regards, -- Nicolas George
On Wed, Jun 29, 2011 at 07:06:09PM +0200, Nicolas George wrote:
Le primidi 11 messidor, an CCXIX, Michael Niedermayer a écrit :
i didnt say that.
Sorry I misunderstood.
This doesnt seem to work very well for example when you have: a slideshow with commentary, the delay from the video stream could make quite big jumps an be constant between them. It might be better to add the remaining duration of the currently displayed frame in there or something
What about something like that then:
/** * Get the delay for the selected stream, in time_base units. * The exact meaning of that delay depends on the format. * For real-time muxers, data submitted to the muxer more than delay ago * should have been output (e.g. presented to the user), while data * submitted less than delay ago should be still somewhere in the muxer or * some hardware buffer. * Note that packets interleaving may introduce an additional delay. * If the format does not support delay measurement, the return value is * AV_NOPTS_VALUE. */ int64_t av_get_output_delay(AVFormatContext *s, int stream);
?
ok [...]
Anyway, for this last part, unless I am mistaken, there is a strict separation:
delay_total = delay_interleave + delay_output
The original patch gives delay_output, and is useful by itself. Maybe the delay_interleave part can wait until someone actually needs it and therefore can test it for usability.
hmm, iam unsure does anyone else have an oppinion? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends. -- Gandalf
Michael Niedermayer wrote:
This doesnt seem to work very well for example when you have: a slideshow with commentary, the delay from the video stream could make quite big jumps an be constant between them. It might be better to add the remaining duration of the currently displayed frame in there or something
This is a very different use case than the original proposal was meant to solve, which I understood as pre-skewing uncompressed output samples to improve lip sync. It's clever to re-use the mux api for libavdevices, but I don't see much muxing going on there. Maybe a more specific function name would reduce this confusion e.g. estimate_presentation_delay().
...
hmm, iam unsure does anyone else have an oppinion?
I think it's reasonable to pretend that the "mux" interleave delay is 0 for now. Mike Scheutzow
On Thu, Jun 30, 2011 at 09:22:04AM -0400, Mike Scheutzow wrote:
Michael Niedermayer wrote:
This doesnt seem to work very well for example when you have: a slideshow with commentary, the delay from the video stream could make quite big jumps an be constant between them. It might be better to add the remaining duration of the currently displayed frame in there or something
This is a very different use case than the original proposal was meant to solve, which I understood as pre-skewing uncompressed output samples to improve lip sync.
you seem to missunderstand this somehow. when you have 2 streams, 2 muxers, one only video and one only audio and you want to sync them but the video muxer tells you as delay only 0seconds or 30seconds you wont get sync better than 30seconds and thats really not good for a slideshow of lets say pictures in a museum that are being commented. of course if your video display "muxer" displayes exactly based on wallclock pts then you know the delay by looking at the pts and the wallclock.
It's clever to re-use the mux api for libavdevices, but I don't see much muxing going on there.
Maybe a more specific function name would reduce this confusion e.g. estimate_presentation_delay().
One question is if it should also be intended for realtime streaming like lets say for a video conference. if yes, then actual muxing might happen and the interleave delay becomes relevant [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Republics decline into democracies and democracies degenerate into despotisms. -- Aristotle
Michael Niedermayer wrote:
On Thu, Jun 30, 2011 at 09:22:04AM -0400, Mike Scheutzow wrote:
Michael Niedermayer wrote:
This doesnt seem to work very well for example when you have: a slideshow with commentary, the delay from the video stream could make quite big jumps an be constant between them. It might be better to add the remaining duration of the currently displayed frame in there or something This is a very different use case than the original proposal was meant to solve, which I understood as pre-skewing uncompressed output samples to improve lip sync.
you seem to missunderstand this somehow.
Well, it seems that you do not understand the problem that Nicolas is trying to improve. Do you agree with these statements: 1) We are talking about presentation (display to the user of audio and video.) 2) There is a system delay between the call to snd_write_pcm() and when the user actually hears that sound. Assume that this delay is constant, +- half write size. 3) This is a (possibly different) system delay between the call to pass video pixels to the video subsystem, and when the user can see that frame of data. Assume this delay is constant, +- half frame. Nicolas wants to enable decoders to compensate for the two different system delays. The magnitude of these values is typically in the range 10 - 100 milliseconds. I have no idea how he intends to obtain this information (it's difficult to get), but this is the topic I think we are talking about.
when you have 2 streams, 2 muxers, one only video and one only audio and you want to sync them but the video muxer tells you as delay only 0seconds or 30seconds you wont get sync better than 30seconds and thats really not good for a slideshow of lets say pictures in a museum that are being commented.
You seem to be talking about resolution here. I don't understand how that is relevent to this conversation. Mike Scheutzow
On Thu, Jun 30, 2011 at 10:17:52AM -0400, Mike Scheutzow wrote:
Michael Niedermayer wrote:
On Thu, Jun 30, 2011 at 09:22:04AM -0400, Mike Scheutzow wrote:
Michael Niedermayer wrote:
This doesnt seem to work very well for example when you have: a slideshow with commentary, the delay from the video stream could make quite big jumps an be constant between them. It might be better to add the remaining duration of the currently displayed frame in there or something This is a very different use case than the original proposal was meant to solve, which I understood as pre-skewing uncompressed output samples to improve lip sync.
you seem to missunderstand this somehow.
Well, it seems that you do not understand the problem that Nicolas is trying to improve. Do you agree with these statements:
you replied to a comment i made that was about a poorly worded doxy comment. Nicolas has already corrected the doxy and i just wanted to point out that it appeared to me you misunderstood my comment as something else.
1) We are talking about presentation (display to the user of audio and video.)
y
2) There is a system delay between the call to snd_write_pcm() and when the user actually hears that sound. Assume that this delay is constant, +- half write size.
y
3) This is a (possibly different) system delay between the call to pass video pixels to the video subsystem, and when the user can see that frame of data. Assume this delay is constant, +- half frame.
y
Nicolas wants to enable decoders to compensate for the two different system delays. The magnitude of these values is typically in the range 10 - 100 milliseconds.
it can be more but yes [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many things microsoft did are stupid, but not doing something just because microsoft did it is even more stupid. If everything ms did were stupid they would be bankrupt already.
On Thu, Jun 30, 2011 at 04:40:14PM +0200, Michael Niedermayer wrote:
On Thu, Jun 30, 2011 at 10:17:52AM -0400, Mike Scheutzow wrote:
Michael Niedermayer wrote:
On Thu, Jun 30, 2011 at 09:22:04AM -0400, Mike Scheutzow wrote:
Michael Niedermayer wrote:
> This doesnt seem to work very well for example when you have: > a slideshow with commentary, the delay from the video stream could > make quite big jumps an be constant between them. It might be > better to add the remaining duration of the currently displayed frame > in there or something This is a very different use case than the original proposal was meant to solve, which I understood as pre-skewing uncompressed output samples to improve lip sync.
you seem to missunderstand this somehow.
Well, it seems that you do not understand the problem that Nicolas is trying to improve. Do you agree with these statements:
you replied to a comment i made that was about a poorly worded doxy comment. Nicolas has already corrected the doxy and i just wanted to point out that it appeared to me you misunderstood my comment as something else.
1) We are talking about presentation (display to the user of audio and video.)
y
2) There is a system delay between the call to snd_write_pcm() and when the user actually hears that sound. Assume that this delay is constant, +- half write size.
y
3) This is a (possibly different) system delay between the call to pass video pixels to the video subsystem, and when the user can see that frame of data. Assume this delay is constant, +- half frame.
y
also 2 & 3 are not so simple in reality and far from constant [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I am the wisest man alive, for I know one thing, and that is that I know nothing. -- Socrates
Le duodi 12 messidor, an CCXIX, Michael Niedermayer a écrit :
you seem to missunderstand this somehow. when you have 2 streams, 2 muxers, one only video and one only audio and you want to sync them but the video muxer tells you as delay only 0seconds or 30seconds you wont get sync better than 30seconds and thats really not good for a slideshow of lets say pictures in a museum that are being commented.
I believe the crux of the problem is this: there are two different possible meanings for the delay: - The data that is being output now is the data that I wrote <delay> ago. - If I write data now, it will be output in <delay>. For PCM streams fed continuously, this is the same down to the duration of one sample, which is usually less than the OS scheduler's accuracy. But for video display, for example, the former is the time since the last screen refresh, and the latter is the time until the next screen refresh. The first one (let's call it "past delay") can be used in such a way: while (1) { av_write_packet(s, packet); pos += packet->size / bps; /* or maybe packet->duration */ past_delay = av_get_output_past_delay(s); display("Current time is %f\n", rescale(pos - past_delay)); } It can also be used for A-V sync if you assume that the future delay of the video output device is zero or negligible: if (audio_written - audio_past_delay >= next_frame.pts) display_next_frame(); I suppose, but this is purely speculation, that the past delay is more easy to get. If only the past delay is known, synchronization can be achieved by control engineering. An useful information may be how MPlayer handles delay for the video output system. Reimar can possibly enlighten us. Regards, -- Nicolas George
On Thu, Jun 30, 2011 at 04:33:02PM +0200, Nicolas George wrote:
Le duodi 12 messidor, an CCXIX, Michael Niedermayer a écrit :
you seem to missunderstand this somehow. when you have 2 streams, 2 muxers, one only video and one only audio and you want to sync them but the video muxer tells you as delay only 0seconds or 30seconds you wont get sync better than 30seconds and thats really not good for a slideshow of lets say pictures in a museum that are being commented.
I believe the crux of the problem is this: there are two different possible meanings for the delay:
- The data that is being output now is the data that I wrote <delay> ago.
- If I write data now, it will be output in <delay>.
These are both bad actually. the reason is they are non constant and that on a normal multitasking OS the results will be unreliable because time can pass between 2 get delay calls or any get time call. the obvious solution would be to * Consider a media stream to be a continuous stream not made of samples or frames * Return as delay the pair of (wallclock, current presented position in sufficeint high precission) The advnatage is that the (correctly scaled) difference between these 2 would be truly constant up to the drift of the (sound/video) device clock and the system clock. So the timing of when to do the call becomes irrelevant. and AV sync can be achived by doing such a call for video and one for audio and then compensating either stream by the difference. And that works even when the 2 calls are done some time appart. a muxer that has no native capability to obtain such a time pair exactly could still use what it has + a call to get the wall clock. it would be less accurate but not worse than doing seperate calls outside [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When the tyrant has disposed of foreign enemies by conquest or treaty, and there is nothing more to fear from them, then he is always stirring up some war or other, in order that the people may require a leader. -- Plato
Le duodi 12 messidor, an CCXIX, Michael Niedermayer a écrit :
These are both bad actually. the reason is they are non constant and that on a normal multitasking OS the results will be unreliable because time can pass between 2 get delay calls or any get time call.
the obvious solution would be to * Consider a media stream to be a continuous stream not made of samples or frames * Return as delay the pair of (wallclock, current presented position in sufficeint high precission)
The advnatage is that the (correctly scaled) difference between these 2 would be truly constant up to the drift of the (sound/video) device clock and the system clock.
So the timing of when to do the call becomes irrelevant. and AV sync can be achived by doing such a call for video and one for audio and then compensating either stream by the difference. And that works even when the 2 calls are done some time appart.
That sounds reasonable. I join the patches required to implement that in ALSA. I had to use a separate av_gettime because snd_pcm_htimestamp hangs on dmix plugins like it hangs on dsnoop, and while this is a minor annoyance for capture, this is a complete feature breaker for playback. Also, at some time snd_pcm_htimestamp seems to have started reporting monotonic timestamps rather than wall time: I'll have to find a way to fix the demuxer. But this is a completely different issue. Regards, -- Nicolas George
Le duodi 12 messidor, an CCXIX, Nicolas George a écrit :
I join the patches required to implement that in ALSA.
I had to use a separate av_gettime because snd_pcm_htimestamp hangs on dmix plugins like it hangs on dsnoop, and while this is a minor annoyance for capture, this is a complete feature breaker for playback.
Also, at some time snd_pcm_htimestamp seems to have started reporting monotonic timestamps rather than wall time: I'll have to find a way to fix the demuxer. But this is a completely different issue.
Sorry, forgot the files. Regards, -- Nicolas George
On Thu, Jun 30, 2011 at 08:03:39PM +0200, Nicolas George wrote: [...]
@@ -1518,6 +1521,22 @@ int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, */ int av_write_trailer(AVFormatContext *s);
+/** + * Get timing information for the data currently output. + * The exact meaning of "currently output" depends on the format. + * It is mostly relevant for devices that have an internal buffer and/or + * work in real time. + * @param s media file handle + * @param stream stream in the media file
+ * @param dts DTS of the last packet output for the stream + * @param wall absolute time when that packet whas output
these should be marked as outputs also the units/timebases used should be mentioned otherwise the patchset LGTM [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Rewriting code that is poorly written but fully understood is good. Rewriting code that one doesnt understand is a sign that one is less smart then the original author, trying to rewrite it will not make it better.
Le tridi 13 messidor, an CCXIX, Michael Niedermayer a écrit :
these should be marked as outputs also the units/timebases used should be mentioned otherwise the patchset LGTM
Thanks: precisions added, patch updated and pushed. Here is the corresponding minor bump and APIChanged entry. Regards, -- Nicolas George
On date Friday 2011-07-01 10:12:05 +0200, Nicolas George encoded:
Le tridi 13 messidor, an CCXIX, Michael Niedermayer a écrit :
these should be marked as outputs also the units/timebases used should be mentioned otherwise the patchset LGTM
Thanks: precisions added, patch updated and pushed.
Here is the corresponding minor bump and APIChanged entry.
Regards,
-- Nicolas George
From 153dddf1262f82c798dd2d64a813d55b8baf98b1 Mon Sep 17 00:00:00 2001 From: Nicolas George <nicolas.george@normalesup.org> Date: Fri, 1 Jul 2011 10:09:04 +0200 Subject: [PATCH] lavf: bump minor and add APIchanges entry for av_get_output_timestamp
Signed-off-by: Nicolas George <nicolas.george@normalesup.org> --- doc/APIchanges | 3 +++ libavformat/version.h | 2 +- 2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges index 6860b57..aaf8f10 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2011-04-18
API changes, most recent first:
+2011-07-01 - b442ca6 - lavf 53.5.0 - avformat.h + Add an API to get output timestamps: av_get_output_timestamp().
Nit: "Add an API" is redundant, since the file is about API changes, I suggest: Add function av_get_output_timestamp() for getting output timestamps. [...] No need to send another patch for this, just push it. -- FFmpeg = Fascinating Formidable Mastering Power Eccentric God
Le tridi 13 messidor, an CCXIX, Stefano Sabatini a écrit :
Nit: "Add an API" is redundant, since the file is about API changes, I suggest:
Add function av_get_output_timestamp() for getting output timestamps.
Done, but shorter, because "add function av_foo to do foo" is redundant too. Thanks and regards, -- Nicolas George
On 30 Jun 2011, at 16:33, Nicolas George <nicolas.george@normalesup.org> wrote:
An useful information may be how MPlayer handles delay for the video output system. Reimar can possibly enlighten us.
Simple: MPlayer assumes there is none. Personally I've never seen it really relevant and historically the delay info from the sound system was rarely more accurate than +- one frame if such info existed at all.
On Wed, Jun 29, 2011 at 12:25:26PM +0200, Nicolas George wrote:
Le decadi 10 messidor, an CCXIX, Michael Niedermayer a écrit :
with the current API audio/video output "muxers" should "present" the data to the user at the pts of the given packet.
You mean: according to the system's realtime clock rather than some device-specific internal clock?
i didnt say that.
I do not think this is a good idea. To account for the skew in a sound card's clock, it would require slightly resampling the incoming data, while most application would be just happy to just sync on the sound card's clock.
Maybe something along the following lines is clearer: the delay is the duration in timebase units of all buffered data. buffered in the sense of between what goes into the muxer and what is presented to the user or transmitted over the net.
I adapted it that way:
* The delay is the duration, in timebase units, of all buffered data, * i.e. data that has been submitted to the muxer but not yet presented to * the user of transmitted over the net. * The exact meaning of that depends on the muxer. * It is mostly relevant for live streams, like devices or network * protocols.
This doesnt seem to work very well for example when you have: a slideshow with commentary, the delay from the video stream could make quite big jumps an be constant between them. It might be better to add the remaining duration of the currently displayed frame in there or something
some value that is not a valid delay would allow distinguishing it from valid delays. some error code representing "Not implemented" maybe
Would simply AV_NOPTS_VALUE be ok?
yes
also the code should consider the buffering required for interleaving (by dts for example)
You mean packets that have been submitted to av_interleaved_write_frame but that lavf has not yet submitted to oformat->write_packet?
yes [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship naturally arises out of democracy, and the most aggravated form of tyranny and slavery out of the most extreme liberty. -- Plato
participants (5)
-
Michael Niedermayer -
Mike Scheutzow -
Nicolas George -
Reimar Döffinger -
Stefano Sabatini