Skip to content

feat: SetFps v4l2 + ffmpeg command#265

Merged
ChristianDarr-personal merged 34 commits intoedgexfoundry:mainfrom
EdgeX-Camera-Management:set-fps-v4l
Jul 27, 2023
Merged

feat: SetFps v4l2 + ffmpeg command#265
ChristianDarr-personal merged 34 commits intoedgexfoundry:mainfrom
EdgeX-Camera-Management:set-fps-v4l

Conversation

@ChristianDarr-personal
Copy link
Copy Markdown
Contributor

@ChristianDarr-personal ChristianDarr-personal commented Jul 13, 2023

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

Note, any commands executed need to include the query parameter PathIndex with the value set to the number representing the video path stream intended. For example: http://localhost:59982/api/v3/url?PathIndex=0. Also it is recommended to use the updated postman collection.

  1. Execute the FrameRateFormat api to see supported fps values. This shows all fps values for each resolution for each type of encoding. This can be useful for determining the values to set the camera fps.
  2. Execute the DataFormat api to see the supported fps values for the current video format and encoding.
  3. Execute the SetFrameRate api and see no errors.The fps is represented in a time per frame format, meaning the denominator divided by the numerator yields the fps value. I did this to maintain consistency with the internal data structures. You can leave the numerator out completely, and the denominator will represent the fps value.
  4. Execute the GetFrameRate api and see that the fps match.
  5. Test the video stream and/or raw device stream to see if the changes apply. Certain video players seem to reset the fps value themselves, so it may not be viable to see the fps value of the /dev/video stream reflected in them.

New Dependency Instructions (If applicable)

Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
@ChristianDarr-personal ChristianDarr-personal changed the title Set fps v4l feat: SetFps v4l2 + ffmpeg command Jul 14, 2023
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 14, 2023

Codecov Report

Merging #265 (defad8f) into main (7adbeca) will decrease coverage by 0.74%.
The diff coverage is 0.00%.

❗ Current head defad8f differs from pull request most recent head db557b0. Consider uploading reports for the commit db557b0 to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff            @@
##            main    #265      +/-   ##
========================================
- Coverage   4.95%   4.21%   -0.74%     
========================================
  Files          8       8              
  Lines        908    1067     +159     
========================================
  Hits          45      45              
- Misses       863    1022     +159     
Files Changed Coverage Δ
internal/driver/device.go 6.15% <0.00%> (-5.28%) ⬇️
internal/driver/driver.go 3.79% <0.00%> (-0.52%) ⬇️
internal/driver/ffmpeg.go 16.50% <0.00%> (ø)
internal/driver/metadata.go 0.00% <0.00%> (ø)

@vyshali-chitikeshi
Copy link
Copy Markdown
Contributor

Validation looks good with get frame rate, get video data format and set fps api's.

Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Copy link
Copy Markdown
Contributor

@presatish presatish left a comment

Choose a reason for hiding this comment

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

Posting first set of my review comments.

ChristianDarr-personal and others added 11 commits July 21, 2023 13:00
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: preethi-satishcandra <preethi.satishchandra@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: preethi-satishcandra <preethi.satishchandra@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: preethi-satishcandra <preethi.satishchandra@intel.com>
Copy link
Copy Markdown
Contributor

@ajcasagrande ajcasagrande left a comment

Choose a reason for hiding this comment

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

Still looking at driver/metadata.go. Here are my thoughts so far.

if edgexErr != nil {
return errors.NewCommonEdgeXWrapper(edgexErr)
}
fpsValueDenominator, ok := fpsParam.(map[string]interface{})[FpsValueDenominator]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the naming of this in the API input can be a little confusing. technically these are the "interval" values which are an inverse of the actual fps. its actually spf (sunblock anyone)? seconds per frame. I think maybe we name it FpsInvervalDenominator? Either way we probably need to document it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah that was a problem during development, the fact that internally it's handled opposite of how we usually think about frame rates.

ChristianDarr-personal and others added 3 commits July 25, 2023 19:56
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: preethi-satishcandra <preethi.satishchandra@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: preethi-satishcandra <preethi.satishchandra@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
Signed-off-by: Darr, Christian <christian.darr@intel.com>
@vyshali-chitikeshi
Copy link
Copy Markdown
Contributor

Validation looks good

Copy link
Copy Markdown
Contributor

@presatish presatish left a comment

Choose a reason for hiding this comment

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

LGTM

@ChristianDarr-personal ChristianDarr-personal merged commit 040a5a6 into edgexfoundry:main Jul 27, 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.

5 participants