Tuesday, June 23, 2009

ASF: we need a parser

While developing rtpasfpay I found out that I can't just do (in gst-launch syntax):

somesrc ! asfmux ! rtpasfpay ! udpsink

because the ASF headers need to be updated after the stream ends and those values are needed by rtpasfpay.

Additionally, I can't get an ASF from a file and feed it to rtpasfpay because the buffers would be unaligned with the ASF objects and packets, requiring rtpasfpay to parse the data before doing anything related to RTP. I'd say we need a parser.

The idea is to do all the parsing at the parser (obvious) and only some checks of conformance at the rtp payloader. As I had already started developing the payloader, I took it as farther as I could (without using a parser) and its current state is now at the repository. It is still unfinished (read: doesn't work).

The parser
Now I'm starting to develop the asfparse element. ASF files have 3 main parts: first there are headers, then the data (where the packets are) and lastly a series of indexes objects. The parser would, sequentially:
  1. Group all the headers into a single buffer and push it
  2. Push the "Data object" header (everything but the packets)
  3. Put each packet into a separate buffer and push them
  4. Put each of the indexes object into a separate buffer and push them
  5. EOS
The parser should work both in pull or push mode, I'll start with push mode.

Monday, June 15, 2009

asfmux: index fixed, new formats

Latest asfmux changes:
  • fixed simple index (seeking works)
  • Support for wma version 1
  • Support for wmv version 1
  • Preroll time property
  • Packet size property
  • file id generation (instead of a previous hardcoded all zeroes)
I'd consider it ready to be called a basic asf muxer.
Feature suggestions are welcome.

Tuesday, June 9, 2009

ASFMux progress report

I ran some tests with asfmux yesterday and it is now capable of muxing wma2 and wmv2 nicely. Played the resulting files at totem, mplayer and media player.

The file indexes are still badly broken, so trying to seek might result in unexpected behaviours or crashing. I'm trying to fix that.