0
votes

I'm using processor qtfaststart and the gem paperclip-ffmpeg in Rails to convert an mp4 file to either ogg, webm, or flv. However, I haven't had any success converting the mp4 file to these formats for streaming purposes because the moov atom gets dropped (converting mp4 to mp4 keeps its moov atom though*).

I did a $ qtfaststart -l on the original mp4 file and I get this:

ftyp (24 bytes)
moov (5691 bytes)
free (399309 bytes)
mdat (12312760 bytes)

Which shows me that the mp4 file has an moov atom in there. The command that paperclip-ffmpeg is executing is something like this:

$ ffmpeg -i ~/Movies/VID_20140119_134445.mp4 -acodec libvorbis -ac 2 -ab 96k -ar 44100 -s 640x360 -y ~/tmp/iguana.webm

However, doing a qtfaststart on the new file (iguana.webm) I get the following:

$ qtfaststart -l ~/tmp/iguana.webm 
moov atom not found, is this a valid MOV/MP4 file?
Traceback (most recent call last):
File "/usr/local/bin/qtfaststart", line 5, in <module>
pkg_resources.run_script('qtfaststart==1.8', 'qtfaststart')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 489, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1214, in run_script
exec script_code in namespace, namespace
File "/Library/Python/2.7/site-packages/qtfaststart-1.8-py2.7.egg/EGG-INFO/scripts/qtfaststart", line 17, in <module>

File "build/bdist.macosx-10.9-intel/egg/qtfaststart/command.py", line 44, in run
File "build/bdist.macosx-10.9-intel/egg/qtfaststart/processor.py", line 65, in get_index
File "build/bdist.macosx-10.9-intel/egg/qtfaststart/processor.py", line 106, in _ensure_valid_index
qtfaststart.exceptions.FastStartException

I've also tried adding the option -movflags faststart to the command ffmpeg but ffmpeg still keeps dropping the moov atom to the output file.

I'm using Rails 4, paperclip-ffmpeg 1.0.1, ffmpeg 2.1.3 Built on Jan 28 2014. Any help would be greatly appreciated.

1

1 Answers

4
votes

MP4 and MOV are the only formats that use 'atoms'. Hence, qtfaststart should not be used on any other file type.