Testing MP with GraphEdit, MP does not use the configuration settings (1 Viewer)

kkendall

Portal Pro
April 24, 2007
864
16
44
Gouda
Home Country
Netherlands Netherlands
I think Flip was being very polite and patient in his reply.

I also assume it was a language issue that caused the mix up
probably, but my english is quite good. I'm half english, half dutch :)
but a lot of what flip said was responded to incorrectly in kkendals post, which Flip pointed out.
When somebody says an MPEG2 file contains only MPEG1/2, than I interpret that as an MPEG2 container that can only contain MPEG1/2 formats. This is just plain wrong, MPEG2 is not a container. This is probeably what Flip intended to say, but my reaction was not incorrect. If somebody says it's safer to let windows determine what codecs to use (even though sometimes that also doesn't work) than I HAVE to disagree, I'm sorry :D
But enough about language issues :)

As for the effort required to change the code to individually select codecs, I guess this could be an easy task technically, but quite lengthy in the time it would take. As flip said, MP checks the extension not the contents of the container. This would need to be changed as well as adding in all the drop down boxes for every codec (and maintaining as new ones are made) which would take bit of time.

Whao, is this really true? But for example, an avi or mkv can contain so many formats, from h264 to mpeg2 and from vc-1 to xvid. Than how can MP determine what codec to take if it only looks at the container??
And how is it possible that it can determine h264 and mpeg2 within a container if it only looks at the extension? ...It's just really hard to swallow...
what was the thought behind this, to just look at the file extension, not the actual needed format within the container? Could somebody please explain this?
As I'm not a programmer, I know squad about interpreting source codes so I can't check it but this really changes the perspective on things...

Oh and Flip, if I offended you, I'm sorry. :oops: That's just my Dutch side acting up I guess. :D
 

FlipGer

Retired Team Member
  • Premium Supporter
  • April 27, 2004
    2,658
    115
    49
    Leipzig, Germany
    Home Country
    Germany Germany
    Hoi,

    Whao, is this really true? But for example, an avi or mkv can contain so many formats, from h264 to mpeg2 and from vc-1 to xvid. Than how can MP determine what codec to take if it only looks at the container??
    And how is it possible that it can determine h264 and mpeg2 within a container if it only looks at the extension?

    MP does not determine h264 or mpeg2 within a mkv container. That's what I tried to explain. It just throws the file into direct show and lets windows decide. MP only builds the graph manually, if it recognizes the file extension mpeg. And therefore MP does not use the codec you set for mpeg, although the mkv might contain it. Thats what the initial topic was about: "MP does not use settings", remember? ;)

    what was the thought behind this, to just look at the file extension, not the actual needed format within the container? Could somebody please explain this?

    Well, I do not know if the programmer is still around. So this is just guessing: He did not know better? I think its not sooo easy to look into a container and check the codec. Its much easier to program "if file extension = mpeg then do this else that". Please keep in mind that this is a OpenSource-Project. The programmers work in the spare time on this.

    And as told above, your idea makes sense! So I really think this will be thought of for future releases. Just make a feature request to make sure its written down somewhere! :)

    Flip.
     

    kkendall

    Portal Pro
    April 24, 2007
    864
    16
    44
    Gouda
    Home Country
    Netherlands Netherlands
    ah, ok! but... :confused:
    So what you're saying is, only if the file extension is .mpeg or .h264, MP uses the codecs from the MPsettings, otherwise it feeds it to the system?
    But the file extension is the 'type' of container. So you're saying that only when the container is .mpeg (I thought mpeg2 was a videoformat, not a container/file extension) or .h264 (again, I thought it was only a videoformat, not a container/file extension) MP uses the MPsettings...

    I've never seen or heard of a .h264 containerfile before and I think some files can be renamed to .mpeg and still play, but it's not official. Most mpegs are in .ts, .avi or .mkv or .VOB containers. So MP practically never uses the MPsettings the way you explain it... :confused: EDIT: just heard .VOB files are generally seen by MP as .mpeg and handled that way.

    That's why I think it's not the whole story how MP works... Maybe some of the devs can explain how all of this works in laymans terms. :oops: :)

    (oh, I've made a feature request like you advised Flip!)
     

    FlipGer

    Retired Team Member
  • Premium Supporter
  • April 27, 2004
    2,658
    115
    49
    Leipzig, Germany
    Home Country
    Germany Germany
    Hi,

    So what you're saying is, only if the file extension is .mpeg or .h264,
    I never mentioned .h264... :)
    MP uses the codecs from the MPsettings, otherwise it feeds it to the system?
    Yes.
    I've never seen or heard of a .h264 containerfile before
    I never mentioned .h264... :D
    That's why I think it's not the whole story how MP works... Maybe some of the devs can explain how all of this works in laymans terms. :oops: :)
    You do not trust my words, right? ;)
    Code from MP:
    Code:
    if (extension.Equals(".dvr-ms") || extension.Equals(".mpg") || extension.Equals(".mpeg") || extension.Equals(".bin") || extension.Equals(".dat"))
            {
              if (strVideoCodec.Length > 0) videoCodecFilter = DirectShowUtil.AddFilterToGraph(graphBuilder, strVideoCodec);
              if (strAudioCodec.Length > 0) audioCodecFilter = DirectShowUtil.AddFilterToGraph(graphBuilder, strAudioCodec);
            }
            // doesn't help for Music Videos to start..
            //if (extension.Equals(".wmv"))
            //{
            //  videoCodecFilter = DirectShowUtil.AddFilterToGraph(graphBuilder, "WMVideo Decoder DMO");
            //  audioCodecFilter = DirectShowUtil.AddFilterToGraph(graphBuilder, "WMAudio Decoder DMO");
            //}
            if (extension.Equals(".mp4") || extension.Equals(".mkv"))
            {
              if (strH264VideoCodec.Length > 0) h264videoCodecFilter = DirectShowUtil.AddFilterToGraph(graphBuilder, strH264VideoCodec);
              if (strAudioCodec.Length > 0) audioCodecFilter = DirectShowUtil.AddFilterToGraph(graphBuilder, strAudioCodec);
            }

    Although not knowing C# I hope you can see that MP sets the Codecs depending on the file extension. MP takes the h264 settings, if the extension is "mkv" or "mp4". Please note, that this code example, is from the "Videos" section. Afaik it differs a littlebit in the DVD and TV section, but I did not take a look into that code. ;)

    Another remark to your question "Why is it programmed that way". This code section is rather old. More than 3 years I think. At this time it was only necessary to take care about the mpeg codec. All upcomming other codecs were just added the easiest way: By adding its most common extension.

    (oh, I've made a feature request like you advised Flip!)
    Jupp. Saw it. :) Hopefully it will taken care off. I will add my thoughts there too. So it might get more attention.

    Best regards,
    Flip.
     

    deebo

    Portal Pro
    April 19, 2006
    233
    3
    windows a perfect job of selecting codecs for media

    it wont do a perfect job of selecting codecs for media if you install codec packs or weird software

    what have we learned?

    dont install codec packs or weird software.

    i personally only use the following on all my windows computers:
    ffdshow (everything -mpeg2 -h264)
    powerdvd (mpeg2, h264)

    add haali splitter to that and avoid software that installs codecs on its own and youre set

    dont blame the system if you cant manage your codecs, codec packs and bundled tv card software usually install conflicting decoders that get higher merit than the actual working codecs, and thats when you run into trouble.
     

    Users who are viewing this thread

    Top Bottom