Log in

View Full Version : RealVideo from XCD


wonderbread
18th August 2002, 20:45
Hello, this is my first post here, so I'll try to make it a decent one =]
I've downloaded the RealSystem SDK and have modified the example file system plugin to be able to read realvideo files from a mode2cd. I have no webspace at the moment, so I'm going to attach "fileobj1.txt" which replaces "fileobj1.cpp" from the samples\intro\filesys1 directory of the helix SDK you can download from http://www.realnetworks.com/
In addition to replacing this file, you will have to add the definition
typedef struct
{
char head[24];
char data[2324];
char tail[4];
} m2block;
in a file called "mode2cd.h"

Once compiled, the .dll goes into Program Files\Common Files\Real\plugins, and you can open any file in the mode2cd format by typing mode2://d:\yourfile.dat into the file->open dialog of realplayer.
I'll go and sign up for some free webspace, and see about getting a binary posted there. Hope this is interesting for you guys who like RV and XCD =]

edit: I'm grammar-riffic!

avih
18th August 2002, 21:37
i'm not using 'real' but that's extremely cool. thx :)

wonderbread
18th August 2002, 21:41
I've realized that I do in fact have webspace =]
http://www.skidmore.edu/~o_hofman/Mode2Real.dll

there's the file

Koepi
18th August 2002, 22:01
which parts of a real stream must be saved to make it play even if there is information lost?

Regards,
Koepi

wonderbread
18th August 2002, 22:22
I'm not sure exactly. Based on debugging this little hack, reading a 1000kpbs vbr, video-only file, it appears that information about the file is stored at the beginning, up until the string "DATA" After that, realplayer for the most part alternates between reading 12 bytes and reading ~1300 bytes. I'm guessing that the 12 bytes is the important part. I'll try introducing random errors into different parts of the file, and see if realplayer dies or not.

Koepi
18th August 2002, 22:28
RealVideo is designed for streaming media, so it won't die for sure. Those 12 bytes are just "sync" information with some more information about the pakets (serial number, maybe even time stamp,...).

Ok, I'll simply search for "data" and store up everything till then :)

Best regards,
Koepi

wonderbread
18th August 2002, 22:57
Reading the Realsystem SDK, I find:
The data section of a RealMedia file consists of a series of interleaved data objects. Each data object contains a packet of data for a media stream. Because a RealMedia file can contain numerous media streams, data objects for each stream are interleaved. The following pseudo-structure describes the details of each interleaved packet:


Media_Packet_Header
{
UINT16 object_version;

if (object_version == 0)
{
UINT16 length;
UINT16 stream_number;
UINT32 timestamp;
UINT8 reserved;
UINT8 flags;
UINT8[length] data;
}
}


I confirmed this through testing, as changing any of the first 8 bytes in the 12 byte reads resulted in the stream stopping, while the next four only corrupted the video. After the 12-byte read, the realplayer then reads the data size specified in the header minus 12 bytes. Wash, rinse, repeat for the rest of the file.

slavickas
1st September 2002, 20:30
Originally posted by Koepi
which parts of a real stream must be saved to make it play even if there is information lost?

Regards,
Koepi

Save headers at beginning till DATA tag and indexes which are at end starting at first INDX tag. for more info look at ffmpeg's libav rm
(de)muxer