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 659485 - mpegpsdemux: large MPEG PS file not working when seeking/transcoding with encodebin
mpegpsdemux: large MPEG PS file not working when seeking/transcoding with enc...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal normal
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-09-19 15:05 UTC by Christian Fredrik Kalager Schaller
Modified: 2011-09-30 14:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mpegpsdemux: take into account SCR offset when seeking (1.44 KB, patch)
2011-09-21 13:55 UTC, Vincent Penquerc'h
committed Details | Review
mpegdemux: answer position query with a stream time position (1.18 KB, patch)
2011-09-21 16:31 UTC, Vincent Penquerc'h
committed Details | Review
mpegpsdemux: remove unused field (702 bytes, patch)
2011-09-21 16:31 UTC, Vincent Penquerc'h
committed Details | Review
baseparse: position reporting should be in stream time (984 bytes, patch)
2011-09-26 12:15 UTC, Vincent Penquerc'h
none Details | Review
baseparse: position reporting should be in stream time (1015 bytes, patch)
2011-09-26 13:21 UTC, Vincent Penquerc'h
needs-work Details | Review
baseparse: position reporting should be in stream time (2.21 KB, patch)
2011-09-26 13:32 UTC, Vincent Penquerc'h
needs-work Details | Review
baseparse: position reporting should be in stream time (2.22 KB, patch)
2011-09-26 23:49 UTC, Vincent Penquerc'h
committed Details | Review

Description Christian Fredrik Kalager Schaller 2011-09-19 15:05:25 UTC
Got a 2 GB MPEG PS file I am trying to transcode. Edward looked into it and it seems to be a bug in MPEGPSDEMUX.

<bilboed> cschalle, can't spend more time on it
 cschalle, but if it works in push mode, and it works with smaller files ... there's just something wrong in the PCR<=>offset conversion code
Comment 1 Vincent Penquerc'h 2011-09-21 13:55:30 UTC
Created attachment 197156 [details] [review]
mpegpsdemux: take into account SCR offset when seeking

Since the seeking byte offset is chosen by linear interpolation
from SCR values, we need to take that first SCR into account
to end up near the correct offset. Otherwise, as the code does
a linear search after that first seek, it will take a LOOOOOONG
time to get there for streams which don't start at zero.
Comment 2 Vincent Penquerc'h 2011-09-21 16:31:15 UTC
Created attachment 197171 [details] [review]
mpegdemux: answer position query with a stream time position
Comment 3 Vincent Penquerc'h 2011-09-21 16:31:56 UTC
Created attachment 197172 [details] [review]
mpegpsdemux: remove unused field
Comment 4 Christian Fredrik Kalager Schaller 2011-09-22 09:14:52 UTC
Thanks for these patches Vincent, I think the position one works now, however I also need it to return the correct value for query_duration in stream time to be able to do the progress calculation, my assumption is that the query_duration call has the same problem as the query_position one you fixed.
Comment 5 Christian Fredrik Kalager Schaller 2011-09-22 12:24:43 UTC
Ok, so after talking to Vincent on IRC seems the duration query does give the right response, but the position one might not. When adding some debug print statements to Transmageddon I get the following output when starting to transcode:

position is 1803826766666
duration is 1785296000000
value is 1.01037966066

So it seems to report a position higher then the duration when position in the beginning should be close to 0.
Comment 6 Vincent Penquerc'h 2011-09-26 12:15:39 UTC
Created attachment 197470 [details] [review]
baseparse: position reporting should be in stream time
Comment 7 Vincent Penquerc'h 2011-09-26 12:17:04 UTC
Culprit was baseparse this time, not taking segment start into account.
Progress in Transmageddon now works with this particular file.
Comment 8 Vincent Penquerc'h 2011-09-26 13:21:56 UTC
Created attachment 197474 [details] [review]
baseparse: position reporting should be in stream time

Use gst_segment_to_stream_time instead of offseting manually,
as suggested by slomo.
Comment 9 Vincent Penquerc'h 2011-09-26 13:32:36 UTC
Created attachment 197475 [details] [review]
baseparse: position reporting should be in stream time

Let the demuxer have first say as well.
Comment 10 Christian Fredrik Kalager Schaller 2011-09-26 13:59:15 UTC
Tested and verified 470 patch to be working, hope this patch can get merged soon. As a bonus in addition to the progress bar in Transmageddon fix, this also fixes issue where Nautilus was not thumbnailing these movies.
Comment 11 Sebastian Dröge (slomo) 2011-09-26 14:25:53 UTC
Review of attachment 197474 [details] [review]:

Looks good in general

::: libs/gst/base/gstbaseparse.c
@@ +3156,3 @@
           GST_CLOCK_TIME_IS_VALID (parse->segment.last_stop)) {
+        gst_segment_to_stream_time (&parse->segment, parse->segment.format,
+            parse->segment.last_stop);

dest_value = ...
Comment 12 Sebastian Dröge (slomo) 2011-09-26 14:27:35 UTC
Review of attachment 197475 [details] [review]:

Good in general but:

::: libs/gst/base/gstbaseparse.c
@@ +3160,3 @@
+            GST_CLOCK_TIME_IS_VALID (parse->segment.last_stop)) {
+          gst_segment_to_stream_time (&parse->segment, parse->segment.format,
+              parse->segment.last_stop);

dest_value = ...
Comment 13 Vincent Penquerc'h 2011-09-26 23:49:00 UTC
Created attachment 197536 [details] [review]
baseparse: position reporting should be in stream time

Let the demuxer have first say as well.
Comment 14 Vincent Penquerc'h 2011-09-26 23:52:35 UTC
Ha, er, embarassing...
Comment 15 Tim-Philipp Müller 2011-09-30 14:12:21 UTC
Comment on attachment 197171 [details] [review]
mpegdemux: answer position query with a stream time position

Committed with changes, thanks.