Hi,<br><br>Basically I am interested in using playbin to extract video packets from a media file. <br><br>I have replaced the video decoder element in decodebin by a identity element, to bypass the video decoding process. I also modified playbin such that the colorspace, videoscale, and videosink are replaced by a filesink, to save the extracted video packets into a file. I was able to extract video packets and save them into a file. However, there are two problems:<br>
<br>1. using an mpeg-4 video file (only contains video stream, and encoded by ffmpeg) as the input, the output file size is smaller than that of the input. I would expect they have the same file size since the input only contains video stream (ffmpeg shows there is no muxing overhead). And the output file is not decodable by neither gstreamer nor ffplay. As another test, I use an avi file as the input. It has both video and audio streams. Video is encoded in H.264. The output file size is smaller than that of the input as expected. And interestingly, the output file, which is basically an H.264 bitstream, is decodable by ffplay, but not by gstreamer. My question is: could this be a threading problem since the new "playback" is much faster than normal decode + display process? And how to solve (or investigate) this?<br>
<br>2. verbose output shows that the offset and offset_end of identity element in decodebin seem to be wrong (shown below). Also it seems that the "playback" already starts before "Setting pipeline to PLAYING". I am not sure if this is normal since I know little about the lower level threading within gstreamer.<br>
<br>partial verbose output for a mpeg-4 video sequence "playback" is shown here:<br>/GstPlayBin:playbin0/GstBin:vbin.GstGhostPad:sink.GstProxyPad:proxypad2: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, codec_data=(buffer)000001b001000001b58913000001000000012000c48d8800cd0b04241463000001b24c61766335322e32302e30, width=(int)352, height=(int)288, framerate=(fraction)25/1<br>
/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstIdentity:identity0: last-message = "chain ******* (identity0:sink)i (1230 bytes, timestamp: 0:00:00.320000000, duration: 0:00:00.040000000, offset: -1, offset_end: -1, flags: 256) 0x839ae30"<br>
/GstPlayBin:playbin0/GstBin:vbin/GstFileSink:vfsink.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, codec_data=(buffer)000001b001000001b58913000001000000012000c48d8800cd0b04241463000001b24c61766335322e32302e30, width=(int)352, height=(int)288, framerate=(fraction)25/1<br>
/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstIdentity:identity0: last-message = "chain ******* (identity0:sink)i (1282 bytes, timestamp: 0:00:00.360000000, duration: 0:00:00.040000000, offset: -1, offset_end: -1, flags: 256) 0x839ae80"<br>
Pipeline is PREROLLED ...<br>Setting pipeline to PLAYING ...<br>/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstIdentity:identity0: last-message = "chain ******* (identity0:sink)i (1153 bytes, timestamp: 0:00:00.400000000, duration: 0:00:00.040000000, offset: -1, offset_end: -1, flags: 256) 0x839aed0"<br>
/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstIdentity:identity0: last-message = "chain ******* (identity0:sink)i (1287 bytes, timestamp: 0:00:00.440000000, duration: 0:00:00.040000000, offset: -1, offset_end: -1, flags: 256) 0x83866f0"<br>
/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstIdentity:identity0: last-message = "chain ******* (identity0:sink)i (16000 bytes, timestamp: 0:00:00.480000000, duration: 0:00:00.040000000, offset: -1, offset_end: -1, flags: 0) 0x8386600"<br>
/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstIdentity:identity0: last-message = "chain ******* (identity0:sink)i (1432 bytes, timestamp: 0:00:00.520000000, duration: 0:00:00.040000000, offset: -1, offset_end: -1, flags: 256) 0x83865b0"<br>
New clock: GstSystemClock<br>/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstIdentity:identity0: last-message = "chain ******* (identity0:sink)i (2095 bytes, timestamp: 0:00:00.560000000, duration: 0:00:00.040000000, offset: -1, offset_end: -1, flags: 256) 0x8386560"<br>
/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstIdentity:identity0: last-message = "chain ******* (identity0:sink)i (2781 bytes, timestamp: 0:00:00.600000000, duration: 0:00:00.040000000, offset: -1, offset_end: -1, flags: 256) 0x8386510"<br>
<br><br>I am quite new to gstreamer. Hopefully some experts can give me some hints. Thanks.<br><br>Regards,<br><br>Qin<br>