我想從下面的文本中提取「視頻:」行的一些部分。正則表達式分割並從字符串中提取多個部分
Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (300
00/1) -> 14.93 (1000/67)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\a.3gp':
Metadata:
major_brand : 3gp5
minor_version : 0
compatible_brands: 3gp5isom
Duration: 00:00:45.82, start: 0.000000, bitrate: 357 kb/s
Stream #0.0(und): Video: mpeg4, yuv420p, 352x276 [PAR 1:1 DAR 88:69], 344 kb
/s, 14.93 fps, 14.93 tbr, 90k tbn, 30k tbc
Stream #0.1(und): Audio: aac, 16000 Hz, mono, s16, 11 kb/s
Stream #0.2(und): Data: mp4s/0x7334706D, 0 kb/s
Stream #0.3(und): Data: mp4s/0x7334706D, 0 kb/s*
這是從ffmpeg的命令線的輸出,其中i可以得到視頻:部分與
private string ExtractVideoFormat(string rawInfo)
{
string v = string.Empty;
Regex re = new Regex("[V|v]ideo:.*", RegexOptions.Compiled);
Match m = re.Match(rawInfo);
if (m.Success)
{
v = m.Value;
}
return v;
}
和結果是
MPEG4,YUV420P,352x276 [PAR 1:1 DAR 88:69],344 kb
我想要做的是以某種方式PLIT該行並得到
mpeg4
yuv420p
352x276 [PAR 1:1 DAR 88:69]
344 kb
分配給不同的字符串對象,而不是單一的
請重新格式化我的問題 – nLL 2010-05-15 17:17:47