From owner-freebsd-questions@freebsd.org Wed Jul 25 06:02:57 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE88D103FDC0 for ; Wed, 25 Jul 2018 06:02:57 +0000 (UTC) (envelope-from Olivier.Nicole@cs.ait.ac.th) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 79B667133C for ; Wed, 25 Jul 2018 06:02:57 +0000 (UTC) (envelope-from Olivier.Nicole@cs.ait.ac.th) Received: by mailman.ysv.freebsd.org (Postfix) id 3EE9F103FDBF; Wed, 25 Jul 2018 06:02:57 +0000 (UTC) Delivered-To: questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DA7F103FDBC for ; Wed, 25 Jul 2018 06:02:57 +0000 (UTC) (envelope-from Olivier.Nicole@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD277133B for ; Wed, 25 Jul 2018 06:02:55 +0000 (UTC) (envelope-from Olivier.Nicole@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (localhost [127.0.0.1]) by mail.cs.ait.ac.th (Postfix) with ESMTP id B25A561F85 for ; Wed, 25 Jul 2018 13:02:38 +0700 (+07) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cs.ait.ac.th; h= content-type:content-type:mime-version:message-id:date:date :subject:subject:from:from:received:received:received; s= selector1; t=1532498558; x=1534312959; bh=0HIE+iMJQE1OKn+ZcErUt2 dy2C4A+atkyAA4fhwLuCM=; b=df7PJ2fIe8xqC4PdKDTYr4gRozyHu2GJCvcl5R JFJ6UItrzc3cbXi7xQXexwwvFGlSFPY1OgPwbZB20QQRmc0JsyuH+YxuEJIemczm DwRuxR7FJ501VYCalzLU344TkCIjlUpyl3K49zADQyfjdNaHGva07BOkID69lHum c3HqQ= X-Virus-Scanned: amavisd-new at cs.ait.ac.th Received: from mail.cs.ait.ac.th ([127.0.0.1]) by mail.cs.ait.ac.th (mail.cs.ait.ac.th [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id XVj03jMVuvi6 for ; Wed, 25 Jul 2018 13:02:38 +0700 (+07) Received: from banyan.cs.ait.ac.th (banyan.cs.ait.ac.th [192.41.170.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.cs.ait.ac.th (Postfix) with ESMTPS id 13FA361F82 for ; Wed, 25 Jul 2018 13:02:37 +0700 (+07) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.15.2/8.15.2/Submit) id w6P62bbS006328; Wed, 25 Jul 2018 13:02:37 +0700 (ICT) (envelope-from on@banyan.cs.ait.ac.th) From: Olivier To: questions@freebsd.org Subject: Grabbing webcam to video on the web Date: Wed, 25 Jul 2018 13:02:36 +0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2018 06:02:58 -0000 Hi, I am trying to write an application that will grab a video from a (cheap) USB camera (/dev/video0) and transform it into a format that can be embded on a web page. - memcoder used to work and produce an .avi file, but they are not recognized anymore by modern web browsers; and mencoder is a beast; - ffmpeg is producing a valid .mp4 file, but it is slow to start; sudo nice -20 /usr/local/bin/ffmpeg -y -r 5 -f v4l2 -video_size 640x480 -i /dev/video0 -r 5 test.mp4 Is there in the ports something else I could use? Or a way to make ffmpeg start faster? Ny problem is that the video are always very short, a couple of seconds each, just enough for someone to pass throufg a door. One ideal solution would be something that runs all the time in th background and that would receive signals telling the application it should start to recording instead of dropping the packets. Thanks in advance, Olivier --