GNOME Bugzilla – Bug 626740
mpegpsmux(?): audio and video out of sync, when playing segments
Last modified: 2015-06-30 13:32:17 UTC
Created attachment 167739 [details] Code I've developed a simple program (code attached), which saves two pieces of the MPEG2-PS file to another MPEG-2 PS file. It constructs a pipeline: uridecodebin -> twolame -> multiqueue -> mpegmux -> filesink -> mpeg2enc -> Then it issues two segment seeks: one from 5th through 25th second, and another one from 90th to 125th seconds. Therefore, the resulting file should be 55 second long and contain two fragments of the source file. When the resulting file is played using any media player either GStreamer based, or not, when the second fragment begins, sound and video are out of sync. First, the picture appears, and then, after some seconds, sound appears.
Created attachment 167744 [details] Log of the program run with --gst-debug=mpegpsmux:4,lame:4 Looks like the muxer has hold the audio packets
Look in the attached log for the second appearance of "segment seek" Replacing twolame with lame doesn't change anything.
Replacing encoding and muxing chain with autoaudiosink and autovideosink gives correct playback where audio and video are in sync. ( uridecodebin -> autoaudiosink ) ( -> autovideosink )
Created attachment 232447 [details] uridecodebin_test.c - somewhat ported to 1.0 - but does not work properly I've tried to quickly port the test program to 1.0, but it doesn't work yet and I haven't debugged it further.
I believe this bug is obsolete, since muxers now mux based on running time, which should fix your issue if I understand it correctly. Any chance you could you re-test with GStreamer 1.x please? If not, let's close this as obsolete - if there are still issues someone will file a new bug :)
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment. Thanks!