[MPlayer-dev-eng] [PATCH] demux lavf: Print rotate information as identify msg

Xidorn Quan quanxunzhen at gmail.com
Fri Nov 16 02:37:37 CET 2012


Hi,

This patch print rotate information in metadata of mov file as
identify message with tag "ID_VID_<vid>_ROTATE" to enable frontends
to rotate the video themselves. I'm not sure if adding such output
will break something, so I sent this patch here. Please comment.

I tried to make mplayer automatically rotate video according to this
information by inserting vf like vf_ass, but I found that vf_rotate
is too tricky to be used here: it can only rotate 90 and 270, but
the angle may be 90, 180, or 270. I don't have any idea of the right
way to implement this feature. Any suggestion?

Regards,
Xidorn Quan
-------------- next part --------------
Index: libmpdemux/demux_lavf.c
===================================================================
--- libmpdemux/demux_lavf.c	(revision 35420)
+++ libmpdemux/demux_lavf.c	(working copy)
@@ -280,6 +280,7 @@
     int stream_id;
     AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
     AVDictionaryEntry *title= av_dict_get(st->metadata, "title",    NULL, 0);
+    AVDictionaryEntry *rot  = av_dict_get(st->metadata, "rotate",   NULL, 0);
     int g;
 
     switch(codec->codec_type){
@@ -399,6 +400,8 @@
             sh_video->i_bps=codec->bit_rate/8;
             if (title && title->value)
                 mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VID_%d_NAME=%s\n", priv->video_streams, title->value);
+            if (rot && rot->value)
+                mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VID_%d_ROTATE=%s\n", priv->video_streams, rot->value);
             mp_msg(MSGT_DEMUX,MSGL_DBG2,"aspect= %d*%d/(%d*%d)\n",
                 codec->width, codec->sample_aspect_ratio.num,
                 codec->height, codec->sample_aspect_ratio.den);


More information about the MPlayer-dev-eng mailing list