ffmpeg编译问题及其解决方法

1、发现错误
error LNK2019: Unknown external token "int __cdecl av_open_input_file(struct AVFormatContext * *,char const *,struct AVInputFormat *,int,struct AVFormatParameters *)"
必须要用external "C"{...}把头文件包含起来

2、img_convert ->sws_scale
#if 0 //old code:
    img_convert(&pict, dst_pix_fmt,
        (AVPicture *)pFrame, is->video_st->codec->pix_fmt,
        is->video_st->codec->width, is->video_st->codec->height);
#else //new code:
    static int sws_flags = SWS_BICUBIC;
     struct SwsContext *img_convert_ctx;
       img_convert_ctx = sws_getContext(is->video_st->codec->width,
is->video_st->codec->height,
is->video_st->codec->pix_fmt,
is->video_st->codec->width,
is->video_st->codec->height,
dst_pix_fmt,
sws_flags, NULL, NULL, NULL);

sws_scale (img_convert_ctx, pFrame->data, pFrame->linesize,
    0, is->video_st->codec->height,
    pict.data,pict.linesize);
    sws_freeContext(img_convert_ctx);
#endif

#include <swscale.h>

3、iconv
The iconv program converts text from one encoding to another encoding.

iconv [OPTION...] [-f encoding] [-t encoding] [inputfile ...]
iconv -l

examples:
(1)iconv -f ISO-8859-1 -t UTF-8
    converts input from the old West-European encoding ISO-8859-1 to Unicode.

(2)iconv -f KOI8-R --byte-subst="<0x%x>"
                --unicode-subst="<U+%04X>"
     converts input from the old Russian encoding KOI8-R to the locale encoding, substituting an angle bracket notation       with hexadecimal numbers for invalid bytes and for valid but unconvertible characters.

(3)iconv --list
lists the supported encodings.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值