opencv-ffmpeg-gstreamer


Nameopencv-ffmpeg-gstreamer JSON
Version 4.5.3 PyPI version JSON
download
home_pagehttps://github.com/herambgvd/opencv-ffmpeg-gstreamer
SummaryCustom OpenCV build with FFmpeg and GStreamer support
upload_time2024-11-07 07:51:33
maintainerNone
docs_urlNone
authorHeramb Mishra
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # OpenCV with FFmpeg and GStreamer Support

This project provides a custom build of OpenCV with support for FFmpeg and GStreamer, enabling enhanced video and image processing capabilities. It’s packaged as a Python wheel for easy installation and compatibility across different projects.

## Features
- **FFmpeg Integration**: Enables advanced video processing, encoding, and decoding.
- **GStreamer Integration**: Provides support for flexible multimedia pipelines and video processing tasks.
- **Python Bindings**: Easily installable as a Python package, making OpenCV available for use in your Python projects.

## Installation

Ensure that you have `FFmpeg` and `GStreamer` installed on your system. You can install them on Ubuntu using:

```bash
sudo apt update
sudo apt install -y libavcodec-dev libavformat-dev libswscale-dev \\
                    gstreamer1.0-tools libgstreamer-plugins-base1.0-dev \\
                    libgstreamer1.0-dev

Installing the Package
You can install the custom OpenCV package directly using pip:

pip install opencv-ffmpeg-gstreamer


System Requirements
Python: Version 3.6 or higher
Linux: Compatible with many manylinux-compatible distributions
Libraries: FFmpeg and GStreamer libraries must be installed on the system for full functionality


Usage
After installation, you can use OpenCV with Python just like the standard OpenCV package. Here is an example to get you started:

import cv2

# Print OpenCV version
print("OpenCV Version:", cv2.__version__)

# Load and display an image using OpenCV
image = cv2.imread('sample.jpg')
if image is not None:
    cv2.imshow('Sample Image', image)
    cv2.waitKey(0)
    cv2.destroyAllWindows()
else:
    print("Image not found. Make sure 'sample.jpg' is in the current directory.")


Verifying FFmpeg and GStreamer Support
To confirm that FFmpeg and GStreamer are enabled in your OpenCV build, run the following:

import cv2
print(cv2.getBuildInformation())

In the output, look for the following entries:

FFMPEG: YES - Confirms that FFmpeg support is enabled.
GStreamer: YES - Confirms that GStreamer support is enabled.

Example: Capturing Video from a Webcam
Here’s a quick example of using OpenCV to capture video from a webcam:

import cv2

# Open a connection to the webcam (0 is the default camera)
cap = cv2.VideoCapture(0)

if not cap.isOpened():
    print("Error: Could not open video device.")
    exit()

while True:
    # Capture frame-by-frame
    ret, frame = cap.read()
    if not ret:
        break

    # Display the resulting frame
    cv2.imshow('Webcam Feed', frame)

    # Press 'q' to exit the loop
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# Release the capture and close the windows
cap.release()
cv2.destroyAllWindows()


License
This project is licensed under the MIT License. See the LICENSE file for more information.

Author
Heramb Mishra

For any questions or feedback, you can reach me at heramb1008@gmail.com. """

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/herambgvd/opencv-ffmpeg-gstreamer",
    "name": "opencv-ffmpeg-gstreamer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Heramb Mishra",
    "author_email": "heramb1008@gmail.com",
    "download_url": null,
    "platform": null,
    "description": "# OpenCV with FFmpeg and GStreamer Support\n\nThis project provides a custom build of OpenCV with support for FFmpeg and GStreamer, enabling enhanced video and image processing capabilities. It\u2019s packaged as a Python wheel for easy installation and compatibility across different projects.\n\n## Features\n- **FFmpeg Integration**: Enables advanced video processing, encoding, and decoding.\n- **GStreamer Integration**: Provides support for flexible multimedia pipelines and video processing tasks.\n- **Python Bindings**: Easily installable as a Python package, making OpenCV available for use in your Python projects.\n\n## Installation\n\nEnsure that you have `FFmpeg` and `GStreamer` installed on your system. You can install them on Ubuntu using:\n\n```bash\nsudo apt update\nsudo apt install -y libavcodec-dev libavformat-dev libswscale-dev \\\\\n                    gstreamer1.0-tools libgstreamer-plugins-base1.0-dev \\\\\n                    libgstreamer1.0-dev\n\nInstalling the Package\nYou can install the custom OpenCV package directly using pip:\n\npip install opencv-ffmpeg-gstreamer\n\n\nSystem Requirements\nPython: Version 3.6 or higher\nLinux: Compatible with many manylinux-compatible distributions\nLibraries: FFmpeg and GStreamer libraries must be installed on the system for full functionality\n\n\nUsage\nAfter installation, you can use OpenCV with Python just like the standard OpenCV package. Here is an example to get you started:\n\nimport cv2\n\n# Print OpenCV version\nprint(\"OpenCV Version:\", cv2.__version__)\n\n# Load and display an image using OpenCV\nimage = cv2.imread('sample.jpg')\nif image is not None:\n    cv2.imshow('Sample Image', image)\n    cv2.waitKey(0)\n    cv2.destroyAllWindows()\nelse:\n    print(\"Image not found. Make sure 'sample.jpg' is in the current directory.\")\n\n\nVerifying FFmpeg and GStreamer Support\nTo confirm that FFmpeg and GStreamer are enabled in your OpenCV build, run the following:\n\nimport cv2\nprint(cv2.getBuildInformation())\n\nIn the output, look for the following entries:\n\nFFMPEG: YES - Confirms that FFmpeg support is enabled.\nGStreamer: YES - Confirms that GStreamer support is enabled.\n\nExample: Capturing Video from a Webcam\nHere\u2019s a quick example of using OpenCV to capture video from a webcam:\n\nimport cv2\n\n# Open a connection to the webcam (0 is the default camera)\ncap = cv2.VideoCapture(0)\n\nif not cap.isOpened():\n    print(\"Error: Could not open video device.\")\n    exit()\n\nwhile True:\n    # Capture frame-by-frame\n    ret, frame = cap.read()\n    if not ret:\n        break\n\n    # Display the resulting frame\n    cv2.imshow('Webcam Feed', frame)\n\n    # Press 'q' to exit the loop\n    if cv2.waitKey(1) & 0xFF == ord('q'):\n        break\n\n# Release the capture and close the windows\ncap.release()\ncv2.destroyAllWindows()\n\n\nLicense\nThis project is licensed under the MIT License. See the LICENSE file for more information.\n\nAuthor\nHeramb Mishra\n\nFor any questions or feedback, you can reach me at heramb1008@gmail.com. \"\"\"\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Custom OpenCV build with FFmpeg and GStreamer support",
    "version": "4.5.3",
    "project_urls": {
        "Homepage": "https://github.com/herambgvd/opencv-ffmpeg-gstreamer"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e94d4f288fc11287997c63a4b65872c65e2075df9815f0b10b20d5dbada6f5ed",
                "md5": "f57b7682e263ca1cf3e9b1ccdd3255ae",
                "sha256": "fc56a3cdf078ea7b51b3429aa35b3bda6972af5a6b5ccd2f94747c9df8a9c07e"
            },
            "downloads": -1,
            "filename": "opencv_ffmpeg_gstreamer-4.5.3-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f57b7682e263ca1cf3e9b1ccdd3255ae",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.6",
            "size": 4414,
            "upload_time": "2024-11-07T07:51:33",
            "upload_time_iso_8601": "2024-11-07T07:51:33.779212Z",
            "url": "https://files.pythonhosted.org/packages/e9/4d/4f288fc11287997c63a4b65872c65e2075df9815f0b10b20d5dbada6f5ed/opencv_ffmpeg_gstreamer-4.5.3-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-07 07:51:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "herambgvd",
    "github_project": "opencv-ffmpeg-gstreamer",
    "github_not_found": true,
    "lcname": "opencv-ffmpeg-gstreamer"
}
        
Elapsed time: 0.35574s