问题
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.
回答1:
Try to add a file protocol to the manifest page, contains your file extension you want to access/ create or play with..
for example, .xml, .txt, .etc..
I always face this 'unknown' error when try to access files without adding the ext file protocol..
UPDATE: More Information: https://msdn.microsoft.com/library/windows/apps/hh464906.aspx#file_activation
Do it by: Package.appxmanifest > Declarations > Add a 'File Type Association' > your type name and ext. is required.
Example in a code:
<Extensions>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="myfile">
<uap:SupportedFileTypes>
<uap:FileType>.config</uap:FileType>
</uap:SupportedFileTypes>
</uap:FileTypeAssociation>
</uap:Extension>
</Extensions>
Change 'myfile' and '.config'
Good luck!
来源:https://stackoverflow.com/questions/35551995/qt-winrt-app-cannot-access-file-permission-denied