Re: [FFmpeg-devel] [PATCH] avformat/segment: fix cuttting for non-zero start pts

2019-11-01 Thread Marton Balint



On Thu, 31 Oct 2019, Vasily wrote:


Hi Marton,


Please use a proper commit title: e.g:

avformat/segment: fix non-zero start pts

Also make sure you provide the author name you want when you send the
patch email. (you only provided an email address in the From field, not a
full name, I guess this is not intentional).


I've fixed "From" and subject (so it's just my first name, I don't want to 
share my family name etc), hope it's okay now (or do I need to send a completely new 
patch with fixed From and subject instead?).


Yes, you should send a new patch.





What happens if the first packet is not from a reference stream? As far as
I see in that case the output packet timestamp will be 0 based until we
get a packet from the refence stream... Maybe you should accept a packet
from any stream here?


I am not changing output packet timestamps here, I only change the way 
the cutting point for segment muxer is calculated.


You are setting these:

+seg->cur_entry.start_time = (double)pkt->pts * 
av_q2d(st->time_base);
+seg->cur_entry.start_pts = seg->start_pts;

These can affect the packet PTSes of the first segment, because later 
there is code like this:


/* compute new timestamps */
offset = av_rescale_q(seg->initial_offset - (seg->reset_timestamps ? 
seg->cur_entry.start_pts : 0),
  AV_TIME_BASE_Q, st->time_base);
if (pkt->pts != AV_NOPTS_VALUE)
pkt->pts += offset;
if (pkt->dts != AV_NOPTS_VALUE)
pkt->dts += offset;

Regards,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH] avformat/segment: fix cuttting for non-zero start pts

2019-10-31 Thread Vasily
Hi Marton,

> Please use a proper commit title: e.g:
>
> avformat/segment: fix non-zero start pts
>
> Also make sure you provide the author name you want when you send the
> patch email. (you only provided an email address in the From field, not a
> full name, I guess this is not intentional).

I've fixed "From" and subject (so it's just my first name, I don't want to 
share my family name etc), hope it's okay now (or do I need to send a 
completely new patch with fixed From and subject instead?).


> What happens if the first packet is not from a reference stream? As far as
> I see in that case the output packet timestamp will be 0 based until we
> get a packet from the refence stream... Maybe you should accept a packet
> from any stream here?

I am not changing output packet timestamps here, I only change the way the 
cutting point for segment muxer is calculated.
Cutting is performed when a packet in a reference stream has greater pts than 
one determined as cutting point (and some other conditions are met), and before 
my patch that cutting point always assumed reference stream started at zero.

So, as cutting point is used to determine whether current packet has to begin a 
new segment only by looking at reference stream, it doesn't seem correct to me 
to use any other streams as sources of "pts of first packet", as other streams 
could potentially use different start times. Cutting point should make segments 
as close to desired length as possible IMHO.

--- 
Thanks,
Vasily

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

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