GNOME Bugzilla – Bug 764769
matroskamux: make timecodescale configurable
Last modified: 2016-04-11 07:18:03 UTC
Created attachment 325576 [details] [review] make timecodescale configurable In a very specialized app I produce buffers with timestamp equal to millisecond and different for microsecond/nanosecond, the default timecode scale used in matroskamux will produce blocks with the same timestamp in this case since it use millisecond precision Tha attached patch make timecodescale configurable using a property. You can test with this pipeline: videotestsrc ! jpegenc ! matroskamux ! filesink ... mkvinfo shows 1000000 as timecodescale if you now use this pipeline: filesrc ! matroskademux ! fakesink you'll see buffers with millisecond precision setting timecodescale on the muxer you can change the precision and mkvinfo will show the value you set. See also this for a more general use case https://matroska.org/technical/specs/notes.html#TimecodeScale
Review of attachment 325576 [details] [review]: Makes sense, yes ::: gst/matroska/matroska-mux.c @@ +342,3 @@ + g_param_spec_int64 ("timecodescale", "TimecodeScale used to calculate " + "the Raw Timecode of a Block", + "Using the default (1000000) you'll get block with " "a block" or "blocks"?
blocks :-) do you want an updated patch?
If you can do that, that would be great :)
Comment on attachment 325576 [details] [review] make timecodescale configurable >+ g_object_class_install_property (gobject_class, PROP_TIMECODESCALE, >+ g_param_spec_int64 ("timecodescale", "TimecodeScale used to calculate " >+ "the Raw Timecode of a Block", >+ "Using the default (1000000) you'll get block with " >+ "milliseconds precision, using 1 nanoseconds precision", 1, >+ GST_SECOND, DEFAULT_TIMECODESCALE, >+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); I think this should be something like: "timecodescale", "TimecodeScale", "TimecodeScale used to calculate the Raw Timecode of a Block". Don't see why you need to describe the defaults here, and we may want to change the default in future (e.g. be adaptive based on the input framerate or such to minimise rounding errors).
or even "Timecode Scale" for the second :)
Created attachment 325580 [details] [review] updated patch Thanks for the review! Regarding the adaptative time scale will be useful for audio only files but probably audio only muxing should be fixed first (see 754696)
commit cbdbfc89023a734034d4a746862d5af4c4ac8483 Author: Nicola Murino <nicola.murino@gmail.com> Date: Fri Apr 8 13:05:57 2016 +0200 matroskamux: make timecodescale configurable In some use cases the default timecodescale will produce blocks with the same timestamp https://bugzilla.gnome.org/show_bug.cgi?id=764769