Qt WinRT App cannot access file permission denied

  • I need to develop WinRT App using Qt and FFMPEG, I build the ffmpeg for WinRT based on the instruction here and I am able to link the library with my project. Now I need to open a video file using avformat_open_input but it always giving me the output

    video decode error "Permission denied"

    Below is the relevant part of the code,

     int ret = avformat_open_input(&pFormatCtx, hls, NULL, NULL);
        if(ret != 0)
            char errbuf[128];
            av_strerror(ret, errbuf, 128);
            qDebug()<<"video decode error"<<QString::fromLatin1(errbuf);

    From the above error it seems some permission issue, do I need to add any additional permission on AppxManifest.xml currently I am using default manifest which is created by Qt creator.

  • Lifetime Qt Champion

    Where is the file located?

  • In the C drive,


  • Lifetime Qt Champion

    I'm not a WinRT expert but I think you need additional permissions for the Videos directory.

  • Yes, that what I confused, how can grant the permission to access file? Does the third party library need some extra permission as ffmpeg lib is used to open video file.

  • hi haris,
    within the package.appxmanifest under "functions" (not sure if its called so in the english Version) you can define the rights for the app. one of the rights is the videolibrary. maybe this is the right one.

  • @patrikd said:

    e package.appx

    Hi Patrik

    Here the complete Appmanifest.xml

    <?xml version="1.0" encoding="utf-8"?>
    <Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
        Version="" />
        <PublisherDisplayName>Default publisher display name</PublisherDisplayName>
        <Resource Language="en" />
            Description="Default package description"
            <m2:DefaultTile Square310x310Logo="assets/logo_310x310.png"
                <m2:ShowOn Tile="square150x150Logo" />
                <m2:ShowOn Tile="wide310x150Logo" />
                <m2:ShowOn Tile="square310x310Logo" />
            <m2:SplashScreen Image="assets/logo_620x300.png" />
        <Capability Name="musicLibrary" />
        <Capability Name="internetClient" />
        <Capability Name="videosLibrary" />
        <Capability Name="picturesLibrary" />
        <PackageDependency Name="Microsoft.VCLibs.120.00.Debug" />
    <!-- Generated by qmake using the winrt-x64-msvc2013 mkspec. -->

    Where these lines

       <Capability Name="musicLibrary" />
       <Capability Name="internetClient" />
       <Capability Name="videosLibrary" />
       <Capability Name="picturesLibrary" />
    I have added manually, but still no luck.

  • hi haris,
    when I set this flag under vs2015 my entry in the manifest is a little different:

    <uap:Capability Name="videosLibrary" />

    but no idea if this "uap:" is needed.
    I'm sorry, I have only little experience on WinRT. Maybe the output is missleading. I would try to access a text file for debug in this folder directly from my application to make sure that this is really the reason.

  • Thanks for the help, my project was created on QtCreator and trying to run from QtCreator itself. I tried from the above code in manifest but some error appears while running like ```
    Unable to find a run profile for MyApp.exe

Log in to reply