F4V File Format
You might have read my post about my FLV meta data and cue point reader/writer. You might also know that the F4V format (which really is simple MP4+H264+AAC) succeeded to the FLV format, and is supported by Flash 9.0.115 and up.

The MP4Info class is a simple extensible PHP class reading the MP4 container’s frames (called boxes) to get various information, namely the video duration, the video/audio codecs, the width and the height, as well as the embedded XMP meta data.

The F4V format is better than the FLV format in many aspects:

  • Better compression ratio
  • Better quality at similar bit rates
  • Open source compressors available, through ffmpeg and libh264 (Flash 8 On2 VP6 codec is proprietary)
  • Decoding H.264 is a lot less CPU intensive on the host computer than decoding On2 VP6
With Flash 9 being at a rate of penetration of 98.9% in mature markets1 and will all the advantages, MP4 Flash video is becoming more and more common.
It really only has been tested with Sorenson Squeeze encoded F4V files for now, and therefore should be considered beta.

You’ll find the project at Google Code, under php-mp4info.

1 As per Adobe’s Adobe Flash Player Version Penetration statistics, on June 11, 2009
2 F4V logo at the top found at Flash Develop And Design


If you like this article, leaving a comment, tweeting ofr liking it is always appreciated.

category Flash, PHP Thursday 11 June 2009 Comments (8)

8 Responses :

  1. Samuele

    Cool, it works extraordinarily well !!
    Incredible! I tested it with my video maked with my nokia n93i (h264 but incompatible with flash mp4 format video) that I was renamed from .mp4 to .f4v and putted it inside “TestFiles” directory. It extract all informations !
    ..and another incredible thing is that flash movie player cannot able to play that video! :-)

  2. oxygen

    haven’t even opened the url and I already love you:)
    for FLV I could do it myself, but for mp4, I have been looking everywhere:) and this is PHP too!:)

    great work!

  3. Warren

    Is there anything available to write meta data, namely to set cue points?

  4. Luc Pettett

    Wow – We needed this for our Horse Racing Melbourne Cup site. It’s worked! We have calculated the length of videos we are supplied with and display them online. Very nice

  5. Janneaa

    This seems like a nice php tool but unfortunately it wasn’t able to parse my mp4 file. I encoded it with a very recent build of FFmpeg using a single pass following these instructions: http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/

    The only error I get when trying to get its information is: 0x434e4356-CNCV in udta

  6. Ricardo Kleine Samson

    Hi Tom, thanks for this!.

    How can I read cue points from a f4v files ?

  7. genti

    hi,
    i’m trying your classes but the only info i can retrive is:

    0xa954494d-©TIM in udta

    simpy using MP4Info::getInfo(path_to_f4v_file);

    any suggestion?

    regards

  8. Junran

    That’s great! Can we write metadata back to mp4?

Leave a Reply