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

[v0.2.4] New Index based Camera Device Capturing (Fixes #27) #29

Merged
merged 49 commits into from
Oct 7, 2022
Merged

Conversation

abhiTronix
Copy link
Owner

@abhiTronix abhiTronix commented Aug 15, 2022

Brief Description

Implemented a new Index based Camera Device Capturing feature (Similar to OpenCV), where the user just have to assign device index as integer number in source parameter of DeFFcode APIs to directly access the given input device in few seconds.

Requirements / Checklist

  • I have read the DeFFcode PR Guidelines.
  • I have read the DeFFcode Documentation.
  • I have updated the documentation files accordingly(if required).

Related Issue

#27

Context

Currently deffcode users have to manually Identify and Specify each Video Capture Device Name/Path and suitable Demuxer on different OS platforms. This PR bring the Index based Camera Device Capturing feature that implements Device Indexing (similar to OpenCV) for all currently supported OS platforms, where the user just have to assign device index as integer (-n to n-1th) in source parameter of DeFFcode APIs to directly access the given input device in few seconds, thus minimizing perceived complexity of decoding Live Feed Devices.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Miscellaneous (if available):

Bare-minimum Code to test this PR feature on your computer:

# import the necessary packages
from deffcode import FFdecoder
import cv2

# initialize and formulate the decoder for BGR24 pixel format output
decoder = FFdecoder(0, frame_format="bgr24", verbose=True).formulate()

# grab the BGR24 frames from decoder
for frame in decoder.generateFrame():

    # check if frame is None
    if frame is None:
        break

    # {do something with the frame here}

    # Show output window
    cv2.imshow("Output", frame)

    # check for 'q' key if pressed
    key = cv2.waitKey(1) & 0xFF
    if key == ord("q"):
        break

# close output window
cv2.destroyAllWindows()

# terminate the decoder
decoder.terminate()

- 💡 Updated code comments.

- ✏️ Docs: Fixed typo.
- 🩹 Fixed bad formatting and context.
- ✨ Added new `validate_device_index` method to verify if given device index is valid or not?
  - 🥚 Note: Only Integers or String of integers are valid indexes. Returns a boolean value, confirming whether valid(If true), or not(False).
  - ⚡️ Added checks to support all +ve and -ve integers, both as integer and string types.
- 📝 Added method and its parameters description.
- 🎉 Implemented new `extract_device_n_demuxer` method for discovering and extracting all Video-Capture device(s) name/path/index present on system and supported by valid OS specific FFmpeg demuxer.
- ✨ Added support for three OS specific FFmpeg demuxers: namely `dshow` for Windows, `v4l2` for Linux, and `avfoundation` for Darwin/Mac OSes.
- 🧑‍💻 Implemented separate code for parsing outputs of python `subprocess` module outputs provided with different commands for discovering all Video-Capture devices present on system.
  - ⚡️ Processed `dshow` (on Windows) and `avfoundation` (on Darwin) demuxers in FFmpeg commands with `-list_devices true` parameters using `subprocess` module and applied various brute-force pattern matching on its output for discovering and extracting all devices names/indexes.
  - ⚡️ Used `v4l2-ctl` submodule command on Linux machines for listing all Video-Capture devices using `subprocess` module and applied various brute-force pattern matching on its output for discovering and extracting all devices names and true system `/dev/video` paths.
    - 🩹 Added patch for a single device with multiple `/dev/video` paths _(each for metadata, video, controls)_, where it iterates on each path to find the exact path that contains valid video stream. 
    - 🥅 Added elaborated checks for catching all possible system errors that can occur while running `v4l2-ctl` submodule command.
    - 🥚 Note: The method will return discovered devices as list of dictionaries with device paths(`/dev/video`) as keys and respective device name as the values, instead of default list of device names.
- 🔊 Added various logging messages to notify users about all discover devices names/paths w.r.t indexes.
- ⚠️ The `extract_device_n_demuxer` method will raise `RuntimeError` if it fails to identify any device.
- 🥅 Added various checks to assert invalid input parameters and unsupported OSes.
- 🚩 Added `machine_OS` parameter to specify OS running on the system, must be value of `platform.system()` module. ⚠️ If invalid the method will raise ValueError.
- 🩹 Added patch for handling Linux specific log messages.
- 📝 Added related method and its parameter description.
- ✨ Implemented new Index based Camera Device Capture feature (Similar to OpenCV), where the user just have to assign device index as integer (-n to n-1) in source parameter of DeFFcode APIs to directly access the given input device in few seconds.

- Sourcer API:
  - ✨ Implemented new comprehensive approach to handle `source_demuxer` parameter w.r.t  different `source` parameter values
    - ✨ Sourcer API' `source_demuxer` parameter now accepts "auto" as its value for enabling Index based Camera Device Capture feature in Sourcer API.
    - 🧑‍💻 Sourcer API also auto-enforces `source_demuxer="auto"` by default, whenever a valid device index (uses `validate_device_index` method for validation) is provided as its `source` parameter value.
    - ⚠️ Sourcer API will through `Assertion` error if `source_demuxer="auto"` is provided explicitly without a valid device index at its `source` parameter.
  - 🏗️ Source API now accepts all +ve and -ve device indexes (e.g. -1,0,1,2 etc.) to its `source` parameter, both as in integer and string of integer types as source in Index based Camera Device Capture feature.
    - ⚡️ Sourcer API uses `extract_device_n_demuxer` method for discovering and extracting all Video-Capture device(s) name/path/index present on system. It will throw `RuntimeError` on failure to identify any device.
    - 🥅 Sourcer API auto verifies that the specified source device index is in range of the devices discovered, ⚠️ It will raise `ValueError` if value goes out of valid range.
    - ⚡️ Sourcer API also automatically handle -ve indexes if specified within the valid range.
    - 🩹 Implemented patch to auto-add `video=` suffix to selected device name before using it as video source on Windows OSes.
    - 🩹 Added patch for handling dictionary of devices paths(with devices names as values) and log messages on Linux Oses.
  - ⚡️ Replaced `os_windows` internal parameter with `machine_OS`, and changed its input from `os.name` to more flexible `platform.system()`.
  - ➕ Added `copy` import for shallow copying various class parameters.
  - 🎨 Removed `source_extension` internal parameter and assigned values directly.
  - 🔥 Removed redundant code.
  - 💡 Updated code comments.
  - 🔊 Updated logs messages.

- FFdecoder API:
  - 🐛 Fixed `av_interleaved_write_frame(): broken pipe` warning bug by switching `process.terminate()`
  with `process.kill()`.
  - 🧱 Replaced `continue` with `break` in `generateFrame()` method.
  - ✏️ Fixed typos in logs messages
  - 💡 Updated code comments.
- ✅ Updated FFdecoder API's `test_camera_capture` unittest to test new Index based Camera Device Capturing on different platforms.
  - ☂️ Added various parametrize `source` and `source_demuxer` parameter data to attain maximum coverage.
  - ⚡️ Added `result` field to `fail` and `xfail` unittest according to parametrize data provided on different platforms.
  - 🔥 Removed `pytest.mark.skipif` to support all platforms.
- 🐛 Fixed missing `lavfi` demuxer for `mandelbrot` virtual source in Sourcer API's `test_probe_stream_n_retrieve_metadata` unittest.
  - 🔥 Removed redundant similar ValueError checks.
@abhiTronix abhiTronix added Documentation 📑 Improvements or additions to DeFFcode documentation. Enhancement ⚡ New feature Issue/Request enhancing DeFFcode APIs. WIP 🏗️ Work in Progress New Release 🎇 New Release!!! labels Aug 15, 2022
@abhiTronix abhiTronix added this to the v0.2.4 milestone Aug 15, 2022
@abhiTronix abhiTronix self-assigned this Aug 15, 2022
@abhiTronix abhiTronix linked an issue Aug 15, 2022 that may be closed by this pull request
4 tasks
…nux module.

🧪 CI: Added check exception for `mandelbrot` virtual source in Sourcer API's `test_probe_stream_n_retrieve_metadata` unittest.

🧑‍💻 FFhelper: Updated logs in `check_sp_output` method for improving error output message.
@codecov
Copy link

codecov bot commented Aug 15, 2022

Codecov Report

Base: 97.57% // Head: 96.61% // Decreases project coverage by -0.95% ⚠️

Coverage data is based on head (f82ae29) compared to base (f833f25).
Patch coverage: 93.06% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
- Coverage   97.57%   96.61%   -0.96%     
==========================================
  Files           6        6              
  Lines         618      768     +150     
==========================================
+ Hits          603      742     +139     
- Misses         15       26      +11     
Impacted Files Coverage Δ
deffcode/ffhelper.py 96.66% <85.96%> (-3.34%) ⬇️
deffcode/utils.py 97.87% <87.50%> (+2.87%) ⬆️
deffcode/sourcer.py 97.33% <94.11%> (-0.89%) ⬇️
deffcode/ffdecoder.py 95.61% <96.80%> (+0.16%) ⬆️
deffcode/version.py 100.00% <100.00%> (ø)

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.

…type.

- 🎨 Fixed logger requiring `utf-8` decoding.
- 🩹 Added missing `force_retrieve_stderr` argument to `check_sp_output` in `extract_device_n_demuxer` method on Linux platforms.
- 🔊 Updated logs.
- 🔊 Updated log messages.

- ⚗️ Bash Script: Removed `sudoers` to `ALL=NOPASSWD` for `v4l2-ctl` Linux module.
- ⚗️ Bash Script: Updated `sudoers` to `ALL=NOPASSWD` for `v4l2-ctl` Linux module.
⚡️ FFhelper: More robust pattern matching for Linux machines.
- 💡 Updated code comments.

- ⚗️ Bash Script: Created  undeleteable file for testing.
…ta (Fixes #31)

- ✨ Added three new metadata properties: `output_video_resolution`, `output_video_framerate`, `output_frames_pixfmt` for handling extracted Output Stream values, whenever additional FFmpeg parameters(such as FFmpeg filters) are defined.
- ⚗️ Added support for auto-handling additional FFmpeg parameters defined by `sourcer_params` dictionary parameters.
  - ⚡️ Implement new separate pipeline for parsing Output Stream metadata by decoding video source using `null` muxer for few microseconds whenever additional FFmpeg parameters(such as `-vf` filters) are defined by the user.
  - 🔧 Included new `metadata_output` internal parameter for holding Output Stream metadata splitted from original Sourcer Metadata extracted from new pipeline.
  - 🔧 Included new `output_video_resolution`, `output_video_framerate`, `output_frames_pixfmt` internal parameters for metadata properties, whenever Output Stream Metadata available.
  - 🚩 Added new `extract_output` boolean parameter to `extract_video_pixfmt` and `extract_resolution_framerate` internal methods for extracting output `pixel-format`, `framerate` and `resolution` using Output Stream metadata instead of Sourcer Metadata, whenever available.
- ⚡️ Added tuple to `sourcer_params` exception.
- ➕ Added `dict2Args` import.
- 💡 Updated code comments.
…es. (Fixes #31)

- 🧱 Implemented new comprehensive support for both discarding key default FFmpeg parameters from Decoding pipeline simply by assigning them `null` string values, and concurrently using values extracted from Output Stream metadata properties (available only when FFmpeg filters are defined) for formulating Pipeline.
  - ✨ Added `null` string value support to `-framerate` and `-custom_resolution` attributes, as well as `frame_format` parameter for easily discarding them.
  - 🚧 Re-Implemented calculation of rawframe pixel-format.
    - 🏗️ Reconfigured default rawframe pixel-format, Now rawframe pixel-format will always default to `source_video_pixfmt` with `frame_format="null"`.
    - 💥 Now with `frame_format` parameter value either "null" or invalid or undefined, rawframe pixel-format value is taken from `output_frames_pixfmt` metadata property extracted from Output Stream (available only when filters are defined). If valid `output_video_resolution`  metadata property is found then it defaults to default pixel-format(calculated variably).
    - 🏗️ Also with `frame_format="null"`, `-pix_fmt` FFmpeg parameter will not be added to Decoding pipeline.
  - 🚧 Re-Implemented calculation of rawframe resolution value.
    - 💥 Now with `-custom_resolution` dictionary attribute value either "null" or invalid or undefined, rawframe resolution value is first taken from `output_video_resolution` metadata property extracted from Output Stream (available only when filters are defined), next from `source_video_resolution` metadata  property(extracted from Input Source Stream). If neither `output_video_resolution` nor `source_video_resolution` valid metadata properties are found then `RuntimeError` is raised.
    - 🏗️ Also with `-custom_resolution` dictionary attribute value "null", `-s/-size` FFmpeg parameter will not be added to Decoding pipeline.
  - 🚧 Re-Implemented calculation of output framerate value.
    - 💥 Now with `-framerate` dictionary attribute either null or invalid or undefined, output framerate value is first taken from `output_video_framerate` metadata property extracted from Output Stream (available only when filters are defined), next from `source_video_framerate` metadata  property(extracted from Input Source Stream). If neither `output_video_resolution` nor `source_video_framerate` valid metadata properties are found then `RuntimeError` is raised.
    - 🏗️ Also with `-framerate` dictionary attribute value "null", `-r/-framerate` FFmpeg parameter will not be added to Decoding pipeline.
- ⚡️ Implemented passing of simple/complex filters(via `-vf` and ffmpeg pre-headers(`-filter_complex`) and (via `-ffprefixes`) directly to Sourcer API's `sourcer_params` parameter for probing Output Stream metadata and filter values.
- ⚡️ Simplified raw frame dtype calculation based on selected pixel-format.
  - 💥 Now unsupported dtype pixel-format always defaults to `rgb24`.
  - 🏗️ Also, `output_frames_pixfmt` metadata property(if available) will be overridden to `rgb24`.
- 🏗️ Extended `YUV444p` reconstruction patch to all YUV based pixel-formats.
- ⚡️ Improved handling of `frame_format` parameter.
- 🔨 Renamed `source_metadata` internal parameter to `sourcer_metadata`.
- 🔥 Removed redundant dummy value for `output_frames_pixfmt` metadata property.
- 🔥 Removed redundant variable definitions.
- 🔊 Updated logging messages text and position.
- 💡 Updated code comments.
- ✏️ Fixed several typos.
- ✨ Added new `test_discard_n_filter_params` unittest for test recently added supported for both discarded parameters and filter values.
- ☂️ Added various parametrize test data to attain maximum coverage.
- ⚡️ Limited range of extracted frames, for finishing tests faster.
- ✏️ Fixed typos.
- 💥 Added `source_video_pixfmt` unalterable metadata property group.
- 🩹 Fixed `approx_video_nframes` metadata property check.
- 🔊 Updated logging messages.
- 📝 Updated FFdecoder  API params docs w.r.t recent changes and supported for both discarded parameters and filter values.
  - 🚸 Added new admonitions to explain handling of "null" and (special-case), undefined, or invalid type values in various parameters/attributes.
  - ♿️ Added new footer reference explaining the handling of Default pixel-format for `frame_format` parameter.
  - 🩹 Added missing docs for `-default_stream_indexes` ffparams attribute.
- 📝 Added docs for recently added additional FFmpeg parameter in Sourcer API's `sourcer_params` parameter.
  - 🔥 Removed unsupported `-custom_resolution` sourcer_params attributes from `sourcer_params` parameter docs.
  - 🔥 Removed redundant `-vcodec` and `-framerate` attributes from `sourcer_params` parameter docs.
- 📝 Updated parameters/attributes introductory descriptions.
- 💡 Updated code comments in examples.
- 🩹 Fixed invalid hyperlink in ReadMe.md
- ✏️ Fixed typos and context.
…t metadata properties.

- 💬 Insights on bug:
  Due to separation in source and output metadata properties, the user can easily get confused
  on when to use which property for certain applications(like defining Video Writer which usually
  requires output framerate and frame-size), and A usual choice would be to use output metadata
  properties for this purpose. But since output metadata properties only available when FFmpeg
  filters via. `-vf` or `-filter_complex` are manually defined, therefore API throws KeyError
  on calling them in any usage example.

  (Note: One can also thought that using source metadata properties would be safe then, but that
  is never been the case, for example on using `scale` or `size` like filters, the output frame
  size might significantly differ than what `source_video_resolution` source metadata properties
  is outputting)

- 🐛 Changes to fix this bug:
  - Sourcer  API:
    - ✨ Added new `force_retrieve_missing` parameter to `retrieve_metadata()` method for returning metadata missing in current Pipeline as `(metadata, metadata_missing)` tuple value instead of just `metadata`, when `force_retrieve_missing=True`.
    - ⚡️ Added various output stream metadata properties that are only available when additional FFmpeg parameters(such as filters) are defined manually, by assigning them counterpart source
    stream metadata property values
    - 🎨 Simplified JSON formatting and returning values logic.

  - FFdecoder API:
    - ⚡️ Enforced `force_retrieve_missing` parameter in Sourcer API's `retrieve_metadata()` method for returning metadata missing in current Pipeline as `(metadata, metadata_missing)` tuple value instead of just `metadata`.
    - Added new `missing_prop` internal class variable for handling metadata properties missing,  received from Sourcer API.
    - 💥 Moved `ffdecoder_operational_mode` to missing metadata properties that cannot be updated but are read only.
    - 🚸 Added missing metadata properties to metadata class property object for easy printing along with other metadata information.
    - 🧑‍💻 Implemented missing metadata properties updation via. overridden metadata class property object.
      - ⚡️ Added `counterpart_prop` dict to handle all counterpart source properties for each missing output properties.
      - ⚡️ Implemented missing output properties auto-updation with counterpart source property is updated.
      - ♿️ Added separate case for handling only missing metadata properties and notifying user about counterpart source properties.
    - ⏪️ Removed `source_video_pixfmt` from unalterable metadata properties group.
    - 🔊 Updated logging messages.

- API:
  - 💥 Renamed `output_video_resolution` metadata property to `output_frames_resolution`.
  - 💥 Renamed `output_video_framerate` metadata property to `output_framerate`.
  - 🚩 Changed related internal variable names w.r.t metadata property names.

- CI:
  - ✅ Updated unittests to reflect recent name changes.

- Docs:
  - 📝 Updated parameter docs to reflect recent name changes.
- 💬 Insights on bug:
  When a source metadata property was updated, calling `update()` on `value` dict directly was causing non-existential missing metadata properties to be added to source metadata properties dictionary, along with source metadata property.

 - 🐛 Changes to fix this bug:
   - 🚑️ Replaced `update()` calling  on `value` dict directly with explicitly assigning values to source metadata properties dictionary.
   - 🧑‍💻 Simplified `missing_prop` validation.
   - 🔥 Removed unwanted `continue` in middle of loop.
@abhiTronix abhiTronix mentioned this pull request Aug 22, 2022
🔥 FFdecoder: Remove unusable exclusive `yuv` frames patch.
- ✨ Added new pixel-formats to supported group by extending raw bits-per-component range.
…r values. (Fixes #31)

- 🧱 Implemented new comprehensive support for both discarding key default FFmpeg parameters from Decoding pipeline simply by assigning them `null` string values, and concurrently using values extracted from Output Stream metadata properties _(available only when FFmpeg filters are defined)_ for formulating pipelines.
  - ✨ Added `null` string value support to `-framerate` and `-custom_resolution` attributes, as well as `frame_format` parameter for easily discarding them.
  - 🚧 Re-Implemented calculation of rawframe pixel-format.
    - 🏗️ Reconfigured default rawframe pixel-format, Now rawframe pixel-format will always default to `source_video_pixfmt` with `frame_format="null"`.
    - 💥 Now with `frame_format` parameter value either "null" or invalid or undefined, rawframe pixel-format value is taken from `output_frames_pixfmt` metadata property extracted from Output Stream (available only when filters are defined). If valid `output_video_resolution`  metadata property is found then it defaults to default pixel-format(calculated variably).
    - 🏗️ Also with `frame_format="null"`, `-pix_fmt` FFmpeg parameter will not be added to Decoding pipeline.
  - 🚧 Re-Implemented calculation of rawframe resolution value.
    - 💥 Now with `-custom_resolution` dictionary attribute value either "null" or invalid or undefined, rawframe resolution value is first taken from `output_video_resolution` metadata property extracted from Output Stream (available only when filters are defined), next from `source_video_resolution` metadata  property(extracted from Input Source Stream). If neither `output_video_resolution` nor `source_video_resolution` valid metadata properties are found then `RuntimeError` is raised.
    - 🏗️ Also with `-custom_resolution` dictionary attribute value "null", `-s/-size` FFmpeg parameter will not be added to Decoding pipeline.
  - 🚧 Re-Implemented calculation of output framerate value.
    - 💥 Now with `-framerate` dictionary attribute either null or invalid or undefined, output framerate value is first taken from `output_video_framerate` metadata property extracted from Output Stream (available only when filters are defined), next from `source_video_framerate` metadata  property(extracted from Input Source Stream). If neither `output_video_resolution` nor `source_video_framerate` valid metadata properties are found then `RuntimeError` is raised.
    - 🏗️ Also with `-framerate` dictionary attribute value "null", `-r/-framerate` FFmpeg parameter will not be added to Decoding pipeline.
- ⚡️ Implemented passing of simple `-vf` filters, complex `-filter_complex` filters, and pre-headers(via `-ffprefixes`) directly to Sourcer API's `sourcer_params` parameter for probing Output Stream metadata and filter values.
- ⚡️ Extended range of supported output frame pixel-formats. 
  - ✨ Added new pixel-formats to supported group by extending raw bits-per-component range.
- ⚡️ Simplified raw frame dtype calculation based on selected pixel-format.
  - 💥 Now unsupported dtype pixel-format always defaults to `rgb24`.
  - 🏗️ Also, `output_frames_pixfmt` metadata property(if available) will be overridden to `rgb24`.
- 🔥 Removed redundant dummy value for `output_frames_pixfmt` metadata property.
- 🚑️ Fixed critical KeyError bug arises due to missing output metadata properties.
  - ⚡️ Enforced `force_retrieve_missing` parameter in Sourcer API's `retrieve_metadata()` method for returning metadata missing in current Pipeline as `(metadata, metadata_missing)` tuple value instead of just `metadata`.
  - Added new `missing_prop` internal class variable for handling metadata properties missing,  received from Sourcer API.
  - 💥 Moved `ffdecoder_operational_mode` to missing metadata properties that cannot be updated but are read only.
  - 🚸 Added missing metadata properties to metadata class property object for easy printing along with other metadata information.
  - 🧑‍💻 Implemented missing metadata properties updation via. overridden metadata class property object.
    - ⚡️ Added `counterpart_prop` dict to handle all counterpart source properties for each missing output properties.
    - ⚡️ Implemented missing output properties auto-updation with counterpart source property is updated.
    - ♿️ Added separate case for handling only missing metadata properties and notifying user about counterpart source properties.
- 🐛 Fixed source metadata properties update bug causing non-existential missing metadata properties to be added to source metadata properties dictionary along with source metadata property.
    - 🚑️ Replaced `update()` calling  on `value` dict directly with explicitly assigning values to source metadata properties dictionary.
    - 🧑‍💻 Simplified `missing_prop` validation.
    - 🔥 Removed unwanted `continue` in middle of loop.
- 🔥 Remove unusable exclusive `yuv` frames patch.
- 🐛 Fixed `KeyError` bug arises due to wrong variable placement.
- 🩹 Fixed `approx_video_nframes` metadata property check.
- ⚡️ Improved handling of `frame_format` parameter.
- 🔊 Updated logging messages.
- 💡 Updated code comments.

- Sourcer API: 
  - 🧱 Added support for additional FFmpeg parameters and Output metadata
    - ✨ Added three new metadata properties: `output_video_resolution`, `output_video_framerate`, `output_frames_pixfmt` for handling extracted Output Stream values, whenever additional FFmpeg parameters(such as FFmpeg filters) are defined.
    - ⚗️ Added support for auto-handling additional FFmpeg parameters defined by `sourcer_params` dictionary parameters.
      - ⚡️ Implement new separate pipeline for parsing Output Stream metadata by decoding video source using `null` muxer for few microseconds whenever additional FFmpeg parameters(such as `-vf` filters) are defined by the user.
      - 🔧 Included new `metadata_output` internal parameter for holding Output Stream metadata splitted from original Sourcer Metadata extracted from new pipeline.
      - 🔧 Included new `output_video_resolution`, `output_video_framerate`, `output_frames_pixfmt` internal parameters for metadata properties, whenever Output Stream Metadata available.
      - 🚩 Added new `extract_output` boolean parameter to `extract_video_pixfmt` and `extract_resolution_framerate` internal methods for extracting output `pixel-format`, `framerate` and `resolution` using Output Stream metadata instead of Sourcer Metadata, whenever available.
    - ⚡️ Added tuple to `sourcer_params` exception.
    - ➕ Added `dict2Args` import.
  - ✨ Added new `force_retrieve_missing` parameter to `retrieve_metadata()` method for returning metadata missing in current Pipeline as `(metadata, metadata_missing)` tuple value instead of just `metadata`, when `force_retrieve_missing=True`.
  - ⚡️ Added various output stream metadata properties that are only available when additional FFmpeg parameters(such as filters) are defined manually, by assigning them counterpart source
    stream metadata property values
  - 🎨 Simplified JSON formatting and returning values logic.
  - 🔊 Updated logging messages text and position.
  - 🔥 Removed redundant variable definitions.
  - 💥 Renamed `output_video_resolution` metadata property to `output_frames_resolution`.
  - 💥 Renamed `output_video_framerate` metadata property to `output_framerate`.
  - 🚩 Changed related internal variable names w.r.t metadata property names.

- Docs:
  - 📝 Updated FFdecoder  API params docs w.r.t recent changes and supported for both discarded parameters and filter values.
    - 🚸 Added new admonitions to explain handling of "null" and (special-case), undefined, or invalid type values in various parameters/attributes.
    - ♿️ Added new footer reference explaining the handling of Default pixel-format for `frame_format` parameter.
    - 🩹 Added missing docs for `-default_stream_indexes` ffparams attribute.
  - 📝 Added docs for recently added additional FFmpeg parameter in Sourcer API's `sourcer_params` parameter.
    - 🔥 Removed unsupported `-custom_resolution` sourcer_params attributes from `sourcer_params` parameter docs.
    - 🔥 Removed redundant `-vcodec` and `-framerate` attributes from `sourcer_params` parameter docs.
  - 📝 Updated recipes docs to reflect recent changes in APIs. 
  - 📝 Updated parameter docs to reflect recent name changes.
  - 📝 Updated parameters/attributes introductory descriptions.
  - 💡 Updated code comments in examples.
  - 🩹 Fixed invalid hyperlink in ReadMe.md
  - ✏️ Fixed typos and context.

- CI: 
  - ✅ Added new unittests for discarded parameters and filter values. 
    - ✨ Added new `test_discard_n_filter_params` unittest for test recently added supported for both discarded parameters and filter values.
    - ☂️ Added various parametrize test data to attain maximum coverage.
    - ⚡️ Limited range of extracted frames, for finishing tests faster.
  - ✅ Updated unittests to reflect recent name changes.
  - 💡 Updated code comments.
  - ✏️ Fixed several typos.

- Utils:
   - ✏️ Fixed logger name typo.
- 🐛 Fixed missing `ffparams` parameter bug in `test_discard_n_filter_params()` unittest.
- ☂️ Updated various parametrize data to attain maximum coverage.

- Bash Script:
 - 🐛 Fixed `chattr: No such file or directory` bug.
 - 🚚 Updated `undelete.txt` file path.

- 🚚 Utils:Updated `undelete.txt` file path in CI test.

- 📝 Sourcer: Updated method description
- ✨ Added `decode-camera-devices.md` doc for Decoding Camera Devices using Indexes:
  - 📝 Added `Enumerating all Camera Devices with Indexes` example doc with code.
  - 📝 Added `Capturing and Previewing frames from a Camera using Indexes` example doc with code.
  - 📝 Added necessary admonitions for explaining important information.
- ✨ Added Camera Device Index support docs to FFdecoder and Sourcer API params.
  - 📝 Updated `source` param doc.
  - 📝 Updated `source_demuxer` param doc.
- 📝 Updated both basic and advanced project Index hyperlinks.
  - 🏗️ Moved `decoding-live-feed-devices.md` doc from basic to advanced directory.
  - 💄 Updated page navigation in `mkdocs.yml`.
- 💄 Update announcement bar to feature Index based Camera Device Capture support.
- 🎨 Updated Project description and Key features of DeFFcode.
- 🎨 Updated README.md with latest information.
- 💄 Changed title headings and icons.
- ⚡️ Added `enumerate_devices` property object to enumerate all probed Camera Devices connected to a system names along with their respective "device indexes" or "camera indexes" as python dictionary.
- 👽️ Updated Hardware-Accelerated Video Decoding and Transcoding docs to inform users about DeFFcode generated YUV frames not yet supported by OpenCV and its APIs.
@abhiTronix abhiTronix merged commit 589ece3 into master Oct 7, 2022
@abhiTronix abhiTronix deleted the dev branch October 7, 2022 02:59
@abhiTronix abhiTronix added Solved 🥅 Final goal achieved. and removed WIP 🏗️ Work in Progress labels Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation 📑 Improvements or additions to DeFFcode documentation. Enhancement ⚡ New feature Issue/Request enhancing DeFFcode APIs. New Release 🎇 New Release!!! Solved 🥅 Final goal achieved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Idea]: Similar to OpenCV, Index based Camera Device Capture
1 participant