Thursday, May 1, 2008

Fixing youtube flv's to make them streamable through FMS (flash media server)

FLV's available on youtube are not streamable through Flash Media Server. They will play fine using vlc player or other tools, but as soon as FMS tries to stream these,  the requesting client will be disconnected.
This happens because the metadata tag is not correctly formed. In the following post i'll show how to correct such files.

Step 1. Add 6 to the metadata tag's size field.
  • Size of the metadata tag is written 3 bytes, starting from the 15th byte. This is an integer stored in big endian format. Replace this size by size + 6. (in big endian).
Step 1: Location of the size field
        
Step 1: Size field after adding 6 to it


Step 2: Add 6 bytes at the end of the metadata tag.
  • To reach boundary of the end of metadata and the starting of the first tag, search for the following hex string '0x00 0x00 0x00 0x00 0x08'. The first 4 bytes are the end of the metadata tag (called the 'previous tag size') and '0x08' is the starting of the next tag.

Step 2: Search the end of the metadata tag.
  • Insert 6 bytes (0x00 0x00 0x09 0x00 0x00 0x09) before this. These are the 'object end markers'.

Step 2: Add the 'object end markers'


Step 3: Correct the 'previous tag size', for the metadata tag. This should contain a value = new metadata size + 11. This should be an integer and should be written in big endian.

Step 3: Correct the 'previous tag size'.

That's it!

4 comments:

Lonely Anthony said...

Hello

anonymous said...

Thanks a lot !!!

Andy said...

Replay Media Catcher already cracked RTMPE encryption.

Paarijaat Aditya said...

Replay hasn't cracked RTMPE, it has found a way to access flash player's memory where it can find unencrypted data. They are NOT decrypting the packets beings sent over the network.