{"id":13438286,"url":"https://github.com/andreanobile/opencv_ffmpeg_streaming","last_synced_at":"2025-03-19T18:32:37.661Z","repository":{"id":54414913,"uuid":"154733719","full_name":"andreanobile/opencv_ffmpeg_streaming","owner":"andreanobile","description":"rtmp streaming from opencv with ffmpeg / avcodec using C++ or Python","archived":false,"fork":false,"pushed_at":"2023-02-11T19:16:55.000Z","size":70,"stargazers_count":182,"open_issues_count":7,"forks_count":45,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-27T23:25:27.397Z","etag":null,"topics":["avcodec","ffmpeg","h264","h265","opencv","opencv-ffmpeg-streaming","python","rtmp","rtmp-stream","streaming","video-streaming"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreanobile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-10-25T20:31:40.000Z","updated_at":"2024-10-22T08:26:28.000Z","dependencies_parsed_at":"2024-01-15T00:13:02.568Z","dependency_job_id":"64ff9264-5636-4b62-afdb-beec6e8f6895","html_url":"https://github.com/andreanobile/opencv_ffmpeg_streaming","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreanobile%2Fopencv_ffmpeg_streaming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreanobile%2Fopencv_ffmpeg_streaming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreanobile%2Fopencv_ffmpeg_streaming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreanobile%2Fopencv_ffmpeg_streaming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreanobile","download_url":"https://codeload.github.com/andreanobile/opencv_ffmpeg_streaming/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244483642,"owners_count":20460155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avcodec","ffmpeg","h264","h265","opencv","opencv-ffmpeg-streaming","python","rtmp","rtmp-stream","streaming","video-streaming"],"created_at":"2024-07-31T03:01:04.272Z","updated_at":"2025-03-19T18:32:37.364Z","avatar_url":"https://github.com/andreanobile.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# opencv_ffmpeg_streaming\nrtmp streaming from opencv with ffmpeg / avcodec\n\nUsing ffmpeg libraries from C/C++ is tricky and I could not easily find easy examples without memory leaks or bad crashes that used OpenCV as input or for image processing.\nThis is an example for using the ffmpeg and opencv libraries from C++ for rtmp streaming. \nThe input is from the OpenCV VideoCapture class.\nTo build Release:\n```\n$ mkdir build\n$ cd build\n$ cmake -DCMAKE_BUILD_TYPE=Release ..\n$ make\n```\n\nTo build Debug:\n```\n$ mkdir build\n$ cd build\n$ cmake -DCMAKE_BUILD_TYPE=Debug ..\n$ make\n```\nIn main.cpp the stream url is defined as \"rtmp://localhost/live/mystream\" and must be adapted to your rtmp server settings\n\nRun the program on a video:\n```\n$ ./build/simple_opencv_streaming \u003cvideo_file\u003e\n```\nFrom camera\n```\n$ ./build/simple_opencv_streaming 0\n```\n\nTo convert the rtmp stream to HLS and publish the stream to a browser I have written a tutorial on  \u003ca href=\"https://www.nobile-engineering.com/wordpress/index.php/2018/10/30/video-streaming-hls-apache-nginx/\"\u003e a blog post \u003c/a\u003e \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreanobile%2Fopencv_ffmpeg_streaming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreanobile%2Fopencv_ffmpeg_streaming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreanobile%2Fopencv_ffmpeg_streaming/lists"}