Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avformat/matroskaenc: Fix writing AV_SPHERICAL_EQUIRECTANGULAR
@ 2022-01-20 16:43 Andreas Rheinhardt
  2022-01-20 17:30 ` Hendrik Leppkes
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Rheinhardt @ 2022-01-20 16:43 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

According to the documentation, the ISOBMFF 'equi' box must
be present for equirectangular projections.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/matroskaenc.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 8c10a8c133..38d9485288 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1305,17 +1305,21 @@ static void mkv_write_video_projection(AVFormatContext *s, EbmlWriter *writer,
 
     switch (spherical->projection) {
     case AV_SPHERICAL_EQUIRECTANGULAR:
-        ebml_writer_add_uint(writer, MATROSKA_ID_VIDEOPROJECTIONTYPE,
-                             MATROSKA_VIDEO_PROJECTION_TYPE_EQUIRECTANGULAR);
-        break;
     case AV_SPHERICAL_EQUIRECTANGULAR_TILE:
         ebml_writer_add_uint(writer, MATROSKA_ID_VIDEOPROJECTIONTYPE,
                              MATROSKA_VIDEO_PROJECTION_TYPE_EQUIRECTANGULAR);
         AV_WB32(private,      0); // version + flags
-        AV_WB32(private +  4, spherical->bound_top);
-        AV_WB32(private +  8, spherical->bound_bottom);
-        AV_WB32(private + 12, spherical->bound_left);
-        AV_WB32(private + 16, spherical->bound_right);
+        if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR) {
+            AV_WB32(private +  4, 0);
+            AV_WB32(private +  8, 0);
+            AV_WB32(private + 12, 0);
+            AV_WB32(private + 16, 0);
+        } else {
+            AV_WB32(private +  4, spherical->bound_top);
+            AV_WB32(private +  8, spherical->bound_bottom);
+            AV_WB32(private + 12, spherical->bound_left);
+            AV_WB32(private + 16, spherical->bound_right);
+        }
         ebml_writer_add_bin(writer, MATROSKA_ID_VIDEOPROJECTIONPRIVATE,
                             private, 20);
         break;
-- 
2.32.0

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avformat/matroskaenc: Fix writing AV_SPHERICAL_EQUIRECTANGULAR
  2022-01-20 16:43 [FFmpeg-devel] [PATCH] avformat/matroskaenc: Fix writing AV_SPHERICAL_EQUIRECTANGULAR Andreas Rheinhardt
@ 2022-01-20 17:30 ` Hendrik Leppkes
  0 siblings, 0 replies; 2+ messages in thread
From: Hendrik Leppkes @ 2022-01-20 17:30 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Thu, Jan 20, 2022 at 5:44 PM Andreas Rheinhardt
<andreas.rheinhardt@outlook.com> wrote:
>
> According to the documentation, the ISOBMFF 'equi' box must
> be present for equirectangular projections.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavformat/matroskaenc.c | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
>

LGTM
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-20 17:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 16:43 [FFmpeg-devel] [PATCH] avformat/matroskaenc: Fix writing AV_SPHERICAL_EQUIRECTANGULAR Andreas Rheinhardt
2022-01-20 17:30 ` Hendrik Leppkes

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