1

We have a flash web-app that created interactive video, and are using ffmpeg to do some compression/resizing when a user "publishes" their project.

The user can upload flv files and mp4 files, both of which play fine in the Flash UI before publishing. After publishing the flv files work fine, but the mp4 files will not play in the flash player: Audio will play but video won't.

The mp4 files will play fine if I download them and play them in the Quicktime player but if I attempt to open them in the Adobe Media Player it reports "The media file does not contain a supported video track".

If I open the Movie inspector in quicktime it tells me that the original file is an "h264" video and the ffmpeg-processed ones are "mpeg-4".

I have tried forcing it to h264 by adding flags like -f h264 and -vcodec h264 but I get a screenfull of errors (no frame, illegal POC type, sps_id out of range) ending with Could not find codec parameters (Video: h264)

h264 will show up if I run ffmpeg -formats and ffmpeg -codecs, and as I said it will play fine in Quicktime.

Is there anything else I need to do to convince the flash player to play them? Is there anything else I need to tell you about the server that will help?

Andrew Fulton
  • 123
  • 1
  • 4

2 Answers2

0

When I'm generating MPEG4 video files with ffmpeg, I use -vcodec libx264. The appropriate -f parameter depends on what your flash player can accept.

Please note that this question is off-topic on serverfault.com; you may want to ask questions about ffmpeg usage on the ffmpeg-user mailing list.

justarobert
  • 1,869
  • 13
  • 8
  • off topic? I am half expecting the actual answer to be that I need to recompile something, so figured this would be a place to ask. Didn't really seem like a Stack overflow/programming question. But thanks for answering anyhow. – Andrew Fulton Apr 07 '11 at 03:21
  • Does that codec work for you? If not, what flash player are you using, and what command-line arguments do you pass to `ffmpeg`? – justarobert Apr 07 '11 at 07:22
  • `-vcodec libx264` hadn't worked previously, but now it is giving me a sensible error message rather than freaking out entirely (broken default settings, telling me to use a -vpre preset). Not sure what I changed. Does order of command-line arguments matter? – Andrew Fulton Apr 08 '11 at 03:46
  • I haven't known order to matter here, but I am not an `ffmpeg` expert. The presets available to you by default will be in `/usr/share/ffmpeg` if you installed from a package. For example, `-vpre fast` corresponds to the file `libx264-fast.ffpreset`. – justarobert Apr 08 '11 at 09:35
0

Here you find a very complete Guide How To compile ffmpeg for MP4 X264 encoding on Ubuntu:

http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide

It also figures out how to add additional Settings/Tools for Streaming e.g qt-faststart

W0bble
  • 245
  • 4
  • 14
  • Please don't just add a link. Put the summary here, and the link for reference. If the link dies, so does your answer... – ThoriumBR Oct 23 '17 at 21:01