<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.17063" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>----- Original Message ----- </DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=alexcohn@netvision.net.il 
  href="mailto:alexcohn@netvision.net.il">Alex Cohn</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=libav-user@ffmpeg.org 
  href="mailto:libav-user@ffmpeg.org">This list is about using libavcodec, 
  libavformat,libavutil libavdevice and libavfilter.</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, July 26, 2013 3:01 PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Libav-user] Some input 
  files decoded upside down.</DIV>
  <DIV><BR></DIV>
  <P dir=ltr>On Jul 26, 2013 9:53 PM, "Jason Cipriani" <<A 
  href="mailto:jason.cipriani@gmail.com">jason.cipriani@gmail.com</A>> 
  wrote:<BR>><BR>> On Fri, Jul 26, 2013 at 2:40 PM, Alex Cohn <<A 
  href="mailto:alexcohn@netvision.net.il">alexcohn@netvision.net.il</A>> 
  wrote:<BR>>><BR>>> On Jul 23, 2013 7:52 PM, "Jason Cipriani" 
  <<A href="mailto:jason.cipriani@gmail.com">jason.cipriani@gmail.com</A>> 
  wrote:<BR>>> ><BR>>> > Hello,<BR>>> ><BR>>> 
  > I'm learning how to use libav. I'm following the tutorial at <A 
  href="http://dranger.com/ffmpeg/tutorial01.html">http://dranger.com/ffmpeg/tutorial01.html</A> 
  and have been able to read files, decode them, and save each frame to an image 
  just fine. However, certain input files lead to the frames being decoded 
  upside down (the input files play correctly in, say, mplayer). <BR>>> 
  ><BR>>> > I have one input file that uses a rawvideo codec. This 
  is decoded upside down. I have another input file that uses h264, this is 
  decoded in the correct orientation.<BR>>> ><BR>>> > My 
  question is, is there a flag in some *Context somewhere that indicates that 
  the video frames are bottom-up, so that I can flip vertically if necessary 
  when processing the frames after decoding?<BR>>> ><BR>>> > 
  Also, then, it's easy enough for me to process an image upside down if 
  necessary, but can sws_scale (or something similar) flip an image vertically 
  so I can do the flip and RGB conversion all in one step?<BR>>> 
  ><BR>>> > Thanks!<BR>>> > Jason<BR>>><BR>>> 
  Yes, you can perform flip and color conversion in one step with sws_scale. You 
  can find the answer in this thread: <A 
  href="http://ffmpeg-users.933282.n4.nabble.com/Flip-in-sws-scale-td939665.html">http://ffmpeg-users.933282.n4.nabble.com/Flip-in-sws-scale-td939665.html</A><BR>>><BR>>> 
  BR, <BR>>> Alex<BR>>><BR>>><BR>><BR>><BR>> Thanks! 
  That answers my sws_scale question.<BR>><BR>> My remaining problem is: 
  How can I tell if the video needs to be flipped vertically or not? Is there a 
  flag in one of the context structures somewhere? I have some input files that 
  end up vertically flipped, and some that do not, but I'm sure the information 
  exists somewhere because when I play those files in media players, the players 
  are able to play them all in the correct orientation.<BR>><BR>> Thanks 
  again for your time,<BR>> Jason</P>
  <P dir=ltr>The linesize [] parameter should contain a negative value 
  indicating image is flipped</P></BLOCKQUOTE></BODY></HTML>