Multimedia dedicated weblog.

MONOGRAM x264 Encoder

May 20th, 2009 Posted in Uncategorized


another few minor issues have been fixed in my x264 wrapper filter.

  • property page does not flicker any more
  • AnnexB and AUD work fine now
  • bugfix for output media type

Download binary: (450 KB)



  1. 36 Responses to “MONOGRAM x264 Encoder”

  2. By winnydows on May 21, 2009

    Thanks. Annex B work ok now.

  3. By SoniX on Jun 1, 2009

    Hello Igor,

    I’m trying to build the encoder from SVN and I get hundreds of errors (I am using VS 2005 Professional).
    Most of the errors are related to typedefs and it’s all probably just a matter of setting up the environment correctly. Any ideas?


  4. By SoniX on Jun 3, 2009

    Hello Igor,

    I finally managed to compile the project on VS 2005 Express. Do you have any idea what I have to modify to make the filter compatible with Elecard Mpeg Muxer (it muxes a Mpeg2 TS)?
    The encoder seems to be working fine when used with your mpeg4 muxer but I really need to make a TS so I can stream it. Unfortunately I cannot find any valid Mpeg2 TS muxer except the Elecard one and it’s not compatible for some reason with the encoder.
    I do have some experience in programming so I can help modify your encoder if necessary but I need to be pointed in the right direction.


  5. By winnydows on Jun 3, 2009

    Elecard don`t want see a problem.
    Same for MP4.

    May be exists some news about your TS and MP4 muxers?

  6. By SoniX on Jun 5, 2009

    Hello Igor,

    Seems that the problem resides in the format this filter outputs data (AVC format instead of {0×8D2D71CB, 0×243F, 0×45E3, {0xB2, 0xD8, 0×5F, 0xD7, 0×96, 0×7E, 0xC0, 0×9B}}).
    While I’ve tried to modify the filter to accommodate the other format, In the end I had to give up.
    Are any plans for a Mpeg2 TS muxer? How can I help? With enough hints I believe I can develop one and make it available.


  7. By Igor Janos on Jun 5, 2009


    Sure I’d like to make the encoder as much compatible as possible, but unluckily I’m quite out of free time these days.

    If you need TS muxing, you might try this:

    It’s a TS muxer I’ve written some time ago. It should support H.264 and AAC, but I have also received some reports about compatibility problems with Sony PS3, etc.. but you might give it a try.


  8. By Igor Janos on Jun 7, 2009

    As for the MP4 muxer. There have been some issues fixed recently such as problems with audio in QuickTime or compatibility with iPod. I hope I will be able to release the new mp4 muxer during the next week.

  9. By SoniX on Jun 9, 2009

    Hello Igor,

    You are my personal GOD. :)
    I’ve managed to use the TS muser and everything works fine for SD encode + stream. On HD encoding + streaming there are some issues.
    Encoding on 60 FPS at 720P resolution seems a little too much even for my monster computer so I’ve modified the encoder to skip some of the frames. The filter from the compiled code (from SVN) cannot connect to any other filter for some reason though.


  10. By Igor Janos on Jun 10, 2009

    Depends on what is “monster computer”. I am having no problems with x264 1080i encoding @ 25 fps with my core i7.

    Btw. Try using the latest x264 encoder build from the SVN. Has some small fixes.


  11. By SoniX on Jun 11, 2009

    Thank Igor,

    I’m using the code from SVN.
    The problems I face has something to do with different timestamps for audio and video. Most probably the muxer expects similar timestamps so it can synchronize the TS and because the video timestamps are different on big frames (720P) it drops them.
    I dumped the output from the muxer toa file and then play it with VLC (it has a nice logging ability). VLC complains about timestamps mismatch and the overall video is faster than normal speed.

    Kind regards,

  12. By Igor Janos on Jun 14, 2009

    I will have a look at the TS muxer. I need it also for one project right now.

  13. By andy vt on Jun 15, 2009

    Noticed that the merit value (NORMAL) for the filter is causing it to auto load in some playback graphs.

  14. By SoniX on Jun 15, 2009

    Hello Andy,

    The merit value can be easily altered by changing the specific line to ;
    const AMOVIESETUP_FILTER sudAVCEncoder =
    { &CLSID_MonogramX264, L”MONOGRAM x264 Encoder”, MERIT_NORMAL, 2, psudPins };


  15. By Igor Janos on Jun 15, 2009

    Yes. Good point. I will change that in the next release to MERIT_UNLIKELY.

  16. By andy vt on Jun 16, 2009

    Igor - Thanks

    SoniX - yep, but then I’d only fix it for me :)

  17. By SoniX on Jun 17, 2009

    Andy - You are absolutely right :) My bad.

  18. By SoniX on Jun 17, 2009

    I’ve managed to stream live capture using 720p HD, 30FPS, H.264 + AAC with a decent quality and no bitrate drop.
    This took about 50% of the CPU on a ordinary computer (E6850).
    The only issue I had was related to the timestamps from the capture card that were not right and because all the downstream timestamps were using the initial ones from the capture card, the stream was all messed up. Finally I tricked the board (Decklink) into writting the correct timestamps.
    Ohh, happy day at last. :)

  19. By Igor Janos on Jun 17, 2009

    Oh…. Decklink…. I know exactly what you are talking about. It’s a very evil thing. I’ve been fighting timestamp issues with decklink for a long time. Then I’ve ended up with retimestamping everything the card delivered.. and still it produced desync after running for a day or two.

  20. By SoniX on Jul 3, 2009

    Hello Igor,

    I’ve managed to finally get along with Decklink hardware.
    Actually I’m using a filter that does a restimstamping on both audio and video graph paths and it works like a charm.


  21. By SS on Jul 9, 2009

    Hello Igor,

    I am very interested in using your x264 encoder in our product, but am confused with how the GPL license affects Directshow Filters. My code is generic and can be used with any filter. Using your x264 filter would only require a change to a configuration file, not a code change. Would this still mean my code would need to be licensed as GPL or could it be commercially released?

    Many thanks,

  22. By Igor Janos on Jul 10, 2009

    I’m not a lawyer myself, but I think as long as your software is able to work with any other encoder just as well without any special interfacing you should be able to use it.

    Btw. H.264 codec is patented so you should keep in mind you might need to contact MPEG-LA even if you are using a free codec implementation.

  23. By Jeremy on Jul 14, 2009


    Thanks again for the filter. One quick question–looking at this page,

    …I see that for MEDIASUBTYPE_AVC1, the MPEG2INFOHEADER value dwFlags should be set to the number of bytes used for the length field that appears before each NALU, but I don’t see that being set in the latest SVN trunk.

    Also, do your media type guids match those found in wmcodecdsp.h?

    Thanks again,


  24. By Jeremy on Jul 14, 2009

    One other thing–it also looks like if you’re doing MEDIASUBTYPE_H264, then the downstream filter expects the NALU start codes and not a size field to be appended to the sample (i.e. do_annexb)?

  25. By Igor Janos on Jul 29, 2009

    Thanks. Good points. Will be implemented in the next release.

  26. By Jeremy on Aug 1, 2009


  27. By Jeremy on Aug 19, 2009


    When using the filter, I noticed that the timestamps from the samples I receive always had an end time one 100 ns unit greater than the start time. I traced that to some code in the filter:

    rtStart = dts;
    rtStop = rtStart + 1;
    pOut->SetTime(&rtStart, &rtStop);

    // nastavime velkost
    int lsize = out - orig;

    Is this intentional, or a bug? To me, it seems like it makes more sense to preserve the timestamps from the incoming sample, but maybe I’m misunderstanding something.

    Anyway, because of this, to determine the “duration” of a given frame (which is important when I’m trying to write to MP4), I have to wait for the “next” frame and compute the duration based on its start time.

    Am I missing something here?



  28. By MiPi on Oct 5, 2009

    I tried this x264 encoder and the last version from SVN and I’m not able to use the result on iPod. Do you plan to fix compatibility with iPod in no distant time? I found, it always creates “High” format profile (need Baseline), even when I don’t use B-frames, CABAC and interlacing.

  29. By pjcast on Oct 13, 2009

    First off, thanks for all your work and releasing these sweet filters!

    I was able to use the Mpeg Transport filter with a custom render filter that piped the received stream to a forked process. The forked process was a live555 MPEGTS RTP broadcast demo app reading stdin. I was able to easily receive that stream via VLC on the LAN.

    Though, I would think that it would be more efficient to do this in the Muxer itself, and was wondering what license and if you plan to make the source available for that? I didn’t see it in your SVN repo.


  30. By MiPi on Oct 22, 2009

    I’ve found out, that the problem with iPod compatibility is caused by the parameter params.analyse.b_transform_8×8, it must be 0 for iPods and default is 1.

  31. By JiaWangxi on Nov 6, 2009

    Thank you for this filter. I wonder how can I set the media type for directshow architecture. It seems that the output pin doesn’t set the media type correctly. And the decoder filter, such as ffdshow decoder filter, doesn’t know how to decode the bit stream from upstream filter

  32. By JiaWangxi on Nov 9, 2009

    Thank you for this filter. I wonder how can I set the media type for directshow architecture. It seems that the output pin doesn’t set the media type correctly. And the decoder filter, such as ffdshow decoder filter, doesn’t know how to decode the bit stream from upstream filter

  33. By andy vt on Feb 27, 2010

    Are you accepting patches for the encoder? The latest ( build of the filter was defaulting to the HIGH profile, so I added a propertied to the config structure to control the profile. I’d like to submit it back to the project so others can benefit.


  34. By Igor Janos on Feb 27, 2010

    Yeah sure. I’m little bit out of time to do proper development around here but I gladly welcome any upgrades. If you want I can add an SVN account for you so you will be able to commit the change/s by yourself.

  35. By Victor Cavalcanti on Mar 11, 2010

    Igor, I did a post recently to possibly hire you to do some additional custom development for this component. If you are not interested please reply. Regards, Victor

  36. By Igor Janos on Mar 12, 2010

    Hello. As nice as your offer seems I’m afraid I will not be able to do any custom development for you because of total lack of time. Btw. have you checked latest builds from SVN? Perhaps your wished-for features are already implemented.


  37. By andy vt on Mar 19, 2010

    A SVN account would be great. Also FYI I noticed that some the file necessary to build the AC3 encoder filter are missing from SVN.


Post a Comment