membraneframework / membrane_ffmpeg_swresample_plugin

Plugin performing audio conversion, resampling and channel mixing, using SWResample module of FFmpeg library
Apache License 2.0
2 stars 4 forks source link

Keep timing information when converting from one format into another #40

Closed philipgiuliani closed 1 year ago

philipgiuliani commented 1 year ago

The converter currently discards the time information. With this merge request, we are recalculating the pts of every packet, starting with the pts of the first buffer.

mat-hek commented 1 year ago

Hey, I think that unfortunately my comment from the previous pr applies here as well. However, we're about to merge the raw audio parser, which is capable of injecting timestamps: https://github.com/membraneframework-labs/membrane_raw_audio_parser_plugin/pull/1 Maybe you'd like to plug that after the resampler? That approach doesn't require timestamp computation in each element like this and it's (quite) clear that the timestamps are calculated based on the data ;)

mat-hek commented 1 year ago

Hi there, closing this as the raw audio parser is released and using it with overwrite_pts?: true option is the way to have PTS after an element that doesn't rewrite PTS. Keep in mind (pun intended) that these PTS may not reflect the original PTS of the stream, as explained above ;)