如何打开文件名包含FFmpeg中的特殊字符?

时间:2015-01-28 09:33:29

标签: c++ video stream ffmpeg video-streaming

我的项目通过FFmpeg libarary处理视频,我用文件测试我的代码,文件名包含特殊字符(比如'()+, - 。09 @ A [] ^ _`a {}〜 ®,Ѐ,ऄ,ఆ,ა,ᐁ,ᣀ,ᴀ,₠,⓪,⭙,ⶀ,㈀,啊.mp4 '),但无法在 avformat_open_input打开视频流( )

我使用命令行通过 ffmpeg.exe 测试它,它可以成功打开文件。

这是我的代码段:

    AVFormatContext *pFormatCtx = NULL;
    AVCodecContext  *pCodecCtx = NULL;
    AVFrame         *pFrameRGB = NULL;
    unsigned int    i, videoStream;
    AVCodec         *pCodec;
    AVFrame         *pFrame;
    AVPacket        packet;
    int             frameFinished;
    int             numBytes;
    uint8_t         *buffer;
    AVPixelFormat   ImgFmt = AV_PIX_FMT_YUV420P;

    // Register all formats and codecs
    av_register_all();

    // Open video file
    if (avformat_open_input(&pFormatCtx, inputFilePath, NULL, NULL) != 0)
    {
        printf("Couldn't open file.");
        return -1;
    }

它在 avformat_open_input()时出现错误,我认为它因Unicode文件名字符串而失败

任何人都可以帮助我?

由于

0 个答案:

没有答案