How to use FFMPEG to transcode mp4 video for http stream in Amazon S3?

1

1

I want to use FFMPEG to transcode my mp4 video for http streaming on Amazon S3 without downloading. However, with reference to this post, I still cannot get it streaming:

ffmpeg -i input.avi -c:v libx264 -crf 22 -c:a libfaac -movflags faststart output.mp4

Reference: Creating MP4 videos ready for HTTP streaming

After uploaded to S3 and set it for public, changed content-type to "video/mp4", the video cannot be played as it said the file is corrupted. But if I download the file, it played smoothly. I tried the amzaon Eleastic Transcode, it can play back instantly without download, but the file size was trimmed to 1/10 so quality suffered.

I think there must be something I missed to get it stream via http. can any one help? thanks.

Regards, KC

kclai

Posted 2014-03-31T06:18:51.313

Reputation: 55

1Always post the output on your console as well. That helps everyone to know how ffmpeg is treating your input. What I would try would be to add the parameter -pix_fmt yuv420p to your command line. This is a very common problem because subsampling of 444 or 422 does not work on most players. – Rajib – 2014-03-31T09:52:34.023

I checked the video was in yuv420p format already. I suddenly found that Firefox was causeing the issue: I have no problem with Chrome. So I think it's just a compatibility issue. – kclai – 2014-04-03T01:58:45.913

No answers