无法使用Gstreamer从电视卡录制视频和声音



我有一张SAA7134电视卡。我想使用 Gstreamer 录制有声视频。我使用此命令来确保我可以听到音频并且它可以工作

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

此命令证明我可以观看视频(也可以正常工作(

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

此命令工作正常,并允许我将声音写入文件

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

但是此命令仅写入没有任何声音的视频

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

同样适用于

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

如何解决问题?谢谢。

附言我使用 Ubuntu 16.04.3 LTS。

看起来我错过了一个关于使用 gst 启动语法的重要细节。我仔细看了一下,发现这个:

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

当我测试此选项时,我终于得到了视频和音频。

最新更新