After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 578966 - Using seek to segment video produces garbage
Using seek to segment video produces garbage
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.21
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-14 20:17 UTC by Shawn McMurdo
Modified: 2009-08-28 13:49 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24



Description Shawn McMurdo 2009-04-14 20:17:54 UTC
Please describe the problem:
I am trying to segment a video using gstreamer (via gstreamer-java).
I have the equivalent of this pipeline:

filesrc location=${input} ! decodebin name=dec ffmux_asf name=mux ! filesink location=${output} dec. ! queue ! ffmpegcolorspace ! ffenc_wmv2 ! queue ! mux. dec. ! queue ! audioconvert ! lame ! mp3parse ! queue ! mux.

This pipeline works if I don't do a seek but if I do a seek it produces a file that is not identifiable as a video although it seems to be about the right size.

Here's the seek code which works on other pipelines:

int flags = SeekFlags.FLUSH | SeekFlags.SEGMENT | SeekFlags.KEY_UNIT;
boolean success = gpipe.seek(1.0, Format.TIME, flags,
                                    SeekType.SET, startClock.toNanos(),
                                    SeekType.SET, endClock.toNanos());


Steps to reproduce:
1. I am trying to segment a video using gstreamer (via gstreamer-java).
I have the equivalent of this pipeline:

filesrc location=${input} ! decodebin name=dec ffmux_asf name=mux ! filesink location=${output} dec. ! queue ! ffmpegcolorspace ! ffenc_wmv2 ! queue ! mux. dec. ! queue ! audioconvert ! lame ! mp3parse ! queue ! mux.

This pipeline works if I don't do a seek but if I do a seek it produces a file that is not identifiable as a video although it seems to be about the right size.

Here's the seek code which works on other pipelines:

int flags = SeekFlags.FLUSH | SeekFlags.SEGMENT | SeekFlags.KEY_UNIT;
boolean success = gpipe.seek(1.0, Format.TIME, flags,
                                    SeekType.SET, startClock.toNanos(),                                  SeekType.SET, endClock.toNanos());

2. This produces an output file that is not recognizable or playable via gstreamer or other video players.
3. 


Actual results:
An output file of approximately the correct size is generated but it is unplayable.

Expected results:
I expect the generated video segment to be playable.

Does this happen every time?
yes

Other information:
This happens on Fedora 10 64 bit and Ubuntu 8.10 32 bit.
Comment 1 Wim Taymans 2009-04-14 20:28:46 UTC
You probably don't want the SEGMENT flag (it stops emiting EOS at the end, which might cause the headers to not be flushed out).

You probably also don't want to encode the bits before you do the seek. This you can do with using pad blocks (http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-block.txt see the part about prerolling a partial pipeline)

You also probably just want to use gnonlin to cut the video in pieces.