[FFmpeg-devel] [PATCH] pulse: set default frame_size to 4608

Michael Niedermayer michaelni at gmx.at
Sat Jan 4 05:03:01 CET 2014


On Sat, Jan 04, 2014 at 01:01:12AM +0100, Federico Simoncelli wrote:
> On Fri, Jan 3, 2014 at 6:41 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Fri, Jan 03, 2014 at 04:55:33PM +0100, Federico Simoncelli wrote:
> >> On Fri, Jan 3, 2014 at 3:44 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> >> > On Fri, Jan 03, 2014 at 01:21:41AM +0100, Federico Simoncelli wrote:
> >> >> On Thu, Jan 2, 2014 at 11:26 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> >> >> > On Thu, Jan 02, 2014 at 04:36:45PM +0100, Federico Simoncelli wrote:
> >> >> >> Given the current defaults (channels = 2, sample_rate = 48000) the
> >> >> >> frame_size is changed to 4608 in order to obtain whole numbers for
> >> >> >> frame_duration (both 16 and 24 bits_per_sample).
> >> >> >>
> >> >> >>  frame_duration = (frame_size * 1000000 * 8) /
> >> >> >>                   (sample_rate * channels * bits_per_sample)
> >> >> >>
> >> >> >> A message has been added to warn the user when the frame duration
> >> >> >> is not an integer.
> >> >> >
> >> >> > the timebase should be changed to a multiple of the sample rate
> >> >> > see the avpriv_set_pts_info() call
> >> >> > that avoids the problem of the durations being not exactly
> >> >> > representable
> >> >>
> >> >> If I understand correctly what you're suggesting is:
> >> >>
> >> >> avpriv_set_pts_info(st, 64, 1, pd->sample_rate);
> >> >
> >> > yes
> >> >
> >> >> and it will generate non-representable timebases:
> >> >>
> >> >> 1/48 = .020833...
> >> >> 1/44.1 = .0226757
> >> >
> >> > rational numbers are quite representable, and really 1/1000000 is
> >> > a rational number in no way different than 1/48 or 1/48000 is
> >> > also if you dont like fractions you can just change the base of
> >> > your representation
> >> >
> >> > ...
> >> >
> >> > so really the non representability is just an artifact of humans
> >> > having 10 fingers
> >>
> >> Yes, that's clear, what I meant is that there was 10-fingered code
> >> around somewhere since I was getting pts warnings after changing the
> >> timebase.
> >> Instead I pinpointed this to be something related to the mp3 encoder
> >> (I don't know what yet).
> >
> > how can i reproduce that issue ?
> > can you share the work in progress patch ?
> 
> I just found out that this may be related to the side data:
> 
> [mp3 @ 0x191e320] skip 1105 samples due to side data
> [mp3 @ 0x191e320] skip 1105/1152 samples
> 
> > frame_pts = 1105, frame_ts = 0.023021, base_ts = 0.000021
> > frame_pts = 1152, frame_ts = 0.024000, base_ts = 0.000021
> > frame_pts = 2304, frame_ts = 0.048000, base_ts = 0.000021
> > frame_pts = 3456, frame_ts = 0.072000, base_ts = 0.000021
> 
> There's one thing that is not clear to me, if the side data are frames
> to be discarded, why is the pts adjusted?

side data is "attached" to normal packets which contain normal data

A encoder might add side data that for example says "dear decoder
if you decode this packet, discard the first 1000 samples, they
are just some kind of padding and the actual audio starts after that"


> 
> 1152 frames, 1105 are side data (47 remaining frames), now I'd expect
> that when I process the first 47 valid frames the pts would be (in my
> case) 0, otherwise (as the current code does) we'd be shifting them of
> 0.023s.
> Am I missing something?
> 
> -- 
> Federico
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140104/2bdd1aca/attachment.asc>


More information about the ffmpeg-devel mailing list