From owner-freebsd-questions@FreeBSD.ORG Mon Aug 18 11:02:38 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA315D96 for ; Mon, 18 Aug 2014 11:02:38 +0000 (UTC) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADBBD38A6 for ; Mon, 18 Aug 2014 11:02:38 +0000 (UTC) Received: from r56.edvax.de (port-92-195-111-1.dynamic.qsc.de [92.195.111.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id 1BC36248C6 for ; Mon, 18 Aug 2014 13:02:30 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id s7IB2Tlj002028 for ; Mon, 18 Aug 2014 13:02:29 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Mon, 18 Aug 2014 13:02:29 +0200 From: Polytropon To: FreeBSD Questions Subject: Time code and hourly files with mencoder Message-Id: <20140818130229.80e2e06e.freebsd@edvax.de> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Aug 2014 11:02:39 -0000 The following complex of questions primarily aims at those participants of the questions list who have experience with mplayer, mencoder, and state security. ;-) I'm searching for some input regarding a FreeBSD-based surveillance project. The basic setting: a PC-type system equipped with a Hauppauge / BrookTree PCI TV card (with excellent support) connected to a video source (camera attached to "video in" cinch connector), and a sound card (onboard version) connected to a microphone. The computer has sufficient power (Intel Core2, 2 GB RAM, nVidia GPU). Designated software: mencoder. There will be no external signals, instead the recording will be started once, and then continue until ^C. I've done this in the past, but I'd like some fresh ideas and new input, especially because there are obstacles which I haven't encountered (and therefore solved) yet. What I need: 1. TC In a corner (for example top right) there should be a time code with a precision of one second, like this: 2014-08-18 12:50:32 The video source cannot supply it. It doesn't have to be a high quality font. If it looks like a 7 segment display, it's fully sufficient. More than date and time is not needed. How can this be added to the video "on the fly", during creation? 2. File separation For easier postprocessing, I need one file per hour of the day (24 files for one day) and a directory for each day, like this: 2014-08-16/ 2014-08-17/ 2014-08-18/ 2014-08-18_00.avi 2014-08-18_01.avi 2014-08-18_02.avi ... 2014-08-18_12.avi 2014-08-18_13.avi 2014-08-18_14.avi (contains 14:00:00 - 14:59:59) 2014-08-18_15.avi ... 2014-08-18_23.avi 2014-08-19/ 2014-08-20/ How is this to be implemented? How would you start mencoder every hour for one hour? What is the optimal way to keep track of the time in the controlling shell script? 3. File format The videos don't need to be high quality. 800x600 or the like would be sufficient (even less is okay). The audio also doesn't need to be HiFi. MP3 or maybe even GSM codecs are sufficient. What encoding options do you recommend? Comments and suggestions are highly welcome! -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...