Hello, I have been trying to use openRTSP (from liveMedia dated 2010.12.05) to record clips from an IP camera that supports RTSP streaming of MPEG-4 clips, but the recorded clips would not play back in Quicktime 7.6.8 (1675) on Windows. For .mov files (recorded with -q) the clip would appear to play (progress bar would move) but the video content is a blank/white image, for .mp4 files (recorded with -4) Quicktime would refuse to load the clip reporting "Error -2010: the movie contains some invalid data ()".
I discovered that simply "re-packaging" the clip without any re-encoding of the actual stream using "mencoder" resulted in files that would play without issue. After analyzing the differences in the files produced by openRTSP & mencoder I have been able to come up with the attached minimal patch to change the "magic bytes" recorded in the esds atom, and with this patch applied openRTSP will record files (.mov or .mp4) that Quicktime is able to play without any further changes. One other difference I noticed is that the mencoded file does not seem to have the 0-word in the file after the esds atom, but I saw no difference in compatibility with Quicktime when removing that from QuickTimeFileSink.cpp (line 1929), so this patch does not touch that. Regards, Stu.
diff -up ./liveMedia/QuickTimeFileSink.cpp.orig ./liveMedia/QuickTimeFileSink.cpp --- ./liveMedia/QuickTimeFileSink.cpp.orig 2010-12-31 13:56:24.000000000 +0000 +++ ./liveMedia/QuickTimeFileSink.cpp 2011-01-04 20:37:55.936331221 +0000 @@ -1782,8 +1782,8 @@ addAtom(esds); } else if (strcmp(subsession.mediumName(), "video") == 0) { // MPEG-4 video size += addWord(0x00000000); // ??? - size += addWord(0x03370000); // ??? - size += addWord(0x1f042f20); // ??? + size += addWord(0x03330000); // ??? + size += addWord(0x1f042b20); // ??? size += addWord(0x1104fd46); // ??? size += addWord(0x000d4e10); // ??? size += addWord(0x000d4e10); // ???
_______________________________________________ live-devel mailing list live-devel@lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel