2017-08-11 65 views
0

我有一张SAA7134电视卡。我想用Gstreamer录制带有声音的视频。这个命令我使用,以确保我能听到的声音和它的作品使用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 

如何解决这个问题?谢谢。

P.S.我使用Ubuntu 16.04.3 LTS。

回答

0

看起来我错过了关于使用gst-launch语法的一个重要细节。我看了一遍,发现这个:

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 

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

相关问题