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 586848 - qtmux, asfmux: remuxing streams with different start times
qtmux, asfmux: remuxing streams with different start times
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.x
Other Linux
: Normal normal
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-24 13:44 UTC by Christian Fredrik Kalager Schaller
Modified: 2011-05-09 10:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Handling empty segments in qtdemux (7.48 KB, patch)
2009-11-06 19:28 UTC, Thiago Sousa Santos
none Details | Review
Patch(1) for qtmux (4.97 KB, patch)
2009-11-06 21:47 UTC, Thiago Sousa Santos
committed Details | Review
Patch(2) for qtmux (6.66 KB, patch)
2009-11-06 21:47 UTC, Thiago Sousa Santos
committed Details | Review

Description Christian Fredrik Kalager Schaller 2009-06-24 13:44:46 UTC
Trying to transcode this file:
http://dirac.kw.bbc.co.uk/download/video/maybefinal/bbb-tr2200.ts

Been trying to convert it to a series of formats and in most cases audio and video goes badly out of sync. The original plays fine in Totem. Only transcoded file so far which works well has been when I transcoded to Ogg+Theora+Vorbis.
Works:
Ogg+Theora+Vorbis
Matroska+mp3+Theora (plays fine in mplayer, doesn't play at all in Totem)

These gives me audio/video sync issues:
H264+AAC in Quicktime
H264+MP3 in Quicktime
MPEG4+mp3 in AVI

Transcoding using Transmageddon, but getting same behaviour with gst-launch

Can provide any generated file upon request
Comment 1 Christian Fredrik Kalager Schaller 2009-06-24 14:21:00 UTC
Tried re-transcoding the working Ogg Theora+Vorbis file and it give me the exact same sync issue as transcoding the original MPEG TS file directly to Quicktime.

Comment 2 Thiago Sousa Santos 2009-11-05 19:17:33 UTC
By looking at the timestamps at the buffers received by qtmux I can see there is a 1s difference between the first buffer of one stream, and the first buffer of the other. Maybe there is a timestamping problem, or maybe it is meant to be like this and our muxers aren't handling this properly.
Comment 3 Thiago Sousa Santos 2009-11-06 13:48:05 UTC
I implemented the 'late' streams handling in qtmux and it remuxes in sync (quicktime works), but qtdemux ignore empty edit list entries (which is how we add empty segments in qt) and doesn't play correctly.
Comment 4 Thiago Sousa Santos 2009-11-06 19:28:33 UTC
Created attachment 147123 [details] [review]
Handling empty segments in qtdemux

This patch makes it play correctly in qtdemux.
Comment 5 Thiago Sousa Santos 2009-11-06 21:47:26 UTC
Created attachment 147131 [details] [review]
Patch(1) for qtmux
Comment 6 Thiago Sousa Santos 2009-11-06 21:47:57 UTC
Created attachment 147132 [details] [review]
Patch(2) for qtmux

The 2 patches for qtmux makes it mux it in sync.
Comment 7 Thiago Sousa Santos 2009-11-17 19:56:34 UTC
Just fixed it for asf as well. Will commit all those after the freeze.
Comment 8 Thiago Sousa Santos 2009-11-18 02:26:01 UTC
Pushed the fixes for qtmux/asfmux

Module: gst-plugins-bad
Branch: master
Commit: 1d155a6357f3e42786ffdb75c65274e82bed15c6
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=1d155a6357f3e42786ffdb75c65274e82bed15c6

Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk>
Date:   Fri Nov  6 10:34:39 2009 -0300

qtmux: handle 'late' streams


Module: gst-plugins-bad
Branch: master
Commit: 48a2bbd6ad982d92bfe797b18dcf99320dc99b21
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=48a2bbd6ad982d92bfe797b18dcf99320dc99b21

Author: Thiago Sousa Santos <thiagoss@redmoon.(none)>
Date:   Tue Nov 17 17:25:14 2009 -0300

asfmux: handle streams with different start times


(ugh, and I again forgot to set my name and email on the last commit, I just installed a new system, sorry for that)
Comment 9 Thiago Sousa Santos 2009-11-18 19:13:09 UTC
Could someone review the patch for qtdemux, please?
Comment 10 Thiago Sousa Santos 2009-11-18 19:14:02 UTC
Review of attachment 147131 [details] [review]:

Commited
Comment 11 Thiago Sousa Santos 2009-11-18 19:14:05 UTC
Review of attachment 147131 [details] [review]:

Commited
Comment 12 Roland Krikava 2009-11-20 21:46:34 UTC
The following mp4 was create using the qtmux patch in the below bugzilla ticket.  qtmuxedits-test.c was modified to use v4l2src/alsasrc instead of the test sources.  The audio track contains non-empty/empty edits in 5 second intervals.

http://www.bluedigits.com/misc/test-edits.mp4

When using totem with the qtdemux patch in this thread, the video plays back totally in sync all the way through.  However, the progress bar will jump ahead to the next non-empty edit as soon as an empty edit is encountered.  Also, if moving the progress bar back within an empty edit, playback from that point is out of sync.  Playback using a gst-launch pipeline will cause gst-launch to get stuck during preroll:

gst-launch filesrc location=test-edits.mp4 ! qtdemux name=demux demux.video_00 ! queue ! ffdec_mpeg4 ! ffmpegcolorspace ! ximagesink  demux.audio_00 ! queue ! faad ! alsasink

This thread relates to the following (quicktime mp4 sync issues):

https://bugzilla.gnome.org/show_bug.cgi?id=601033
Comment 13 Roland Krikava 2009-11-23 23:18:02 UTC
Please ignore the part about gst-launch getting stuck on preroll.  The above pipeline uses ffdec_mpeg4 insted of ffdec_h264 (the posted recording is h264).
Comment 14 Thiago Sousa Santos 2009-11-24 11:20:09 UTC
Review of attachment 147132 [details] [review]:

commited
Comment 15 Roland Krikava 2009-12-14 19:29:19 UTC
Any suggestions how to deal with the seek and position, within empty edits, bugs?
Comment 16 Thiago Sousa Santos 2010-02-05 13:02:36 UTC
Comment on attachment 147123 [details] [review]
Handling empty segments in qtdemux

Updated and posted on the edit lists bug: 345830
Comment 17 Chris Shoemaker 2010-10-27 13:01:21 UTC
Roland, would you mind if we separate the issue about seeking and positioning within empty edits into another bug entry?  If so, I think we can mark this bug closed.
Comment 18 Roland Krikava 2010-10-27 17:45:18 UTC
Yes, please do.  I have added comments to #345830 on this subject.
Comment 19 Christian Fredrik Kalager Schaller 2011-01-28 13:36:09 UTC
Ok, based on latest comments I will close this bug as fixed.