Using Mpeg4/H.264 output with Sink Writer gives output with frames upside down RRS feed

  • Question

  • I've written a simple application that is based on the Sink Writer sample found here:

    When using the default encoding setup, i.e. with encoding format set to MFVideoFormat_WMV3 and creating a writer based on 'wmv' file extension, I get an output as expected. 

    However, if I change the encoding to MFVideoFormat_H264 and create a sink writer based on a '*.mp4' file name, the output video has the frames flipped upside down. The output file looks otherwise to have been generated as a valid MPEG4/H.264 file.

    EDIT: I get the same flipped effect if I change to MFVideoFormat_H264 in the original sample mentioned.

    Why is this happening - are there any additional settings I need to set to get my MPEG4 frames appear non-flipped ?


    • Edited by LeifO Wednesday, December 19, 2012 9:34 PM
    Wednesday, December 19, 2012 9:27 AM

All replies

  • Well you can always rotate it with transformer, but fact of rotation is quite strange...


    Saturday, December 22, 2012 5:48 AM
  • Hi, 

    Were you able to find the root cause for this issue. I am facing similar issue with SinkWriter, where my H264 encoded videos are vertically flipped but all the other Microsoft encoders like WMV1, WMV2 & WMV3 works fine. I wonder what exactly is causing this issue. I am simply copying the image buffer using MFCopyImage() and passing on the bitmap.scan0 along with its stride. 

    Any help is much appreciated. 



    Wednesday, June 19, 2019 8:25 PM
  • I never had that kind of problem with reading or writing MPEG-4 files.

    Since this forum question is from December 2012, it might have to do with the Windows 8 updates to MPEG-4 source and sink. It falls right within the time of the Windows 8 release ( October 2012 ). The hyperlink in my last sentence directs you to the information about the updates. As you can see, it clearly states that changes were made to handling the rotation angle.

    I hope this information was helpful to you.



    • Proposed as answer by Francis Grave Saturday, June 29, 2019 2:08 PM
    Saturday, June 29, 2019 2:07 PM