From: "Canek Peláez Valdés" <caneko@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] [OT} GStreamer: How to view AND record a stream coming from an USB Webcam
Date: Sun, 15 Jun 2014 20:02:35 -0500 [thread overview]
Message-ID: <CADPrc81-vwF+TXc1B1GkH=5fSHQQjVd5B=UHSknQwgfsU2_FmQ@mail.gmail.com> (raw)
In-Reply-To: <CADPrc81mQeOVQkqbO_42vR2Si+98NA29ZU6QRuXoKXQhtfrgyQ@mail.gmail.com>
On Sun, Jun 15, 2014 at 1:04 PM, Canek Peláez Valdés <caneko@gmail.com> wrote:
> On Sun, Jun 15, 2014 at 12:54 PM, <meino.cramer@gmx.de> wrote:
>> Hi,
>>
>> After unsuccessfully trying vlc with a Logitech C920 HD Pro Webcam
>> (over 2 seconds delay between audio and video). I played around
>> with gstreamer and from bits and pieces from the web I build
>> this line:
>>
>> gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-h264,width=1920,height=1080,framerate=30/1 ! \
>> h264parse ! muxout. alsasrc device="hw:3,0" ! queue ! audioconvert ! lamemp3enc ! \
>> muxout. matroskamux name=muxout streamable=true ! filesink location=c920.mp4
>>
>> which records a Full HD video with audio to my harddisc. The delay is
>> minimal and the sync between audio and video is good.
>>
>> But there is one disadvantage:
>> I cannot see what I am recording and I cannot watch the webcams stream
>> before I fire up the script because otherwise the device would be "already
>> in use" (I dont like scripts, which simply kill other applications when
>> called).
>>
>> Any ideas or hints how to manage that?
>
> Use the tee element. I'm in a hurry, so I cannot test a pipeline right
> now, but I will try later. Meanwhile, just try to put a queue element
> after each path of the tee.
>
> gst-inspect-1.0 tee
OK, it took me a bit of an effort, but this is my pipeline:
gst-launch-1.0 v4l2src norm=NTSC device=/dev/video1 ! queue !
deinterlace mode=1 ! videorate !
video/x-raw,format=YV12,width=720,height=480,framerate=30000/1001 !
tee name=t t. ! queue ! videoconvert ! mpeg2enc ! avimux ! filesink
location=file.avi t. ! queue ! videoconvert ! autovideosink
My hardware is much more limited (analog RGB), so resolution and
famerate are accordingly lower. This captures to an AVI file encoded
to MPEG2 the video signal, and at the same time it opens a window to
show the stream.
It should not be that much of a problem to modify it to your needs;
just notice that I didn't capture audio.
Regards.
--
Canek Peláez Valdés
Profesor de asignatura, Facultad de Ciencias
Universidad Nacional Autónoma de México
next prev parent reply other threads:[~2014-06-16 1:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-15 17:54 [gentoo-user] [OT} GStreamer: How to view AND record a stream coming from an USB Webcam meino.cramer
2014-06-15 18:04 ` Canek Peláez Valdés
2014-06-16 1:02 ` Canek Peláez Valdés [this message]
2014-06-16 18:27 ` meino.cramer
2014-06-16 19:34 ` Canek Peláez Valdés
2014-06-16 3:32 ` [gentoo-user] " James
2014-06-16 18:21 ` meino.cramer
2014-06-16 22:24 ` James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADPrc81-vwF+TXc1B1GkH=5fSHQQjVd5B=UHSknQwgfsU2_FmQ@mail.gmail.com' \
--to=caneko@gmail.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox