From owner-freebsd-ports@freebsd.org Sat Dec 5 03:12:23 2020 Return-Path: Delivered-To: freebsd-ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B566A4B33FB for ; Sat, 5 Dec 2020 03:12:23 +0000 (UTC) (envelope-from anatoly@kazanfieldhockey.ru) Received: from kazanfieldhockey.ru (kazanfieldhockey.ru [78.138.152.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "kazanfieldhockey.ru", Issuer "System Administrator" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cnvkt51mwz4d7p for ; Sat, 5 Dec 2020 03:12:22 +0000 (UTC) (envelope-from anatoly@kazanfieldhockey.ru) Received: from asd2 (host-175-22.static.telecet.ru [87.117.175.22]) (authenticated bits=0) by kazanfieldhockey.ru (8.15.2/8.15.2) with ESMTPSA id 0B52k5Fo014037 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 5 Dec 2020 05:46:07 +0300 (MSK) (envelope-from anatoly@kazanfieldhockey.ru) Date: Sat, 5 Dec 2020 06:12:35 +0300 From: Anatoly To: freebsd-ports@freebsd.org Subject: Re: replacing ffserver? Message-ID: <20201205061235.6d847252@asd2> In-Reply-To: <24522.44593.292701.122459@jerusalem.litteratus.org> References: <24521.30595.80033.88955@jerusalem.litteratus.org> <24521.46760.296586.537444@jerusalem.litteratus.org> <20201204075132.7fd3fee4@asd2> <24522.44593.292701.122459@jerusalem.litteratus.org> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; amd64-portbld-freebsd10.2) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (kazanfieldhockey.ru [192.168.13.2]); Sat, 05 Dec 2020 05:46:07 +0300 (MSK) X-Rspamd-Queue-Id: 4Cnvkt51mwz4d7p X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of anatoly@kazanfieldhockey.ru has no SPF policy when checking 78.138.152.250) smtp.mailfrom=anatoly@kazanfieldhockey.ru X-Spamd-Result: default: False [1.11 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[78.138.152.250:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[78.138.152.250:from:127.0.2.255]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_SPAM_SHORT(0.71)[0.713]; DMARC_NA(0.00)[kazanfieldhockey.ru]; ARC_NA(0.00)[]; R_SPF_NA(0.00)[no SPF record]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:28840, ipnet:78.138.144.0/20, country:RU]; MAILMAN_DEST(0.00)[freebsd-ports] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2020 03:12:23 -0000 On Fri, 4 Dec 2020 16:46:25 -0500 Robert Huff wrote: > Let me restate the issue. > My goal is to be able to have someone visit (e.g.) > "https://webcam.example.com:9999" and have the feed from the webcam > appear in their browser. > What I have at the moment: > > a) a system running: > > FreeBSD 13.0-CURRENT #0 r365372: Sun Sep 6 10:51:26 EDT 2020 amd64 > > b) a working webcam > c) the latest version of webcamd, which finds the webcam and > creates video0 and video1. > > So: I need to make the contents of video0 available on port > 9999. I have been unable to find a concise current method for how to > do that. (Including anything with Apache, which seems like an obvious > step.) > > > Respectfully, > > > Robert Huff > Again, simplest thing to try is multimedia/vlc. In that setup browser will pull and play single "endless video file" from server. Web server is vlc built-in. Fo this to work vlc must be built from port with options set [X] VORBIS [X] VPX Start from GUIMenu: Media->Capture Device->(choose your device). Choose "Stream". Tick "display lically" to be able to preview camera image in vlc vindow. Next -> HTTP -> Add Check/enter listening port number and url Next -> choose "VP80 + Vorbis (webm)" Write down generated command line transcoding parameters. Press "Stream" and point web broeser to ip:port/url See if it works or not. Do some adjustments, try again (turn off sound encoding? scale? fps? bitrate?) When everything is ok, start it without GUI (cvlc) with transcoding parameters you wrote previously. There is need to add input and output specification to command line however. So it may be look like cvlc -vvv "v4l2:///dev/video1" --sout "#transcode{vcodec=VP80,vb=800,acodec=none}:std{access=http,mux=webm,dst=0.0.0.0:8080}" I streamed webcamera 24/7 on the wild internet for a 6 months in 2012 similar way. I've used not webm/Vp8, but asf/msmpeg4, support of which was abandoned in all browsers somwere around 2014. So streaming today as I've done that is impossible. Again, other way is to use HLS. This should be more compatible, but more complex. I never tryied this myself, so can't give ready receipe. But Google returns some if I searching "ffmpeg HLS apache" "ffmpeg HLS nginx". For ex. first of them https://www.bogotobogo.com/VideoStreaming/ffmpeg_http_live_streaming_hls.php Idea behing that is ffmpeg will capture video and compress to h264, packing it into "mpegts" container, writing many short *.ts files into web directory, from where web server serves it. Also ffmpeg updates single "playlist m3u8" file there. Web browser (java script on page) pulls "playlist" and plays files one by one as new files appear. Old may be deleted. I think there's no OS specific except ffmpeg must be built with [X] X264 or [X] OPENH264 or both -c:v openh264 is way faster than -c:v libx264, but may be somehow more glitchy.