summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-09-30 18:22:27 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-11-01 20:41:22 +0200
commitcba6cc4fd45c5612c430260670f4762d181ba922 (patch)
tree2eee294139a6221da291473851421b564007118b
parent7b565475bf551c53b8eed46f7086f3b372f1f6c4 (diff)
qtmux: Set compressor name, horizontal/vertical resolution and depth for ProRes
This is also required by some software to handle ProRes files. https://bugzilla.gnome.org/show_bug.cgi?id=769048
-rw-r--r--gst/isomp4/gstqtmux.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c
index 5407f22f0..8097013b2 100644
--- a/gst/isomp4/gstqtmux.c
+++ b/gst/isomp4/gstqtmux.c
@@ -4318,9 +4318,40 @@ gst_qt_mux_video_sink_set_caps (GstQTPad * qtpad, GstCaps * caps)
qtmux->context, &entry, rate, ext_atom_list);
if (strcmp (mimetype, "video/x-prores") == 0) {
SampleTableEntryMP4V *mp4v = (SampleTableEntryMP4V *) qtpad->trak_ste;
+ const gchar *compressor = NULL;
mp4v->spatial_quality = 0x3FF;
mp4v->temporal_quality = 0;
mp4v->vendor = FOURCC_appl;
+ mp4v->horizontal_resolution = 72 << 16;
+ mp4v->vertical_resolution = 72 << 16;
+ mp4v->depth = (entry.fourcc == FOURCC_ap4h
+ || entry.fourcc == FOURCC_ap4x) ? 32 : 24;
+
+ /* Set compressor name, required by some software */
+ switch (entry.fourcc) {
+ case FOURCC_apcn:
+ compressor = "Apple ProRes 422";
+ break;
+ case FOURCC_apcs:
+ compressor = "Apple ProRes 422 LT";
+ break;
+ case FOURCC_apch:
+ compressor = "Apple ProRes 422 HQ";
+ break;
+ case FOURCC_apco:
+ compressor = "Apple ProRes 422 Proxy";
+ break;
+ case FOURCC_ap4h:
+ compressor = "Apple ProRes 4444";
+ break;
+ case FOURCC_ap4x:
+ compressor = "Apple ProRes 4444 XQ";
+ break;
+ }
+ if (compressor) {
+ strcpy ((gchar *) mp4v->compressor + 1, compressor);
+ mp4v->compressor[0] = strlen (compressor);
+ }
/* The 'clap' extension is also defined for MP4 but inventing values in
* general seems a bit tricky for this one. We only write it for ProRes