我有一堆从Silicondust HDHomerun调谐器获得的mpegts视频文件。在gstreamer 0.10中寻求真的很慢(参见我以前的post)。现在寻求得到很大改善(1.0.6),但仍存在问题。这是一些标准输出:
$ ./fullscreen02
No accelerated IMDCT transform found
No accelerated IMDCT transform found
pos_ns: 1700833333, seek_ns: 11700833333
position: 0:00:11.700833333
(fullscreen02:30989): GStreamer-CRITICAL **: gst_segment_do_seek: assertion `segment->format == format' failed
(fullscreen02:30989): GStreamer-CRITICAL **: gst_segment_do_seek: assertion `segment->format == format' failed
Seek failed!
pos_ns: 1878166666, seek_ns: 11878166666
position: 0:00:11.878166666
(fullscreen02:30989): GStreamer-CRITICAL **: gst_segment_do_seek: assertion `segment->format == format' failed
(fullscreen02:30989): GStreamer-CRITICAL **: gst_segment_do_seek: assertion `segment->format == format' failed
Seek failed!
pos_ns: 1468916666, seek_ns: 11468916666
position: 0:00:11.468916666
(fullscreen02:30989): GStreamer-CRITICAL **: gst_segment_do_seek: assertion `segment->format == format' failed
(fullscreen02:30989): GStreamer-CRITICAL **: gst_segment_do_seek: assertion `segment->format == format' failed
Seek failed!
^C
正如你所看到的,pos_ns前后跳跃,尽管这是这里定义的三十秒跳跃的输出:
gint64 dur_ns, pos_ns, seek_ns;
GstFormat format;
format = GST_FORMAT_TIME;
if ( !gst_element_query_position(pipeline,format,&pos_ns) )
g_print("query position failed\n");
seek_ns = pos_ns + 10*GST_SECOND;
g_print ("pos_ns: %li, seek_ns: %li\n",pos_ns,seek_ns);
g_print ("position: %" GST_TIME_FORMAT "\n", GST_TIME_ARGS (seek_ns));
if ( !gst_element_seek_simple (pipeline, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT, seek_ns) )
g_print ("Seek failed!\n");
你也可以在同一个stdout中看到即使在屏幕上跳过前进似乎成功,gst_element_seek_simple返回false,因此抱怨搜索失败。
我找到了一个可能相关的bug,但不是等待那个补丁通过系统工作,我认为我确信我不只是做错了。
关于文件类型的一些额外信息:
$ ffmpeg -i EP00753796.0160_1357005474.67.mpg
[mpeg2video @ 0x629fa0] mpeg_decode_postinit() failure
Last message repeated 2 times
[mpegts @ 0x626320] PES packet size mismatch
Input #0, mpegts, from 'EP00753796.0160_1357005474.67.mpg':
Duration: 00:29:59.69, start: 69837.938167, bitrate: 17997 kb/s
Program 3
Stream #0:0[0x31]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 17000 kb/s, 30.43 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x34](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), s16, 384 kb/s
Stream #0:2[0x35](esl): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, mono, s16, 192 kb/s (visual impaired)
我的管道:
pipeline = gst_parse_launch("filesrc location=EP00753796.0160_1357005474.67.mpg ! decodebin name=decoder decoder. ! queue ! audioconvert ! audioresample ! alsasink decoder. ! deinterlace ! videoconvert ! xvimagesink",&error);
虽然我在同一个C程序中使用playbin会得到相同的行为。
任何想法都将不胜感激。感谢。