I would like to capture a video stream (+audio) in MJPEG from my webcam into .mts container using this pipeline:
我想在MJPEG中从我的webcam中截取一个视频流(+音频)到.mts容器中:
gst-launch-1.0 v4l2src do-timestamp=true device=/dev/video0 \ !
'image/jpeg,framerate=30/1,width=1280,height=720' ! videorate \
! queue ! mux2. pulsesrc do-timestamp=true \
device="alsa_input.pci-0000_00_1b.0.analog-stereo" ! \
'audio/x-raw,rate=88200,channels=1,depth=24' ! audioconvert ! \
avenc_aac compliance=experimental ! queue ! \
mux2. mpegtsmux name="mux2" ! filesink location=/home/sina/Webcam.mts
it seems that my pipeline doesn't recognize the mpegtsmux (?) when i use avimux or even matroskamux it works but as far as I know for MPEG-TS I need to use the correct muxer which is "mpegtsmux"
当我使用avimux或matroskamux时,我的管道似乎不认识mpegtsmux(?),但据我所知,对于MPEG-TS,我需要使用正确的muxer,即mpegtsmux。
This is the warning:
这是一个警告:
WARNING: erroneous pipeline: could not link queue0 to mux2
警告:错误管道:不能将queue0链接到mux2。
Can you please tell me what part of my pipeline is wrong? or what shall I change in order to get a timestamped video stream at the end (duration of the video must be shown when I play it via kdenlive or VLC)?
你能告诉我我管道的哪部分是错的吗?或者我应该改变什么,以便在结束时得到一个时间戳的视频流(视频的持续时间必须在我通过kdenlive或VLC播放时显示)?
Best, Sina
最好的,新浪
1 个解决方案
#1
0
I think you are missing some encoder before mux. Just try this without audio(added x264enc):
我想你在mux之前漏掉了一些编码器。试试这个没有音频的(添加x264enc):
gst-launch-1.0 v4l2src device=/dev/video0 ! videorate ! queue ! x264enc ! mpegtsmux name="mux2" mux2. ! filesink location=bla.mts
本文gst -发射- 1.0 v4l2src设备= / dev / video0 !videorate !队列!x264enc !mpegtsmux name = " mux2 " mux2。!filesink位置= bla.mts
The warning you are getting is saying it clearly.. it cannot link mux because the mux does not support capabilities image/jpeg.. just check the Capabilities section of sink pad with command:
你得到的警告说得很清楚。它不能链接mux,因为mux不支持功能图像/jpeg。只需用命令检查sink pad的功能部分:
gst-inspect-1.0 mpegtsmux
mpegtsmux gst -检查- 1.0
But it supports for example video/x-h264 - therefore the need for x264enc
但是它支持示例视频/x-h264,因此需要x264enc。
#1
0
I think you are missing some encoder before mux. Just try this without audio(added x264enc):
我想你在mux之前漏掉了一些编码器。试试这个没有音频的(添加x264enc):
gst-launch-1.0 v4l2src device=/dev/video0 ! videorate ! queue ! x264enc ! mpegtsmux name="mux2" mux2. ! filesink location=bla.mts
本文gst -发射- 1.0 v4l2src设备= / dev / video0 !videorate !队列!x264enc !mpegtsmux name = " mux2 " mux2。!filesink位置= bla.mts
The warning you are getting is saying it clearly.. it cannot link mux because the mux does not support capabilities image/jpeg.. just check the Capabilities section of sink pad with command:
你得到的警告说得很清楚。它不能链接mux,因为mux不支持功能图像/jpeg。只需用命令检查sink pad的功能部分:
gst-inspect-1.0 mpegtsmux
mpegtsmux gst -检查- 1.0
But it supports for example video/x-h264 - therefore the need for x264enc
但是它支持示例视频/x-h264,因此需要x264enc。