Domanda

I'm using ffmpeg to create a MOV file from a series of images. When I view the movie in Quicktime 7.7.x, it looks great (left image). When I view in Quicktime 7.6.6 I get this weird issue (on the right):

In Quicktime 7.7.x http://jimlindstrom.com/stills-good.png In Quicktime 7.6.6 http://jimlindstrom.com/stills-bad.png

Any idea even what this is, much less how to fix it?

Details

My source images are a mix of PNGs and JPGs that I pre-process with ImageMagick (to draw text, captions, etc). I store intermediate results as MPCs, and final frames as PNMs.

To draw the above frame, I'm doing this:

convert -background none -fill white -font my_font.ttf -pointsize 132 -gravity \
        center -size 945x550 caption:"Stills Demo" background-template.png     \
        +swap -composite -resize 1920x1080! /tmp/title_screen4338355.png
convert -auto-orient /tmp/title_screen4338355.png -resize 100% -type TrueColor \
        /tmp/1b2764754ce6e420986ed74b942bcf67.mpc
convert /tmp/1b2764754ce6e420986ed74b942bcf67.mpc -set option:distort:viewport \
        1920x1080+0+0  +distort SRT '960.0,540.0 1.0 0 960.0,540.0'            \
        /tmp/stills-project-6224/video_frames/img_0000.pnm

I render frames with ffmpeg like so:

ffmpeg -y -f image2 -i /tmp/stills-project-6224/video_frames/img_%04d.pnm      \
       -i /tmp/soundtrack_8702693.wav -vcodec libx264 -pix_fmt yuvj444p        \
       -b:v 2200k  -r 25 -strict experimental                                  \
       /tmp/stills-project-6224/video_rendered/output.mov

The rest of the video is fine. The other images are photos (jpgs or pngs) that I process in the same way. I have also noticed that if I don't apply text to this background-template, the image shows up fine, so I think the issue has something to do with either how I'm processing or saving that image.

È stato utile?

Soluzione

Solved this myself. It had nothing to do with the ImageMagick parts of this post, I was just using ffmpeg incorrectly. I am now calling it like so:

ffmpeg -y -f image2 -i /tmp/stills-project-6723/video_frames/img_%04d.pnm \
       -i /tmp/soundtrack_9080161.wav -c:v libx264 -preset slow -crf 22   \
       -pix_fmt yuv420p -r 25 -strict experimental                        \
       /tmp/stills-project-6723/video_rendered/output.mov

and it works like a charm.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top