{"id":13419874,"url":"https://github.com/mpromonet/v4l2rtspserver","last_synced_at":"2025-12-17T00:05:43.521Z","repository":{"id":11739769,"uuid":"14266930","full_name":"mpromonet/v4l2rtspserver","owner":"mpromonet","description":"RTSP Server for V4L2 device capture supporting HEVC/H264/JPEG/VP8/VP9","archived":false,"fork":false,"pushed_at":"2024-12-29T14:35:13.000Z","size":1054,"stargazers_count":1924,"open_issues_count":54,"forks_count":432,"subscribers_count":89,"default_branch":"master","last_synced_at":"2025-04-11T01:41:46.532Z","etag":null,"topics":["c-plus-plus","hls","mpeg-dash","rtsp","rtsp-server","v4l2","v4l2-device"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpromonet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-09T23:08:44.000Z","updated_at":"2025-04-10T08:19:11.000Z","dependencies_parsed_at":"2023-11-19T15:27:15.204Z","dependency_job_id":"d141f25d-90ce-4fce-8bbe-4662b67d96c5","html_url":"https://github.com/mpromonet/v4l2rtspserver","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpromonet%2Fv4l2rtspserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpromonet%2Fv4l2rtspserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpromonet%2Fv4l2rtspserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpromonet%2Fv4l2rtspserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpromonet","download_url":"https://codeload.github.com/mpromonet/v4l2rtspserver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254079960,"owners_count":22011297,"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":["c-plus-plus","hls","mpeg-dash","rtsp","rtsp-server","v4l2","v4l2-device"],"created_at":"2024-07-30T22:01:22.216Z","updated_at":"2025-12-17T00:05:43.308Z","avatar_url":"https://github.com/mpromonet.png","language":"C++","funding_links":[],"categories":["TODO scan for Android support in followings","Generic software","\u003ca name=\"cpp\"\u003e\u003c/a\u003eC++","C++","HarmonyOS"],"sub_categories":["Video Streaming","Windows Manager"],"readme":"[![CircleCI](https://circleci.com/gh/mpromonet/v4l2rtspserver.svg?style=shield)](https://circleci.com/gh/mpromonet/v4l2rtspserver)\n[![CirusCI](https://api.cirrus-ci.com/github/mpromonet/v4l2rtspserver.svg?branch=master)](https://cirrus-ci.com/github/mpromonet/v4l2rtspserver)\n[![Snap Status](https://snapcraft.io//v4l2-rtspserver/badge.svg)](https://snapcraft.io/v4l2-rtspserver)\n[![GithubCI](https://github.com/mpromonet/v4l2rtspserver/workflows/C/C++%20CI/badge.svg)](https://github.com/mpromonet/v4l2rtspserver/actions)\n\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/4602f447d1c1408d865ebb4ef68f12f1)](https://app.codacy.com/gh/mpromonet/v4l2rtspserver/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![Coverity Scan Build Status](https://scan.coverity.com/projects/4644/badge.svg)](https://scan.coverity.com/projects/4644)\n[![Coverage Status](https://coveralls.io/repos/github/mpromonet/v4l2rtspserver/badge.svg?branch=master)](https://coveralls.io/github/mpromonet/v4l2rtspserver?branch=master)\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8853/badge)](https://www.bestpractices.dev/projects/8853)\n\n[![Release](https://img.shields.io/github/release/mpromonet/v4l2rtspserver.svg)](https://github.com/mpromonet/v4l2rtspserver/releases/latest)\n[![Download](https://img.shields.io/github/downloads/mpromonet/v4l2rtspserver/total.svg)](https://github.com/mpromonet/v4l2rtspserver/releases/latest)\n[![Docker Pulls](https://img.shields.io/docker/pulls/mpromonet/v4l2rtspserver.svg)](https://hub.docker.com/r/mpromonet/v4l2rtspserver/)\n[![Openwrt](https://img.shields.io/badge/OpenWRT-00B5E2?logo=OpenWrt)](https://openwrt.org/packages/pkgdata/v4l2rtspserver)\n\nv4l2rtspserver\n====================\n\nThis is an streamer feed from :\n - an Video4Linux device that support H264, HEVC, JPEG, VP8 or VP9 capture.\n - an ALSA device that support PCM S16_BE, S16_LE, S32_BE or S32_LE\n \nThe RTSP server support :\n- RTP/UDP unicast\n- RTP/UDP multicast\n- RTP/TCP\n- RTP/RTSP/HTTP\n\nThe HTTP server support (available using -S option for capture format that could be muxed in Transport Stream):\n- HLS\n- MPEG-DASH\n\nDependencies\n------------\n - liblivemedia-dev [License LGPL](http://www.live555.com/liveMedia/) \u003e live.2012.01.07 (need StreamReplicator)\n - libv4l2cpp [Unlicense](https://github.com/mpromonet/libv4l2cpp/blob/master/LICENSE)\n - liblog4cpp5-dev  [License LGPL](http://log4cpp.sourceforge.net/#license) (optional)\nIf liblog4cpp5-dev is not present, a simple log using std::cout is used.\n - libasound2-dev Licence LGPL (optional)\nIf libasound2-dev is not present in the build environment, there will have no audio support.\n - libssl-dev (optional)\nIf libssl-dev is not present rtsps/srtp will not be available\n\nUsage\n-----\n\t./v4l2rtspserver [-v[v]] [-Q queueSize] [-O file] \\\n\t\t\t       [-I interface] [-P RTSP port] [-p RTSP/HTTP port] [-m multicast url] [-u unicast url] [-M multicast addr] [-c] [-t timeout] \\\n\t\t\t       [-r] [-s] [-W width] [-H height] [-F fps] [device1] [device2]\n\t\t -v       : verbose\n\t\t -vv      : very verbose\n\t\t -Q length: Number of frame queue  (default 10)\n\t\t -O output: Copy captured frame to a file or a V4L2 device\n\t\t \n\t\t RTSP options :\n\t\t -I addr  : RTSP interface (default autodetect)\n\t\t -P port  : RTSP port (default 8554)\n\t\t -p port  : RTSP over HTTP port (default 0)\n\t\t -U user:password : RTSP user and password\n\t\t -R realm  : use md5 password 'md5(\u003cusername\u003e:\u003crealm\u003e:\u003cpassword\u003e')\n\t\t -u url   : unicast url (default unicast)\n\t\t -m url   : multicast url (default multicast)\n\t\t -M addr  : multicast group:port (default is random_address:20000)\n\t\t -c       : don't repeat config (default repeat config before IDR frame)\n\t\t -t secs  : RTCP expiration timeout (default 65)\n\t\t -S[secs] : HTTP segment duration (enable HLS \u0026 MPEG-DASH)\n\t\t -x \u003csslkeycert\u003e  : enable SRTP\n\t\t -X               : enable RSTPS\n \n\t\t V4L2 options :\n\t\t -r       : V4L2 capture using read interface (default use memory mapped buffers)\n\t\t -w       : V4L2 capture using write interface (default use memory mapped buffers)\n\t\t -B       : V4L2 capture using blocking mode (default use non-blocking mode)\n\t\t -s       : V4L2 capture using live555 mainloop (default use a separated reading thread)\n\t\t -f       : V4L2 capture using current capture format (-W,-H are ignored)\n\t\t -fformat : V4L2 capture using format (-W,-H are used)\n\t\t -W width : V4L2 capture width (default 640)\n\t\t -H height: V4L2 capture height (default 480)\n\t\t -F fps   : V4L2 capture framerate (default 25, 0 disable setting framerate)\n\t\t -G \u003cw\u003ex\u003ch\u003e[x\u003cf\u003e] : V4L2 capture format (default 0x0x25)\n\t\t \n\t\t ALSA options :\n\t\t -A freq    : ALSA capture frequency and channel (default 44100)\n\t\t -C channels: ALSA capture channels (default 2)\n\t\t -a fmt     : ALSA capture audio format (default S16_LE)\n\t\t \n\t\t device   : V4L2 capture device and/or ALSA device (default /dev/video0)\n\nWhen audio support is not present, ALSA options are not printed running with `-h` argument.\n\nAuthentification is enable when almost one user is defined. You can configure credentials :\n * using plain text password: \n \n       -U foo:bar -U admin:admin\n * using md5 password: \n \n       -R myrealm -U foo:$(echo -n foo:myrealm:bar | md5sum | cut -d- -f1) -U admin:$(echo -n admin:myrealm:admin | md5sum | cut -d- -f1)\n\nIt is possible to compose the RTSP session is different ways :\n * v4l2rtspserver /dev/video0              : one RTSP session with RTP video capturing V4L2 device /dev/video0\n * v4l2rtspserver ,default                 : one RTSP session with RTP audio capturing ALSA device default\n * v4l2rtspserver /dev/video0,default      : one RTSP session with RTP audio and RTP video\n * v4l2rtspserver /dev/video0 ,default     : two RTSP sessions first one with RTP video and second one with RTP audio\n * v4l2rtspserver /dev/video0 /dev/video1  : two RTSP sessions with an RTP video\n * v4l2rtspserver /dev/video0,/dev/video0  : one RTSP session with RTP audio and RTP video (ALSA device associatd with the V4L2 device)\n\nBuild\n------- \n- Build  \n\n\t\tcmake . \u0026\u0026 make\n\n\tIf live555 is not installed it will download it from live555.com and compile it. If asound is not installed, ALSA will be disabled.  \n\tIf it still not work you will need to read Makefile.  \n\n- Install (optional) \n\n\t\tsudo make install\n\n- Packaging  (optional)\n\n\t\tcpack .\n\nUsing Raspberry Pi Camera\n------------------------- \nThis RTSP server works with Raspberry Pi camera using :\n- the opensource V4L2 driver bcm2835-v4l2\n\n\tsudo modprobe -v bcm2835-v4l2\n\t\n\nUsing v4l2loopback\n----------------------- \nFor camera providing uncompress format [v4l2tools](https://github.com/mpromonet/v4l2tools) can compress the video to an intermediate virtual V4L2 device [v4l2loopback](https://github.com/umlaeute/v4l2loopback):\n\n\t/dev/video0 (camera device)-\u003e v4l2compress -\u003e /dev/video10 (v4l2loopback device) -\u003e v4l2rtspserver\n\nThis workflow could be set using :\n\n\tmodprobe v4l2loopback video_nr=10\n\tv4l2compress -fH264 /dev/video0 /dev/video10 \u0026\n\tv4l2rtspserver /dev/video10 \u0026\n\n\nPlaying HTTP streams\n-----------------------\nWhen v4l2rtspserver is started with '-S' arguments it also give access to streams through HTTP.  \nThese streams could be played :\n\n\t* for MPEG-DASH with :   \n           MP4Client http://..../unicast.mpd   \n\t   \n\t* for HLS with :  \n           vlc http://..../unicast.m3u8  \n           gstreamer-launch-1.0 playbin uri=http://.../unicast.m3u8  \n\nIt is now possible to play HLS url directly from browser :\n\n * using Firefox installing [Native HLS addons](https://addons.mozilla.org/en-US/firefox/addon/native_hls_playback)\n * using Chrome installing [Native HLS playback](https://chrome.google.com/webstore/detail/native-hls-playback/emnphkkblegpebimobpbekeedfgemhof)\n\nThere is also a small HTML page that use hls.js.\n\nUsing Docker image\n===============\nYou can start the application using the docker image :\n\n        docker run -p 8554:8554 -it mpromonet/v4l2rtspserver\n\nYou can expose V4L2 devices from your host using :\n\n        docker run --device=/dev/video0 -p 8554:8554 -it mpromonet/v4l2rtspserver\n\nThe container entry point is the v4l2rtspserver application, then you can :\n\n* get the help using :\n\n        docker run -it mpromonet/v4l2rtspserver -h\n\n* run the container specifying some paramters :\n\n        docker run --device=/dev/video0 -p 8554:8554 -it mpromonet/v4l2rtspserver -u \"\" -H640 -W480 \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpromonet%2Fv4l2rtspserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpromonet%2Fv4l2rtspserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpromonet%2Fv4l2rtspserver/lists"}