1

我有一张 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

如何解决问题?谢谢你。

PS 我使用 Ubuntu 16.04.3 LTS。

4

1 回答 1

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

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

于 2017-08-11T19:05:21.860 回答