ffmpeg - creating DNxHD MFX files with alphas

1

1

I'm struggling with something in FFMpeg at the moment...

I'm trying to make DNxHD 1080p/24, 36Mb/s MXF files from a sequence of PNG files.

My current command-line is:

ffmpeg -y -f image2 -i /tmp/temp.%04d.png -s 1920x1080 -r 24 -vcodec dnxhd -f mxf -pix_fmt rgb32 -b 36Mb /tmp/temp.mxf

To which ffmpeg gives me the output:

Input #0, image2, from '/tmp/temp.%04d.png':
  Duration: 00:00:01.60, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: png, rgb32, 1920x1080, 25 tbr, 25 tbn, 25 tbc
Output #0, mxf, to '/tmp/temp.mxf':
    Stream #0.0: Video: dnxhd, yuv422p, 1920x1080, q=2-31, 36000 kb/s, 90k tbn, 24 tbc
Stream mapping:
  Stream #0.0 -> #0.0
[mxf @ 0x1005800]unsupported video frame rate
Could not write header for output file #0 (incorrect codec parameters ?)

There are a few things in here that concern me:

  • The output stream is insisting on being yuv422p, which doesn't support alpha.
  • 24fps is an unsupported video frame rate? I've tried 23.976 too, and get the same thing.

I then tried the same thing, but writing to a quicktime (still DNxHD, though) with:

ffmpeg -y -f image2 -i /tmp/temp.%04d.png -s 1920x1080 -r 24 -vcodec dnxhd -f mov -pix_fmt rgb32 -b 36Mb /tmp/temp.mov

This gives me the output:

Input #0, image2, from '/tmp/1274263259.28098.%04d.png':
  Duration: 00:00:01.60, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: png, rgb32, 1920x1080, 25 tbr, 25 tbn, 25 tbc
Output #0, mov, to '/tmp/1274263259.28098.mov':
    Stream #0.0: Video: dnxhd, yuv422p, 1920x1080, q=2-31, 36000 kb/s, 90k tbn, 24 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=   39 fps=  9 q=1.0 Lsize=    7177kB time=1.62 bitrate=36180.8kbits/s    
video:7176kB audio:0kB global headers:0kB muxing overhead 0.013636%

Which obviously works, to a certain extent, but still has the issue of being yuv422p, and therefore losing the alpha.

If I'm going to QuickTime, then I can get what I need using Shake, but my main aim here is to be able to generate .mxf files.

Any thoughts?

Thanks

Hugh

Posted 2010-05-19T13:29:45.597

Reputation: 1 131

Answers

0

First let me thank you for this post because it actually helped me get some instructions on how to encode to a DNxHD quicktime in ffmpeg. I was trying to convert J2K MXF into DNxHD.

As for generating mxf files with correct parameters, have you tried running your png sequence through the latest version of Avid Metafuze? It offers a lot of flexibility with these things. I've created wonderful 1080p 24fps DNxHD mxf from DPX file sequences. Metafuze supports png sequences as well. Load the sequence, edit the LUT, enter your metadata, generate an ALE and you're good to go.

If you are a Linux user, it runs seamlessly on Linux through Wine.

Vijay

Posted 2010-05-19T13:29:45.597

Reputation: 1

1Hi, Thanks for the suggestion. I'm actually after something that can run completely command-line, which I don't believe MetaFuze does. (I've not used it myself, but some of my colleagues have) – Hugh – 2010-10-17T17:17:26.823