[FFmpeg-devel] [RFC/ PATCH] Need suggestion for ROTATION

Tilak Adhya tilakadhya
Wed Nov 28 07:27:54 CET 2007


Hi,

I have added a function for the rotation of frames in ffmpeg, but not getting the exact result.

I have rotated only the luma component by 90 degree but left the Cr and Cb components unchanged.

The command I am using is as follows ---


$ ./ffmpeg -i nbc_320x240.mpeg -vcodec mpeg4 -an -s 240x320 -r 10 -b 37.8kb -f mp4 rotate.mp4
FFmpeg version SVN-r11096, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --enable-pthreads
  libavutil version: 49.5.0
  libavcodec version: 51.48.0
  libavformat version: 52.0.0
  built on Oct 27 2007 19:48:44, gcc: 3.4.4 (cygming special, gdc 0.12, using dm
d 0.125)
Input #0, mpeg, from 'nbc_320x240.mpeg':
  Duration: 00:03:04.9, start: 0.661544, bitrate: 703 kb/s
    Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 320x240 [PAR 200:219 DAR 800
:657], 500 kb/s, 29.97 tb(r)
    Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, stereo, 192 kb/s
File 'rotate.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'rotate.mp4':
    Stream #0.0: Video: mpeg4, yuv420p, 240x320 [PAR 138:85 DAR 207:170], q=2-31
, 37 kb/s, 10.00 tb(c)
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. You may try recompiling using gcc >= 4.2.
Do not report crashes to FFmpeg developers.
frame= 1853 fps=213 q=31.0 Lsize=    2466kB time=185.3 bitrate= 109.0kbits/s

video:2451kB audio:0kB global headers:0kB muxing overhead 0.642224%
$


The input video dimension was 320x240 and I have interchanged and mentioned -s as 240x320. Again the function call rotatePicture(...) is hard coded inside the ffmpeg.c file. So the execution of the above command will definitely execute the rotatePicture(...) function.
But in the output video rotate.mp4 I am not getting the rotated video as expected. Part of the video frames are copied in a single frame and so I don't have the whole video frmae.

The patch is attached with this mail. This can be applied and tested with a sample mpeg video.

Thanks in advance...

Tilak


-------------- next part --------------
A non-text attachment was scrubbed...
Name: luma_90deg_rotation.patch
Type: application/octet-stream
Size: 1189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071128/cfa49e0e/attachment.obj>



More information about the ffmpeg-devel mailing list