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 664034 - [PATCH] [mpegvideoparse] Proper timestamp generation and codec_data fixes
[PATCH] [mpegvideoparse] Proper timestamp generation and codec_data fixes
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.x
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-11-14 14:06 UTC by Matej Knopp
Modified: 2012-04-14 19:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix timestamp generation and codec_data (12.23 KB, patch)
2011-11-14 14:06 UTC, Matej Knopp
none Details | Review
Make the parse_process_config code little bit cleaner (1.95 KB, patch)
2011-11-14 18:11 UTC, Matej Knopp
none Details | Review
No not update caps while dropping frames (1.01 KB, patch)
2011-11-20 04:05 UTC, Matej Knopp
none Details | Review
Patch for GStreamer 0.11 (13.01 KB, patch)
2011-11-27 23:48 UTC, Matej Knopp
none Details | Review
0.10 - Codec data fixes (2.70 KB, patch)
2011-11-28 17:55 UTC, Matej Knopp
none Details | Review
0.10 - Proper timestamp generation (10.49 KB, patch)
2011-11-28 17:56 UTC, Matej Knopp
none Details | Review
0.11 - Codec data fixes (2.77 KB, patch)
2011-11-28 17:58 UTC, Matej Knopp
none Details | Review
0.11 - Proper timestamp generation (10.46 KB, patch)
2011-11-28 17:58 UTC, Matej Knopp
none Details | Review
0.11 Proper timestamp generation + Codec data fixes (12.71 KB, patch)
2012-01-14 07:08 UTC, Matej Knopp
none Details | Review
0.11 Proper timestamp generation + Codec data fixes (11.80 KB, patch)
2012-01-26 12:31 UTC, Matej Knopp
none Details | Review

Description Matej Knopp 2011-11-14 14:06:52 UTC
Created attachment 201368 [details] [review]
Patch to fix timestamp generation and codec_data

Currently mpegvideoparse generates monotonous timestamps for delta frames by adding previous frame duration, that is not correct for B-frames. This breaks mpeg2dec and it also makes difficult to use decoder that doesn't output video frames in presentation order (i.e. Apple decoders). 

Patch adds proper timestamp generation.

Second issue is quantization matrices changing in codec_data. For some reason this causes frame freezes in certain parts of the videos. Patch fixes this by changing codec_data only if there are other changes in sequence header. Also the codec_data should include start-code otherwise gop-split mode doesn't work properly.
Comment 1 Matej Knopp 2011-11-14 18:11:24 UTC
Created attachment 201390 [details] [review]
Make the parse_process_config code little bit cleaner
Comment 2 Matej Knopp 2011-11-20 04:04:27 UTC
Another issue - The parser updates caps in drop mode before it parsed sequence header resulting in caps that are not subset of template caps (because the mpegversion is missing, etc). Patch attached.
Comment 3 Matej Knopp 2011-11-20 04:05:47 UTC
Created attachment 201728 [details] [review]
No not update caps while dropping frames
Comment 5 Matej Knopp 2011-11-27 23:48:44 UTC
Created attachment 202261 [details] [review]
Patch for GStreamer 0.11

Includes all 3 previous patches
Comment 6 Sebastian Dröge (slomo) 2011-11-28 16:41:45 UTC
Could you split the first patch into (at least) 2 patches, one for the timestamp generation change and one for the codec_data?

Also, is the mutex really necessary? From what I see this is only ever called from the streaming thread.
Comment 7 Matej Knopp 2011-11-28 17:54:53 UTC
The mutex is not necessary, I removed it in following patches.
Comment 8 Matej Knopp 2011-11-28 17:55:54 UTC
Created attachment 202309 [details] [review]
0.10 - Codec data fixes
Comment 9 Matej Knopp 2011-11-28 17:56:29 UTC
Created attachment 202310 [details] [review]
0.10 - Proper timestamp generation
Comment 10 Matej Knopp 2011-11-28 17:58:21 UTC
Created attachment 202311 [details] [review]
0.11 - Codec data fixes
Comment 11 Matej Knopp 2011-11-28 17:58:55 UTC
Created attachment 202312 [details] [review]
0.11 - Proper timestamp generation
Comment 12 Matej Knopp 2012-01-14 07:08:19 UTC
Created attachment 205253 [details] [review]
0.11 Proper timestamp generation + Codec data fixes

Updated against latest git
Comment 13 Matej Knopp 2012-01-26 12:31:33 UTC
Created attachment 206177 [details] [review]
0.11 Proper timestamp generation + Codec data fixes

Updated against latest git. Would be really nice if someone could take a look and tell me if this is a go or not. I can provide sample file that can be used to demonstrate broken timestamps that current parser generates.
Comment 14 Matej Knopp 2012-04-14 19:31:22 UTC
This patch doesn't work anymore with latest git. Also 
https://bugzilla.gnome.org/show_bug.cgi?id=674113