Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH v3 4/5] avformat/mov: Add support for exporting Video Extension Usage info
Date: Mon, 17 Jun 2024 17:07:10 -0300
Message-ID: <d38dd63c-99b2-4752-ba29-2e7357ad62ed@gmail.com> (raw)
In-Reply-To: <20240617192019.512769-5-derek.buitenhuis@gmail.com>

On 6/17/2024 4:20 PM, Derek Buitenhuis wrote:
> This box is provided by files created by the Apple Vision Pro, as well
> as the iPhone 15+ when capture for Vision Pro is enabled.
> 
> The boxes are a mix of things documented by Apple in some PDFs, their
> API docs, and reverse engineering. Ideally we will have a real spec
> one day.
> 
> Links:
>    *https://developer.apple.com/av-foundation/Stereo-Video-ISOBMFF-Extensions.pdf
>    *https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_horizontaldisparityadjustment
>    *https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_stereocamerabaseline
>    *https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_heroeye
> 
> Signed-off-by: Derek Buitenhuis<derek.buitenhuis@gmail.com>
> ---
>   libavformat/mov.c | 283 ++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 283 insertions(+)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 9016cd5ad0..5724b4ef93 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -6477,6 +6477,288 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>       return 0;
>   }
>   
> +static int mov_read_vexu_proj(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> +{
> +    AVStream *st;
> +    MOVStreamContext *sc;
> +    int size;
> +    uint32_t tag;
> +    enum AVSphericalProjection projection;
> +
> +    if (c->fc->nb_streams < 1)
> +        return 0;
> +
> +    st = c->fc->streams[c->fc->nb_streams - 1];
> +    sc = st->priv_data;
> +
> +    if (atom.size != 16) {
> +        av_log(c->fc, AV_LOG_ERROR, "Invalid size for proj box: %"PRIu64"\n", atom.size);
> +        return AVERROR_INVALIDDATA;
> +    }
> +
> +    size = avio_rb32(pb);
> +    if (size != 16) {
> +        av_log(c->fc, AV_LOG_ERROR, "Invalid size for prji box: %d\n", size);
> +        return AVERROR_INVALIDDATA;
> +    }
> +
> +    tag = avio_rl32(pb);
> +    if (tag != MKTAG('p','r','j','i')) {
> +        av_log(c->fc, AV_LOG_ERROR, "Invalid child box of proj box: 0x%08X\n", tag);
> +        return AVERROR_INVALIDDATA;
> +    }
> +
> +    avio_skip(pb, 1); // version
> +    avio_skip(pb, 3); // flags
> +
> +    tag = avio_rl32(pb);
> +    switch (tag) {
> +    case MKTAG('r','e','c','t'):
> +        projection = AV_SPHERICAL_RECTILINEAR;
> +        break;
> +    case MKTAG('e','q','u','i'):
> +        projection = AV_SPHERICAL_EQUIRECTANGULAR;
> +        break;
> +    case MKTAG('h','e','q','u'):
> +        projection = AV_SPHERICAL_HALF_EQUIRECTANGULAR;
> +        break;
> +    case MKTAG('f','i','s','h'):
> +        projection = AV_SPHERICAL_FISHEYE;
> +        break;
> +    default:
> +        av_log(c->fc, AV_LOG_ERROR, "Invalid projection type in prji box: 0x%08X\n", tag);
> +        return AVERROR_INVALIDDATA;
> +    }
> +
> +    sc->spherical = av_spherical_alloc(&sc->spherical_size);
> +    if (!sc->spherical)
> +        return AVERROR(ENOMEM);
> +
> +    sc->spherical->projection = projection;
> +
> +    return 0;
> +}
> +
> +static int mov_read_eyes(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> +{
> +    AVStream *st;
> +    MOVStreamContext *sc;
> +    int size, flags = 0;
> +    int64_t remaining;
> +    uint32_t tag, baseline = 0;
> +    enum AVStereo3DView view = AV_STEREO3D_VIEW_PACKED;
> +    enum AVStereo3DPrimaryEye primary_eye = AV_PRIMARY_EYE_NONE;
> +    AVRational horizontal_disparity_adjustment = { 0, 0 };

nit: { 0, 1 }.

Should be ok either way.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2024-06-17 20:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17 19:20 [FFmpeg-devel] [PATCH v3 0/5] Vision Pro Spatial Data Derek Buitenhuis
2024-06-17 19:20 ` [FFmpeg-devel] [PATCH v3 1/5] avutil/spherical: Add more spherical types Derek Buitenhuis
2024-06-17 19:20 ` [FFmpeg-devel] [PATCH v3 2/5] avutil/stereo3d: Fill out stereo info provided by Vision Pro files Derek Buitenhuis
2024-06-17 20:03   ` James Almer
2024-06-17 20:26     ` Derek Buitenhuis
2024-06-17 19:20 ` [FFmpeg-devel] [PATCH v3 3/5] fftools/ffprobe: Print more Stereo 3D info from side data Derek Buitenhuis
2024-06-17 19:20 ` [FFmpeg-devel] [PATCH v3 4/5] avformat/mov: Add support for exporting Video Extension Usage info Derek Buitenhuis
2024-06-17 20:07   ` James Almer [this message]
2024-06-17 20:27     ` Derek Buitenhuis
2024-06-17 20:33       ` James Almer
2024-06-17 20:36         ` Derek Buitenhuis
2024-06-17 19:20 ` [FFmpeg-devel] [PATCH v3 5/5] avformat/mov: Add support for reading and exporting horizontal field of view Derek Buitenhuis
2024-06-18 12:51 ` [FFmpeg-devel] [PATCH v3 0/5] Vision Pro Spatial Data Derek Buitenhuis
  -- strict thread matches above, loose matches on Subject: below --
2024-06-17 13:41 [FFmpeg-devel] [PATCH v2 " Derek Buitenhuis
2024-06-17 13:44 ` [FFmpeg-devel] [PATCH v3 4/5] avformat/mov: Add support for exporting Video Extension Usage info Derek Buitenhuis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d38dd63c-99b2-4752-ba29-2e7357ad62ed@gmail.com \
    --to=jamrial@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git