Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FFmpeg to 7.0.1 #406

Merged
merged 10 commits into from
Jul 11, 2024
Merged

Update FFmpeg to 7.0.1 #406

merged 10 commits into from
Jul 11, 2024

Conversation

j0sh
Copy link
Collaborator

@j0sh j0sh commented Jul 1, 2024

Updates to the latest ffmpeg release (7.0.1) and adjust unit tests to match some slightly changed behaviors in the CLI that is used for testing. This also uncovered a bug that was fixed as described in #405 but is also included in this PR (see commit message).

The unit tests all pass with zero timestamp adjustments, so this update should be reasonably backwards-compatible with older LPMS. In fact, the updated LPMS transcoder still passes the full test suite even when the test suite is running the old ffmpeg CLI. The unit test changes are only there to make the tests pass when running with the new CLI, mostly changes in a few ffprobe fields and command-line options.

Commits

Pre-Merge

Post-Merge

  • Update go-livepeer install_ffmpeg.sh to point to the LPMS script
  • Update go-livepeer LPMS module to current
  • Notify orchestrators that build from source

j0sh added 7 commits June 19, 2024 06:37
The nvidia test suite was never run after livepeer#393 so this breakage
was not noticed.
* Set the encoder timebase using AVCodecContext.framerate instead of
  the decoder's AVCodecContext.time_base.

  The use of AVCodecContext.time_base is deprecated for decoding.
  See https://ffmpeg.org/doxygen/3.3/structAVCodecContext.html#ab7bfeb9fa5840aac090e2b0bd0ef7589

* Adjust the packet timebase as necessary for FPS pass through
  to match the encoder's expected timebase. For filtergraphs using
  FPS adjustment, the filtergraph output timebase will match the
  framerate (1 / framerate) and the encoder is configured for the same.

  However, for FPS pass through, the filtergraph's output timebase
  will match the input timebase (since there is no FPS adjustment)
  while the encoder uses the timebase detected from the decoder's
  framerate. Since the input timebase does not typically match the FPS
  (eg 90khz for mpegts vs 30fps), we need to adjust the packet timestamps
  (in container timebase) to the encoder's expected timebase.

* For the specific case of FPS passthrough, preserve the original PTS
  as much as possible since we are trying to re-encode existing frames
  one-to-one. Use the opaque field for this, since it is already being
  populated with the original PTS to detect sentinel packets
  during flushing.

  Without this, timestamps can be slightly "squashed" down when
  rescaling output packets to the muxer's timebase, due to the loss of
  precision (eg, demuxer 90khz -> encoder 30hz -> muxer 90khz)
Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.20216%. Comparing base (684658a) to head (d446d4f).
Report is 7 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master        #406         +/-   ##
===================================================
+ Coverage   49.88901%   50.20216%   +0.31315%     
===================================================
  Files             12          12                 
  Lines           1802        1484        -318     
===================================================
- Hits             899         745        -154     
+ Misses           852         689        -163     
+ Partials          51          50          -1     

see 12 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 343a3dd...d446d4f. Read the comment docs.

see 12 files with indirect coverage changes

@j0sh j0sh merged commit d9c78b6 into livepeer:master Jul 11, 2024
5 checks passed
@j0sh j0sh deleted the ja/ffmpeg7 branch July 11, 2024 03:45
@j0sh j0sh mentioned this pull request Jul 11, 2024
@j0sh j0sh mentioned this pull request Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants