JyotsnaT / xuggle

Automatically exported from code.google.com/p/xuggle
0 stars 0 forks source link

IPacket duration is not always set. Can it be always computed for audio format ? #157

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi all,

I encode IPackets from an audio source, without telling the encoder which
IStream it will be inserted in:

IPacket outputPacket = IPacket.make();
int samplesNb = _audioEncoder.encodeAudio(outputPacket, samples,
samplesConsumed);
samplesConsumed += samplesNb;

_audioEncoder is defined like this:

_audioEncoder = IStreamCoder.make(IStreamCoder.Direction.ENCODING);
_audioEncoder.setChannels(2);
_audioEncoder.setSampleFormat(IAudioSamples.Format.FMT_S16);
_audioEncoder.setSampleRate(44100);
_audioEncoder.setCodec(ICodec.ID.CODEC_ID_AAC);

Using IStreamCoder this way, it seems that duration is not calculated. Art
Clarke told on the mailing list:
"In general the duration on a packet is not set if you haven't told the
stream coder which IStream it's going to be inserted in.  Also, not
all codecs set duration either -- it's a best effort thing."

Is it possible to force IPacket duration computing (it seems to be always
computable with audio sources) ?

Thanks in advance,

Thibault

Original issue reported on code.google.com by thibault...@gmail.com on 9 Jun 2009 at 5:37

GoogleCodeExporter commented 9 years ago
Considering for future release.  Leaving at Medium.

Original comment by art.cla...@gmail.com on 15 Jun 2009 at 7:48

GoogleCodeExporter commented 9 years ago

Original comment by art.cla...@gmail.com on 22 Jun 2009 at 5:01

GoogleCodeExporter commented 9 years ago
Implemented in r746 for all audio packets encoded.  Video duration will 
continue to
have -1.

Original comment by art.cla...@gmail.com on 2 Jul 2009 at 12:22