GNOME Bugzilla – Bug 651805
[mpegtsmux] Add a property for aligned output
Last modified: 2012-06-08 09:29:17 UTC
use case is bluray authoring where streams have to be aligned to logical units of 6144 bytes each. standard operation zeropads the last buffer until the desired sector alignment is reached. m2tsmode will take the very last actual packet's m2ts header and ts contiuity count and generate mpeg compliant dummy packets (with adaptation field) up to the desired sector length.
Created attachment 189176 [details] [review] introduce an aligner plugin which can insert padding at the end of streams if they need to fit certain sector alignment specs. Fixes bug #651805
Edward, could you comment on why you didn't want this as part of mpegtsmux? Seems like a logical extension of m2ts-mode, and would fit right in to what encodebin would want to generate a file for *mumble* device.
If we can make the difference between avchd and bluray variants in mpegtsmux, then I'd be fine with: * Adding a property with specifies in chunks of how many mpegts packets we output (ex: 32 packets of {192|188} bytes). It should buffer up and push out buffers containing that many packets. * Have the default be deactivated (0?) for all variants (like current behaviour), except for the bluray variant where it would default to 32. On EOS, it should push out everything with 0x1fff pid buffers (i.e. null buffers). As far as I can tell only bluray (and not AVCHD) requires that.
Created attachment 189321 [details] [review] [mpegtsmux] introduce an alignment property which specifies the amount of ts or m2ts packets, that buffers must contain before they are pushed. On EOS, dummy packets are generated and used for padding
...used for padding until the final buffer is also aligned. With a value of 32 given, this allows creating blu-ray compliant streams. Fixes bug #651805 this is a new approach to fixing the issue without a seperate plugin but rather inside mpegtsmux.
bilboed, did you want the 32-packet-alignment to automatically be the default if m2ts-mode is TRUE? how would I express that textwise in the property description?
"Default: unused for non-m2ts streams, else 32"
Created attachment 189573 [details] [review] patch to implement alignment property to mpegtsmux [mpegtsmux] introduce an alignment property which specifies the amount of packets, that buffers must contain before they are pushed. On EOS, dummy packets are generated and used for padding until the final buffer is also aligned. With a value of 32 given, this allows creating blu-ray compliant streams.
Created attachment 196836 [details] [review] [mpegtsmux] introduce an alignment property with this new patch, i don't re-overwrite the eventfunc (which is actually needed by collectpads, thanks for that info, david!)
Instead of a property I think it would be better to negotiate the alignment (and m2ts mode or other mode) via caps. That's handled in bug #583875 and should be fixed together with this one here IMHO
Following commit should arrange for (a.o.) aligned output as described here. While I agree it could be handled differently than with a property, there still seems to be a lot that is not clear/decided yet in bug #583875 (and missing specs, etc). So at least this way the functionality is in place already. commit 83ebf61b7a87ad7150269f2cb48791003b8d7d9e Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Thu Jun 7 17:38:51 2012 +0200 mpegtsmux: allow for aligned output ... and refactor packet handling some more in the process. Fixes #651805.