angelcam / rust-ac-ffmpeg

Simple and safe Rust interface for FFmpeg libraries.
MIT License
197 stars 33 forks source link

Add the ability to provide a hint to the muxer about the desired timebase #44

Closed irkill closed 1 year ago

irkill commented 2 years ago

Hello! I found it useful to have the ability to provide a hint to the muxer about the desired timebase.

This is useful, for example, when transmuxing to MP4 container. If the timebase of the input stream differs from the output, then when transferring the timestamp from one timebase to another due to inaccuracy of calculations there may be two different packets with the same dts/pts at the output. Which will result in an error message from FFmpeg:

[mp4 @ 0x7ff150113f40] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1538093 >= 1538093
operutka commented 2 years ago

Hello @irkill and thank you for your pull request! I'm out of my office for the next two weeks. I'll check the PR once I get back.