From 193d415c5b6f29be8f75839d5be4a5ca03bbac10 Mon Sep 17 00:00:00 2001
From: Ilya Shcherbak <i.shcher...@corp.vk.com>
Date: Thu, 6 Sep 2018 18:30:20 +0300
Subject: [PATCH] Added rotation override for encoding case

---
 fftools/ffmpeg.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 934dc71a74..ac1972eb94 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3573,6 +3573,11 @@ static int init_output_stream(OutputStream *ost, char 
*error, int error_len)
                 memcpy(dst, sd->data, sd->size);
                 if (ist->autorotate && sd->type == AV_PKT_DATA_DISPLAYMATRIX)
                     av_display_rotation_set((uint32_t *)dst, 0);
+
+                if (ost->rotate_overridden) {
+                    if (sd->type == AV_PKT_DATA_DISPLAYMATRIX)
+                        av_display_rotation_set((uint32_t *)dst, 
-ost->rotate_override_value);
+                }
             }
         }
 
-- 

> 6 сент. 2018 г., в 18:42, Ilya Shcherbak <tthr...@gmail.com> написал(а):
> 
> Currently there is ignoring "rotate" flag in metadata for the case when 
> encoding is needing. The patch is propagating this flag to destination video.
> i.g.:
> ffmpeg -noautorotate -i input.mp4 -metadata:s:v:0 rotate=0 -vcodec libx264 
> output.mp4
> 
> this patch is allow us to do things like this: skip rotation flag and encode 
> video as is and mark it as a normal video without rotation.
> 
> Best,
> Ilya.
> <0001-Added-rotation-override-for-encoding-case.patch>

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to