none
[UWP] Any special considerations when using IBasicVideoEffect with MediaPlaybackList? RRS feed

  • Question

  • I have a MediaPlaybackList and a IBasicVideoEffect.

    I add the effect onto a MediaPlayer object before setting the MediaPlaybackList as source (due to obvious reasons).

    Now the catch is, the MediaPlaybackList sometimes skips PlaybackItems at random, sometimes as many as 4 in a row. It simply reports "Error" as the reason for changing the item. Often times I can view as many as 8-9 videos gaplessly, and then the MediaPlaybackList simply decides to skip a bunch, and then go on and play a few videos like nothing happened.

    This seems to be related to the IBasicVideoEffect, but I don't understand how.

    Are there any special considerations when doing this combination? Is the IBasicVideoEffect not designed to work with MediaPlaybackList? Is there a way to track down the "Error" reported by MediaPlaybackList as reason for changing the item?

    Additional error info seems to be

    A valid type has not been set for this stream or a stream that it depends on. (Exception from HRESULT: 0xC00D6D60)

    More info: I am adding media playback items into the list dynamically. This seems to have an impact, as adding a new list will call Close/SetEncodingProperties again.


    • Edited by mcosmin Sunday, May 5, 2019 6:56 PM
    Sunday, May 5, 2019 6:01 PM

All replies

  • Hi,

    I'm asking another engineer which is more familiar with Media PlayBack about this issue. There might be some time delay. 

    Thank you for your patience.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 6, 2019 4:19 AM
    Moderator
  • This is surely a bug.

    So my scenario is to load media playback items incrementally in a media playback list. That means items are added as the playback list is source to a MediaPlayer. This achieves gapless playback while dealing with limitations in the API (such as the playback list leaking memory in anniversary update and taking a long time to load large playlists in memory). Once a media playback item is played, it is removed from the list. This way, most of them time the list has only 2 elements, except for a brief amount of time when it has 1 (after an item is finished playing but before the next one is loaded), which is currently playing.

    Anyway, what I have tried:

    1) Not removing items at all from the list. This seems to have had the best results, out of 100 playback items, only 2 failed.

    2) Having 4 items in the list (current + gapless bridged + 2 more), this seems to have had the worst result. Out of 100 playback items, 44 failed.

    3) Throw away with lazy loading and load all 100 items from the beginning. This is the way media playback list is used in every sample, and items still failed (out of 100, 7 failed).

    I did some digging on MF playlists, and the documentation suggests that only 2 tolopolgies are loaded in memory at any given time, although this could be changed. It seems to me that the MediaPlaybackList loads all of its topologies in memory and assumes the entire list is a single media source. This sounds terribly inefficient, and I am sure it has little use in real life (people can remove/add files into the playlist at will). This also means that an IBasicVideoEffect attached to the player object will be loaded and unloaded several times for each of the items in the list, whenever one is done playing.

    Thursday, May 9, 2019 7:22 AM
  • Hi,

    Could you please share me a sample about this? I need to reproduce it to confirm the reason about this. A simple demo with necessary code will be enough.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 13, 2019 9:14 AM
    Moderator
  • https://1drv.ms/u/s!Ao-WOwsImxSMt502DdQeWGdSBMOyqw

    There you go.

    Basically, you will need a bunch of valid mkv or mp4 (you can add additional extensions in code if you wish). When the app loads it will present you with the file picker, select as many files as you wish. The application will create a playlist of 100 files (so it will duplicate some files if you selected less than 100). It will create a media playback list, populate it with playback items from said files, then start playing them. For convenience sake, i added a timer which will seek to the end of the file (2 seconds before the end), so you don't have to wait it out. The bug occurs when moving from one item to the next, so watching the entire movie unfold is pointless. WAIT until you have played the last item!

    When an item fails to open, a dialog box will be shown. You can then comment the line which adds the video effect and you will see the playback list will play happily through to the end without any annoying message dialogs.

    Just in case you can't reproduce it, I recorded the entire thing via feedback hub, here's the link

    https://aka.ms/AA53ab2

    Tuesday, May 14, 2019 6:22 PM
  • Hi,

    I meet some problem when reproducing the problem. I'm getting another exception when I wants to play videos. It's Class not registered (Exception from HRESULT: 0x80040154). It doesn't looks the same as you mentioned. Could you please share me a screen shoot about the exception you get when using the sample?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 16, 2019 9:59 AM
    Moderator
  • Please try again, I reuploaded the sample

    I have uploaded reproduction recording on the feedback hub sample here

    https://aka.ms/AA53ab2

    Thursday, May 16, 2019 10:16 AM
  • I can still reproduce this with the latest windows 10 19H1.

    You can see the error message bellow.

    • Edited by mcosmin Sunday, May 19, 2019 8:14 PM
    Sunday, May 19, 2019 3:56 PM
  • Hi,

    Finally I reproduced the problem with different videos. I will report this issue to the team. There might be some time delay.

    Thank you for reporting it here.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 20, 2019 9:59 AM
    Moderator
  • Cool. Thanks a lot.
    Monday, May 20, 2019 10:04 AM
  • Hi,

    Thank you for your patience.

    Best regards

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, May 21, 2019 2:44 AM
    Moderator
  • Any news?
    Tuesday, July 9, 2019 11:30 AM