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

Add local ffmpeg and MediaMTX builds to Docker #3353

Merged
merged 4 commits into from
Feb 6, 2025
Merged

Conversation

j0sh
Copy link
Collaborator

@j0sh j0sh commented Jan 16, 2025

This is needed in order to support Opus (enhanced RTMP) for audio pass through.

The MediaMTX changes have been submitted upstream; hopefully they will get merged soon and we can go back to using off the shelf releases.

@github-actions github-actions bot added the docker Pull requests that update Docker code label Jan 16, 2025
@j0sh j0sh force-pushed the ja/update-ffmpeg branch 2 times, most recently from 9bbcd73 to 6e253ee Compare January 31, 2025 01:18
@j0sh j0sh changed the title Add local ffmpeg build to Docker, bump MediaMTX version. Add local ffmpeg and MediaMTX builds to Docker Jan 31, 2025
@j0sh j0sh marked this pull request as ready for review January 31, 2025 01:19
This is needed in order to support Opus (enhanced RTMP)
&& mv /opt/mediamtx/mediamtx /usr/local/bin/mediamtx \
&& mv /opt/mediamtx/mediamtx.yml /etc/mediamtx/mediamtx.yml \
&& rm -rf /opt/mediamtx/
# Copy artifacts from the builder stage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is temporary, should we put the removed snippet as comments instead of deleting completely?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and update the MEDIAMTX_VERSION with v1.11.2-livepeer-1 as we track that version field for alerts in deployments/version mismatches.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with still deleting, we have the git history to go back to. not really a big fan of commented out code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-introduced the MEDIAMTX_VERSION env var in d6d05ed

since this is temporary, should we put the removed snippet as comments instead of deleting completely?

I am not sure exactly how temporary it would be ... depends on how soon our changes get upstreamed, and whether there is anything else we need to change and maintain for ourselves. Could be a while. Like Max said, we have the git history to fall back to.

@@ -30,6 +30,11 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.3.6 \
&& chmod +x /usr/bin/grpc_health_probe \
&& ldconfig /usr/local/lib

RUN FFMPEG_SHA=b76053d8bf322b197a9d07bd27bbdad14fd5bc15 git clone --depth 1 https://git.ffmpeg.org/ffmpeg.git /ffmpeg \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we already had local ffmpeg for rtmp input and output 😕
https://github.com/livepeer/go-livepeer/blob/master/media/rtmp2segment.go#L59

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see now, you've removed the apt install and are compiling it instead

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - the system ffmpeg is quite old (version 4-something) and we need the bleeding edge, since ffmpeg's support for Opus in RTMP was merged just a couple weeks ago

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 32.25330%. Comparing base (86922ea) to head (7206957).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
server/ai_mediaserver.go 0.00000% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3353         +/-   ##
===================================================
- Coverage   32.25409%   32.25330%   -0.00079%     
===================================================
  Files            147         147                 
  Lines          40584       40585          +1     
===================================================
  Hits           13090       13090                 
- Misses         26723       26724          +1     
  Partials         771         771                 
Files with missing lines Coverage Δ
media/mediamtx.go 0.00000% <ø> (ø)
server/ai_mediaserver.go 7.38832% <0.00000%> (-0.01271%) ⬇️

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 86922ea...7206957. Read the comment docs.

Files with missing lines Coverage Δ
media/mediamtx.go 0.00000% <ø> (ø)
server/ai_mediaserver.go 7.38832% <0.00000%> (-0.01271%) ⬇️

@j0sh
Copy link
Collaborator Author

j0sh commented Feb 5, 2025

Updates for a6e7aef

Updated MediaMTX to latest + bumped Livepeer git tag to fix this issue: bluenviron/mediamtx#4212

Also had to lowercase the connection type since MediaMTX changed these strings recently: bluenviron/mediamtx#4076 Lowercasing keeps us compatible across versions. cc @mjh1

@j0sh j0sh merged commit fd6fe5c into master Feb 6, 2025
19 checks passed
@j0sh j0sh deleted the ja/update-ffmpeg branch February 6, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Pull requests that update Docker code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants