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 shell command media source drivers + misc improvements #465

Closed
wants to merge 14 commits into from

Conversation

KW-M
Copy link
Contributor

@KW-M KW-M commented Jan 15, 2023

Description

Added feature:

  • New drivers to allow the use of shell command output as a video or audio source. Added tests and example code for this driver. This can be used in cases where command line programs support media sources that pion/mediadevices doesn't yet (EG: libcamera based cameras), or to add filters to a video or audio stream before pion/mediadevices using ffmpeg or gstreamer.

Improvements:

  • Added bit-rate control to vpx and h264 encoders.
  • Bit-rate is auto-scaled based on the REMB bandwidth messages now.

Fixes:

  • Possible deadlock when a driver throws a read error on the very first read (see the comment on the commit here for an example of this deadlock happening)

Reference issue

Workaround for #407

@at-wat
Copy link
Member

at-wat commented Jan 18, 2023

@KW-M thank you for your contribution!
Could you split PRs per feature/improvement/fix?

@codecov
Copy link

codecov bot commented Jan 18, 2023

Codecov Report

Base: 58.21% // Head: 54.59% // Decreases project coverage by -3.63% ⚠️

Coverage data is based on head (0bd945f) compared to base (f8f8511).
Patch coverage: 8.62% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #465      +/-   ##
==========================================
- Coverage   58.21%   54.59%   -3.63%     
==========================================
  Files          62       66       +4     
  Lines        3683     3953     +270     
==========================================
+ Hits         2144     2158      +14     
- Misses       1412     1666     +254     
- Partials      127      129       +2     
Impacted Files Coverage Δ
pkg/codec/x264/x264.go 60.41% <0.00%> (-4.70%) ⬇️
pkg/driver/cmdsource/audiocmd.go 0.00% <0.00%> (ø)
pkg/driver/cmdsource/videocmd.go 0.00% <0.00%> (ø)
pkg/frame/framesize.go 0.00% <0.00%> (ø)
pkg/driver/cmdsource/cmdsource.go 3.33% <3.33%> (ø)
track.go 25.44% <33.33%> (+0.13%) ⬆️
pkg/codec/vpx/vpx.go 81.00% <65.00%> (-2.52%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@KW-M
Copy link
Contributor Author

KW-M commented Jan 18, 2023

Thanks! Will do.

@KW-M KW-M closed this Jan 18, 2023
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