View Full Version : [all variants] quicktime compatible AVI
wrathkeg
April 29th, 2009, 12:03 PM
Dear all,
I have a load of AVI files which play on Linux but not on Quicktime or Virtualdub on Windows (long story as to why I need them to do that). It seems the problem is to do with the encoding of the AVI file. Can anyone share a command for ffmpeg (preferred) or mencoder which might generate a Quicktime-compatible AVI file? I've spent hours fiddling with ffmpeg, trying different codecs etc, and can't get anything to work.
TIA,
WK
FakeOutdoorsman
April 29th, 2009, 01:18 PM
What errors do Quicktime and Virtualdub give you? What version of Ubuntu are you using? Provide some info on the non-working videos with FFmpeg:
ffmpeg -i video_file_that_quicktime_hates.avi
bobince
April 29th, 2009, 02:54 PM
What files QT Player and VDub will load depends on what codecs are installed for both QuickTime and VfW/ACM, respectively.
The initial Windows selection of VfW video codecs for AVI includes only ancient and (by modern standards) absolutely terrible codecs like Indeo. They're pretty much only included for legacy compatibility; Microsoft expect you to use WMV for anything serious. You can't really do much with AVI without installing extra codecs. The bulk of AVI you find ‘out there’ at the moment is MPEG4ASP+MP3, aka the DivX/Xvid codecs.
If you must be compatible with vanilla installs of DirectShow and QuickTime pretty much your only option is MPEG-1 (M1V+MP3 in MPEG container). A bit old-school and limited in its resolution as well as quality, but it's much better than any of the AVI codecs you get with Windows. It's also the only non-AVI format that loads into VirtualDub (though VirtualDub-MPEG2, VirtualDubMod and best of all Avidemux have many more options).
If you only need compatibility for vanilla installs of modern QuickTime probably your best bet is MPEG-4 (AVC+AAC in MP4 container).
wrathkeg
April 29th, 2009, 04:02 PM
FakeOutdoorsman: I'm on Ubuntu 8.10. This is the output of 'ffmpeg -i' when run on a file that Quicktime/Virtualdub won't play:
$ ffmpeg -i sample.avi
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Mar 16 2009 21:16:26, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
Input #0, avi, from 'sample.avi':
Duration: 00:00:20.0, start: 0.000000, bitrate: 286 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 352x288, 25.00 fps(r)
Must supply at least one output file
On VirtualDub the error message is
Can't locate decompressor for format 'FMP4' (unknown)
VirtualDub requires a Video for Windows (VFW) compatible codec to decompress video. DirectShow codecs, such as those used by Windows Media Player, are not suitable.
I can't check Quicktime on this machine, but I seem to remember it being along the lines of the VirtualDub message.
bobince: thanks for your excellent explanation. It's clearer than anything I have come across on this topic in the last 3 days. There's quite a bit there for me to digest, but if I get the chance tomorrow I'll try to get ffmpeg to use the codecs you suggest. Of course, if anyone wanted to suggest a ffmpeg command which would do this in the meantime, that'd be great :)
Thanks all,
WK
bobince
April 29th, 2009, 06:42 PM
Ah, FMP4 is another fourcc that just means MPEG-4 Advanced Simple Profile. There was never a standardised fourcc for this format in AVI, so each codec uses its own code unfortunately. This file was probably generated by ffmpeg or mencoder, but it's the same format as Xvid/DivX and either of those codecs will play it if they're registered to.
So if your target machine for playing has any of the MP4ASP codecs installed, you can persuade it to play the file by just changing the fourcc ‘FMP4’ to a more commonly recognised one such as ‘XVID’ or ‘DX50’. This can be done using a ‘fourcc changer’ application (or a plain old hex editor, if you've got one that doesn't mind editing big video files).
Otherwise, conversion as above.
FakeOutdoorsman
April 29th, 2009, 08:39 PM
Perhaps you can change the fourcc with FFmpeg:
ffmpeg -i input.avi -acodec copy -vcodec copy -vtag XVID output.avi
rylleman
April 30th, 2009, 03:28 AM
Quicktime is extremely picky on what it will play. I've spent a great deal of time trying to get quicktime compatible files from linux and have come up with a command that works with mencoder. It produces h.246 mov's;
mencoder input.avi -sws 9 -vf harddup -oac faac -faacopts br=128:mpeg=4:object=2:raw -ovc x264 -x264encopts bitrate=6000:keyint=25:vbv_maxrate=8000:vbv_bufsiz e=2000:nocabac:level_idc=13:global_header -of lavf -lavfopts format=mov -o output.mov
With ffmpeg I couldn't get quicktime files without some audio/video sync issues and Avidemux can't produce any quicktime compliant mov's whatsoever.
wrathkeg
April 30th, 2009, 04:51 AM
thanks for all this, guys. I'll try to wade through all this great advice you've given, and post back.
wk
FakeOutdoorsman
April 30th, 2009, 01:39 PM
...
With ffmpeg I couldn't get quicktime files without some audio/video sync issues and Avidemux can't produce any quicktime compliant mov's whatsoever.
Did you try the libx264 presets in FFmpeg?
HOWTO: Install and use the latest FFmpeg and x264 (http://ubuntuforums.org/showthread.php?t=786095)
wrathkeg
May 11th, 2009, 11:20 AM
thanks to everyone who gave me info on this. It turned out that I could do what I ultimately wanted (create a split screen file from some AVIs) using Cinelerra. Quite a steep learning curve (and I'm still climbing), but worthwhile, I think. I can then render these in Cinelerra as Quicktime for Linux MOVs, and then use ffmpeg to output MOVs which will play in Quicktime. Thanks again for all of your explanations: they really helped me (begin) to understand where things were going wrong.
wk
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.