Gstreamer原始视频AVI不能在Media Player中播放

我在Windows XP上使用GStreamer将原始(YUV)视频流写入一系列AVI文件。 下面显示了我正在使用的管道的简化版本:

gst-launch -e -v videotestsrc pattern = smpte100 num-buffers = 10 horizo​​ntal-speed = 1! video / x-raw-yuv,format =(fourcc)UYVY,width =(int)640,height =(int)480,framerate = 30/1! ffmpegcolorspace! avimux! multifilesink next-file =关键帧位置=“frame_%d.avi”index = 1

我遇到的第一个问题是写入的第一个文件的文件名为“frame_d.avi”,即“%d”被解释为“d”,因此Index不会被替换为字符串。 我猜这是Unicode的问题? 目前我可以通过修改filesink的源代码来解决这个问题,尽管如果可能的话我宁愿不要这样做。

我遇到的第二个问题是,当我尝试在Windows Media Player中查看AVI文件时,我收到以下消息:

“Windows Media Player无法播放该文件。 播放器可能不支持文件类型,也可能不支持用于压缩文件的编解码器。“

当我尝试在管道中使用filesink元素(而不是multifilesink)时,我可以在Media Player中查看视频。

使用十六进制编辑器查看文件内容,我可以看到,当使用multifilesink时,AVI头被写出,然后是YUV数据:

5249464610030000415649204c495354f80200006864726c6176696838000000 3582000080969800000000000000000000000000000000000100000000000000 80020000e0010000000000000000000000000000000000004c49535494020000 7374726c73747268380000007669647359555932000000000000000000000000 010000001e000000000000000000000000000000000000000000000000000000 0000000073747266280000002800000080020000e00100000100100059555932 00b00400000000000000000000000000000000004a554e4b1802000004000000 0000000030306462000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000 000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000004c495354100000006f646d6c 646d6c6804000000000000004c495354040000006d6f76693030646200600900 eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80 eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80 eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80 eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80 eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80 eb80eb80eb80eb80eb80eb80eb80eb80eb80eb80eb48d289d2 10d292d210d292 d210d292d210d292d210d292d210d292d210d292d210d292d210d292d210d292 d210d292d210d292d210d292d210d292d210d292d210d292d210d292d210d292 d210d292d210d292d210d292d210d292d210d292d210d292d210d292d210d292 d210d292d210d292d210d292d210d292d210d292d210d292d210d292d210d292 d210d292d210d292d210d292d210d292d210d292d210d292d210d292d210d292 d210d292d210d292d210d292aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10 aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10 aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10 aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10 aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10 aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10aaa6aa10 aaa6aa1091369122913691229136912291369122913691229136912291369122 9136912291369122913691229136912291369122913691229136912291369122 9136912291369122913691229136912291369122913691229136912291369122 9136912291369122913691229136912291369122913691229136912291369122 9136912291 369122913691229136912291369122913691229136912291369122 91369122913691229136912291369122913691229136912291806a806aca6ade 6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade 6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade 6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade 6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade 6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade6aca6ade 6aca6ade6aca6ade6aca6ade6aca6ade6a9251e7515a51f0515a51f0515a51f0 515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0 515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0 515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0 515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0 515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0515a51f0 515a51f0515a51f029f0296e29f0296e29f0296e29f0296e29f0296e29f0296e 29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e 29f0296e29f0296e29f0296e29f0296e29f 0296e29f0296e29f0296e29f0296e 29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e 29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e 29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e29f0296e

当我使用filesink(和正确播放)时生成的头文件如下所示:

5249464608c45d00415649204c495354f80200006864726c6176696838000000 35820000b840190100000000100000000a000000000000000100000000000000 80020000e0010000000000000000000000000000000000004c49535494020000 7374726c73747268380000007669647359555932000000000000000000000000 010000001e000000000000000a00000000600900000000000000000000000000 0000000073747266280000002800000080020000e00100000100100059555932 00b00400000000000000000000000000000000004a554e4b1802000004000000 0000000030306462000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000 000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000004c495354100000006f646d6c 646d6c68040000000a0000004c49535454c05d006d6f76693030646200600900

数据本身看起来不错; 除了avimux强制将UYUV转换为YUY2这一事实,这意味着我需要修改avimux来支持这一点。

为什么multifilesink写出的标题与filesink写出的标题不同,为什么这些差异会阻止视频播放?

预先感谢您的任何想法。


在dos命令promt你需要写

location="frame_%%d.avi"

逃避%char。 关于您的实际问题,multifilesink将无法以混合内容的方式工作。 您可以将其用于无标头内容。 avimux不会在随后的部分写入新的头文件。 这可能会更容易把avimux! 文件链接组合到一个文件夹中,并在某些事件中,发送一个文件夹,设置文件夹准备就绪,更改文件名并将其重新设置为播放。

链接地址: http://www.djcxy.com/p/43935.html

上一篇: Gstreamer raw video AVI does not play in Media Player

下一篇: Lossless compressed JPEG gstreamer element?