MPEG_SYS Apr 25 1995 Analyzing and Converting Tool for MPEG System Layer Streams. See in the source code for copyrights. The TTP executable was compiled with Pure-C and should run on all Atari TOS machines. The source was also compiled with GNU-C on a SUN-SPARCstation and worked well, so it should also be portable to other systems. Note, that I replaced the standard library file i/o by much more efficient schemes for better dealing with large streams. Usage: mpeg_sys [-l] input [output] option -l: Put logging of system layer parsing to stdout. This causes all logging information to be displayed onto screen (redirect it to a file if you want). The output is very detailed and therefore may become very large, so better leave this option off in normal cases (especially for large input streams). It should only be useful if errors are detected in normal run. input: MPEG System Layer Stream. This is the MPEG source stream. The program first checks if it is an MPEG system layer stream or not and displays the result. If the check failes, execution is cancelled. This is also the case for pure MPEG video streams, since this is only a system layer parser. If it is a system layer stream, parsing is done, and success or failure is displayed at the end. Finally, some statistics are shown. output: MPEG Video Stream extracted from input. If this parameter is given, the video packets parsed off the input stream are written into the output file. This will generate a pure MPEG video stream, which can be processed by normal MPEG video players. On Atari, these are 1STGUIDE (all machines, all frame types) and MPEGDSP (Falcon-030 only, I-frames only), both from the author of this utility. Current versions of these programs, however, directly support MPEG system layer streams. Of course, the output file might become very large for large input streams, so make sure you have enough disk space. The program will display error messages, however, if output writing failes. If you are not sure to have enough room, you may run the program without specifying an output first. After parsing you will see the number of video bytes found (last line). This is exactly the size of the output file if it is written! Note: If the input stream should contain more than one video stream, only the first stream found is processed. Updates: Increased portability: The source should now run on any UNIX system using the GNU-C or a similar ANSI-C compiler. I used it on a SUN-SPARCstation without any problem. Feb 11 1995: I got some 'suspicious' streams with video/audio packets having IDs not defined in a system header. These caused MPEG_SYS writing zillions of "Unknown packet type..." messages and finding 0 video bytes. So I extended the ReadPacket function to additionaly check for video/audio-IDs as normally done in ReadSystemHeader, and to set the global stream-IDs and continue in the same way as with IDs found in a system header before. This seems to work well. Warnings are given to inform the user about this case. Thanks to Dieter Fiebelkorn for data material and hints! Jan 17 1995: First release. If you find bugs or have ideas for extentions, please let me know...