<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Bitstream Vera Sans Mono">Edgard,<br>
<br>
Testing with the following command (very slightly modified from your
suggestion):<br>
<br>
gst-launch-0.10 v4l2src ! ffmpegcolorspace !
video/x-raw-yuv,format=\(fourcc\)I420,width=800,height=600,framerate=15/1
! tee name=t ! queue2 ! timeoverlay ! theoraenc ! oggmux name=mux !
filesink location=1.ogg alsasrc ! queue2 ! audioconvert ! vorbisenc !
mux. t. ! queue leaky=2 ! videoscale ! xvimagesink sync=false<br>
<br>
Produced the following behavior:<br>
<br>
1. A display window was opened, showing a static (single frame) of
output from the video camera.<br>
2. The initial output from gst-launch was:<br>
<br>
Setting pipeline to PAUSED ...<br>
Pipeline is live and does not need PREROLL ...<br>
Setting pipeline to PLAYING ...<br>
New clock: GstAudioSrcClock<br>
<br>
3. After waiting a while, I pressed Ctrl-C:<br>
<br>
Caught interrupt -- handling interrupt.<br>
Interrupt: Setting pipeline to PAUSED ...<br>
Execution ended after 6333893000 ns.<br>
Setting pipeline to PAUSED ...<br>
Setting pipeline to READY ...<br>
<br>
4. After a little while longer, I pressed Ctrl-C again.<br>
<br>
5. The output file '1.ogg' was zero bytes.<br>
<br>
Would this indicates that the 'tee' element is not quite configured
correct? I've never used that before...<br>
<br>
-jason<br>
</font><br>
Edgard Lima wrote:
<blockquote cite="mid:47D00087.3070602@indt.org.br" type="cite">
  <pre wrap="">Hi,

nice your blog

<a class="moz-txt-link-freetext" href="http://www.buberel.org/serendipity/">http://www.buberel.org/serendipity/</a>

and nice

<a class="moz-txt-link-freetext" href="http://gentrans.sourceforge.net/">http://gentrans.sourceforge.net/</a>

project

But I think, unfortunately, it doesn't help for something more robust
and professional.

In case of your pipeline:

gst-launch-0.10  v4l2src queue-size=16 !  stamp sync-margin=1
sync-interval=1
    ! video/x-raw-yuv,width=800,height=600,framerate=15/1
    ! queue2 max-size-buffers=1000 max-size-bytes=0 max-size-time=0  !
ffmpegcolorspace
    ! theoraenc quality=60 name=venc  alsasrc device="hw:1,0"
    !  audio/x-raw-int,rate=16000,channels=1,depth=16
    !  audioconvert ! queue2 max-size-buffers=1000 max-size-bytes=0
max-size-time=0
    !  vorbisenc quality=0.9 name=aenc oggmux name=mux ! filesink
location=test.ogg aenc. ! mux. venc. ! mux

Considering you have 100% CPU usage, what happens is that you are
delaying the problem a bit by using a large queue (1000) and again
delaying the problem a bit with "stamp" element

Please try with the following pipeline:

gst-launch-0.10 v4l2src ! ffmpegcolorspace ! video/x-raw-yuv,
format=\(fourcc\)I420, width=640, height=480 ! tee name=t ! queue2 !
timeoverlay ! theoraenc ! oggmux name=mux ! filesink location=1.ogg
alsasrc ! queue2 ! audioconvert ! vorbisenc ! mux. t. ! queue leaky=2 !
videoscale ! xvimagesink sync=false

Then try change the resolution to the one your camera accept
(width=800,height=600,framerate=15/1) and see if you can remove
ffmpegcolorspace and videoscale

if you don't have 100% you will have best result.

if you have 100% then try to increase the queue size (or also use stamp)
so it would be ok to make short videos (as you already did).

- - - - - - - - - - - - - - - - - --

Now I would like discuss what would be the best way to record audio and
video in 100% cpu case.

if I use

gst-launch-0.10 v4l2src ! ffmpegcolorspace ! video/x-raw-yuv,
format=\(fourcc\)I420, width=1280, height=960 ! tee name=t ! queue2 !
timeoverlay ! theoraenc ! oggmux name=mux ! filesink location=1.ogg
alsasrc ! queue2 ! audioconvert ! vorbisenc ! mux. t. ! queue leaky=2 !
videoscale ! xvimagesink sync=false

then my file isn't recorded properly (Can't record audio fast
enough...this discontinuity breaks the recording)

BUT

gst-launch-0.10 v4l2src ! ffmpegcolorspace ! video/x-raw-yuv,
format=\(fourcc\)I420, width=1280, height=960 ! tee name=t ! queue2 !
timeoverlay ! theoraenc ! oggmux name=mux ! filesink location=1.ogg
alsasrc ! queue2 ! audioconvert ! vorbisenc ! oggmux ! filesink
location=2.ogg  mux. t. ! queue leaky=2 ! videoscale ! xvimagesink
sync=false

Both audio and video file are recorded fine (individually). In addition,
the audio file has duration greater than video file. I think it happens
because of video dropping.

But I think it is close to the best thing that could be done. So what I
would like to do is to give priority to audio as much as possible, and
drop videos, but still having audio and video sync. So, How to do it?

Best Regards,
Edgard




























  </pre>
</blockquote>
</body>
</html>