我想使用 shell 脚本将以下 GST 命令分成两半。
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"Z0KAHukBQHpCAAAH0AAB1MAI\\,aM48gA\\=\\=\", payload=(int)96, ssrc=(uint)2416890621, clock-base=(uint)518578781, seqnum-base=(uint)24075
拆分必须发生在 caps = 两个新行应该存储在两个变量 $var1 和 $var2
$var1 应该包含
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink:
并且 $var2 应该包含
application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"Z0KAHukBQHpCAAAH0AAB1MAI\\,aM48gA\\=\\=\", payload=(int)96, ssrc=(uint)2416890621, clock-base=(uint)518578781, seqnum-base=(uint)24075
请记住,输入字符串中有两个反斜杠。所以做一个回声只会给出一个反斜杠。