MPEG4 .avi file is created, but cannot be played.
Question
I'm having a problem when Motion creates mpeg files. They cannot be opened using Windows Media Player or Winamp's Video Player. I've tried to use the msmpeg4 option in motion.conf, but the result was the same.
Windows Media Player 10 states: Windows Media Player cannot play the file. The Player might not support the file type or might not support the codec that was used to compress the file.
JPEG files are being created without any issues.
I've tried a few versions of ffmpeg, with the current version being ffmpeg-0.4.9-0.20050427.1.1.fc3.
Environment
Motion version: |
3.2.1 |
ffmpeg version: |
ffmpeg-0.4.9-0.20050427.1.1.fc3 |
Libraries: |
ffmpeg, mysql |
Server OS: |
Fedora Core 3 |
--
AndyRamberg - 14 Jul 2005
Answer
Can you post your motion.conf file please? I need that to give an better answer.
Remember that
- Only msmpeg4 can be played by Windows without installing extra codecs.
- An event must be over (gap period expired after last motion) so that Motion closes the mpeg file properly before you try viewing it. If you choose a gap value of 0 Motion never closes the file unless it is being told to by remote control.
--
KennethLavrsen - 15 Jul 2005
Are you sure that the event is over (no more Motion) when you try to view the file?
And you did not kill Motion while it has these files open?
Can you attach an example of an mpeg that cannot be played?
--
KennethLavrsen - 20 Jul 2005
(on vacation may take a while for next answer)
The motion process is still running when I do a ps, and Motion is already creating the next MPEG file before I open the previous one for viewing.
A sample .avi has been uploaded.
--
AndyRamberg - 21 Jul 2005
I just tried playing it with mplayer, and mplayer calls it:
VIDEO: [H263] 640x480 24bpp 2.000 fps -17179870.0 kbps (-2097152.0 kbyte/s)
I am not really sure what H263 is, but it also looks like the video wasn't 'finalized' since there are those strange kbps numbers. My mpeg4 videos are identified like this:
VIDEO: [DIVX] 320x240 24bpp 5.000 fps 409.1 kbps (49.9 kbyte/s)
I use ffmpeg-0.4.9-pre1
--
AndrewHamilton - 23 Jul 2005
I have tried to use ffmpeg-0.4.9-pre1 but keep getting Segmentation faults.
Is there something in my config file that could cause this?
--
AndyRamberg - 26 Jul 2005
--
PhilipWalden - 30 Jul 2005
I too have the same problem and have set ffmpeg_video_codec to msmpeg4 so as to view the movie with windows realplay and media player. I have noticed that my linux mplayer has no problem playing the current motion event active avi file, but both windows media player and realplay refuse to play it. They both act as if the avi is a 0 frames long. I know nothing of avi format, but they act as if the header information tells them there are no frames. Maybe mplayer ignore the header and plunges ahead showing the movie? After motion has started the next motion event avi, the windows players can play the file. Seems like the header is correct at that point.
--
PhilipWalden - 30 Jul 2005
For avi files, both a header and a trailer are used. The trailer is written when the avi is finalized, and without it, I guess Windows Media Player can't play the file.
--
AndrewHamilton - 31 Jul 2005
It is strange where the H263 comes from. Probably som intermediate ffmpeg version.
The ffmpeg guys made a change early 2005 where the so called FOURCC code changed from DIVX to FMP4. This means that the mpeg4 codec from ffmpeg is not at all compatible with Windows Media Player with the normal codecs like XVID that worked before.
There are two fixes. Either use the codec msmpeg4 which uses a different FOURCC code. Or install a recent development ment version of ffdshow.
http://ffdshow.sourceforge.net/tikiwiki/tiki-index.php?page=Getting+ffdshow
More info here
http://kino.schirmacher.de/dcforum/dcforum?az=show_topic&forum=101&topic_id=3194&mesg_id=3194
and here
http://itdp.fh-biergarten.de/~itdp/html/mplayer-users/2005-03/msg00069.html
and here
http://corecodec.org/tracker/index.php?func=detail&aid=295&group_id=53&atid=285
And still - remember that Motion must end an event and not have been killed with kill -s 9 so that the mpeg is properly closed. Otherwise no player can show it.
Kenneth
--
KennethLavrsen - 02 Aug 2005
FWIW, I had the exact same config and problem. I found the 20041110 version of ffmpeg and installed it, and the msmpeg4 (avi) files can be played just fine in Windows Media Player now. I found the file at:
http://dag.wieers.com/packages/ffmpeg/?D=A
Have fun, Woody
--
WoodySturges - 03 Aug 2005
Has anybody succeeded so far in watching the recorded movies (mpeg4 not msmpeg4) in
QuickTime Pro on a Mac? VLC runs just fine, but it would be great to be able to watch the movies directly in the Browser window.
--
FlorianBeer - 16 May 2006
You could try applying the attached patch 'ffmpeg_mov.patch' (it is against motion-3.2.6), and change the video codec in your motion.conf to 'mov'. I haven't tested this patch with quicktime, but it is worth a shot.
--
AndrewHamilton - 16 May 2006
If this patch gets good feedback and it works I will be happy to implement it.
I changed the state of this report to assigned so it appears on my radar screen.
--
KennethLavrsen - 16 May 2006
Well, now that I have tested this with a CVS version of FFMpeg and can say that it doesn't work at all. Quicktime plays only garbage. Sorry.
--
AndrewHamilton - 16 May 2006
But my Quicktime plays almost all possible Videos, which strange codec does ffmpeg use in that case? There must be some
QuickTime component (=decoder) that is capable of playing back those movies.
--
FlorianBeer - 17 May 2006
Mac users can download the free Divx plugin at
http://www.divx.com so that Quicktime can play motion avi files. Tested on Mac OS 10.4.8 with Quicktime 7.1.5.
--
JakePunk - 13 Mar 2007
Actually, with
DivX loaded on OS 10.5.1 and Quicktime 7.3.1 you only get a white screen, no video at all. My experiences in linux with ffmpeg vs. mencoder has always found me cursing ffmpeg's shortcomings. If mpeg1 had been left in, viewing on a Mac would be trivial. ffmpeg's mpeg4 encoding requires a very specific planetary alignment before Quicktime can decode the video. >.<
--
JasonWestervelt - 23 Dec 2007
Attached a corrected patch of Andrew to be applied against current svn -r292
--
AngelCarpintero - 01 Jan 2008
Committed to svn r294
--
AngelCarpintero - 06 Jan 2008