Re: [FFmpeg-devel] [PATCH] Add support for spherical uuid in mov
On 4/21/2016 9:13 AM, Hendrik Leppkes wrote: > One developer from Libav is working on defining side-data for this > spherical data. If you want to push this forward I suggest you join > those efforts. > ie. this patch for mov: https://patches.libav.org/patch/60300/ (part > of a longer series) Yes, please. I would not like competing APIs, as a downstream user. They are in IRC, as well. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Add support for spherical uuid in mov
On Thu, Apr 21, 2016 at 10:10 AM, wm4wrote: > On Wed, 20 Apr 2016 19:46:05 -0700 > Neil Birkbeck wrote: > >> If you use "spherical-video" and put it in the stream's metadata, it >> will more naturally agree with location in stream-level tag in mkv: >> https://github.com/google/spatial-media/blob/master/docs/spherical-video-rfc.md > > (Replying to both.) > > This kind of metadata is basically for user info and things like tags. > It should NOT be used to export semantic/mandatory information about > the video stream. > > To make it even worse, ffmpeg.c will happily put those tags into other > container/codecs, which means using metadata for this information will > likely produce broken files that can only be read by ffmpeg itself. One developer from Libav is working on defining side-data for this spherical data. If you want to push this forward I suggest you join those efforts. ie. this patch for mov: https://patches.libav.org/patch/60300/ (part of a longer series) - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Add support for spherical uuid in mov
On Wed, 20 Apr 2016 19:46:05 -0700 Neil Birkbeckwrote: > If you use "spherical-video" and put it in the stream's metadata, it > will more naturally agree with location in stream-level tag in mkv: > https://github.com/google/spatial-media/blob/master/docs/spherical-video-rfc.md (Replying to both.) This kind of metadata is basically for user info and things like tags. It should NOT be used to export semantic/mandatory information about the video stream. To make it even worse, ffmpeg.c will happily put those tags into other container/codecs, which means using metadata for this information will likely produce broken files that can only be read by ffmpeg itself. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Add support for spherical uuid in mov
That makes sense. I’ve attached a revised patch which will store a “spherical-video” tag in stream metadata, assuming we have a stream (moov level uuid atoms shouldn’t have spherical metadata according to the RFC). This is my first time submitting an ffmpeg patch, so please clue me in if I’m off the rails. Thanks! -Colin 0001-Add-support-for-spherical-metadata-from-uuid-atom-st.patch Description: Binary data > On Apr 20, 2016, at 9:46 PM, Neil Birkbeckwrote: > > If you use "spherical-video" and put it in the stream's metadata, it > will more naturally agree with location in stream-level tag in mkv: > https://github.com/google/spatial-media/blob/master/docs/spherical-video-rfc.md > > On Wed, Apr 20, 2016 at 6:24 PM, Colin McFadden wrote: >> --- >> libavformat/mov.c | 26 ++ >> 1 file changed, 26 insertions(+) >> >> diff --git a/libavformat/mov.c b/libavformat/mov.c >> index 47af98c..2223c81 100644 >> --- a/libavformat/mov.c >> +++ b/libavformat/mov.c >> @@ -3912,6 +3912,11 @@ static int mov_read_uuid(MOVContext *c, AVIOContext >> *pb, MOVAtom atom) >> 0xbe, 0x7a, 0xcf, 0xcb, 0x97, 0xa9, 0x42, 0xe8, >> 0x9c, 0x71, 0x99, 0x94, 0x91, 0xe3, 0xaf, 0xac >> }; >> + static const uint8_t uuid_spherical[] = { >> +0xFF, 0xCC, 0x82, 0x63, 0xF8, 0x55, 0x4A, 0x93, >> +0x88, 0x14, 0x58, 0x7A, 0x02, 0x52, 0x1F, 0xDD >> +}; >> + >> >> if (atom.size < sizeof(uuid) || atom.size == INT64_MAX) >> return AVERROR_INVALIDDATA; >> @@ -3987,6 +3992,27 @@ static int mov_read_uuid(MOVContext *c, AVIOContext >> *pb, MOVAtom atom) >> av_dict_set(>fc->metadata, "xmp", buffer, 0); >> } >> av_free(buffer); >> +} else if (!memcmp(uuid, uuid_spherical, sizeof(uuid))) { >> +uint8_t *buffer; >> +size_t len = atom.size - sizeof(uuid); >> + >> +buffer = av_mallocz(len + 1); >> +if (!buffer) { >> +return AVERROR(ENOMEM); >> +} >> +ret = avio_read(pb, buffer, len); >> +if (ret < 0) { >> +av_free(buffer); >> +return ret; >> +} else if (ret != len) { >> +av_free(buffer); >> +return AVERROR_INVALIDDATA; >> +} >> +if (c->export_all) { >> +buffer[len] = '\0'; >> +av_dict_set(>fc->metadata, "spherical", buffer, 0); >> +} >> +av_free(buffer); >> } >> return 0; >> } >> -- >> 2.6.3 >> >> ___ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Add support for spherical uuid in mov
If you use "spherical-video" and put it in the stream's metadata, it will more naturally agree with location in stream-level tag in mkv: https://github.com/google/spatial-media/blob/master/docs/spherical-video-rfc.md On Wed, Apr 20, 2016 at 6:24 PM, Colin McFaddenwrote: > --- > libavformat/mov.c | 26 ++ > 1 file changed, 26 insertions(+) > > diff --git a/libavformat/mov.c b/libavformat/mov.c > index 47af98c..2223c81 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -3912,6 +3912,11 @@ static int mov_read_uuid(MOVContext *c, AVIOContext > *pb, MOVAtom atom) > 0xbe, 0x7a, 0xcf, 0xcb, 0x97, 0xa9, 0x42, 0xe8, > 0x9c, 0x71, 0x99, 0x94, 0x91, 0xe3, 0xaf, 0xac > }; > + static const uint8_t uuid_spherical[] = { > +0xFF, 0xCC, 0x82, 0x63, 0xF8, 0x55, 0x4A, 0x93, > +0x88, 0x14, 0x58, 0x7A, 0x02, 0x52, 0x1F, 0xDD > +}; > + > > if (atom.size < sizeof(uuid) || atom.size == INT64_MAX) > return AVERROR_INVALIDDATA; > @@ -3987,6 +3992,27 @@ static int mov_read_uuid(MOVContext *c, AVIOContext > *pb, MOVAtom atom) > av_dict_set(>fc->metadata, "xmp", buffer, 0); > } > av_free(buffer); > +} else if (!memcmp(uuid, uuid_spherical, sizeof(uuid))) { > +uint8_t *buffer; > +size_t len = atom.size - sizeof(uuid); > + > +buffer = av_mallocz(len + 1); > +if (!buffer) { > +return AVERROR(ENOMEM); > +} > +ret = avio_read(pb, buffer, len); > +if (ret < 0) { > +av_free(buffer); > +return ret; > +} else if (ret != len) { > +av_free(buffer); > +return AVERROR_INVALIDDATA; > +} > +if (c->export_all) { > +buffer[len] = '\0'; > +av_dict_set(>fc->metadata, "spherical", buffer, 0); > +} > +av_free(buffer); > } > return 0; > } > -- > 2.6.3 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel