Hi,

my problem occurs when transcoding h264/AC3-DVB-streams to h264/AAC-MP4. The
video stream is copied untouched (except timestamps), the audio gets recoded.

The stream timebase is 1/25, therefore each frame has a duration of 3600 PTS
units (in 1/90000 timebase). Some portions of the stream contain PAFF coded
frames; two seperate fields with own timestamps instead of one single frame.
These fields have both their own, unique timestamps and a duration of 1800 (or
0.5 in 1/25 timebase).

Now the problem: I'm feeding the muxer (av_interleaved_write_frame) with
monotone increasing timestamps which are computed in respect to the original PTS
value and the stream timebase (1/25). As result I receive as packet PTS for the
muxer: 1 2 3... The DTS and duration are computed by the muxer and are not
passed as part of the packet structure.

Upon reading the PAFF coded frames, the same PTS values are created twice due to
rounding which is unwanted and very bad as the muxer rejects this as non
monotone timestamps.

My first solution was to multiply each computed timestamp by 2 and to modify the
rounding which (of course) lead to correct monotone timestamps but the muxer
used huge amounts of RAM to multiplex the streams (which is obvious if one makes
some thoughts...). Besides this, the file wasn't what I intended to create: It's
 in slow motion (that is, of course, obvious too if one makes some other
thoughts...).

Any ideas how to avoid these problems? Do I need another timebase (1/90000 or
1/50) with different frame durations? Or do I need to compute all values (PTS,
DTS, duration) by myself instead of passing the work to the muxer?

Greetings
 Andre
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to