1

I have a SAA7134 TV card. I want to record a video with sound using Gstreamer. This command I use to make sure I can hear the audio and it works

gst-launch-1.0 alsasrc device="hw:1,0" ! queue ! audioconvert ! alsasink

This command proves that I can watch the video (also works fine)

gst-launch-1.0 v4l2src device=/dev/video0 ! xvimagesink

This command works fine and allows me to write the sound to a file

gst-launch-1.0 alsasrc device="hw:1,0" ! queue ! audioconvert ! wavenc ! filesink location=/home/out/testout.wav

But this command only writes the video without any sound

gst-launch-1.0 v4l2src device=/dev/video0 ! queue ! videoconvert ! jpegenc ! mux. alsasrc device="hw:1,0" ! queue ! audioconvert ! lamemp3enc bitrate=192 ! mux. avimux name=mux ! filesink location=/home/out/testout.avi

the same for

gst-launch-1.0 v4l2src device=/dev/video0 ! queue ! videoconvert ! theoraenc ! mux. alsasrc device="hw:1,0" ! queue ! audioconvert ! vorbisenc ! mux. oggmux name=mux ! filesink location=/home/out/testout.ogg

How to solve the problem? Thank you.

P.S. I use Ubuntu 16.04.3 LTS.

alexanderk409
  • 138
  • 1
  • 12

1 Answers1

0

It looks like I missed one important detail about using gst-launch syntax. I took a better look and found this:

The -e option forces EOS on sources before shutting the pipeline down. This is useful when we write to files and want to shut down by killing gst-launch using CTRL+C or with the kill command

When I tested this option I finally got both the video and audio.

alexanderk409
  • 138
  • 1
  • 12