Tag: x264

Windows:如何构建X264.lib而不是.dll

我下载了X264源码并安装了mingw。 步骤1: 在MINGW bash中执行此操作: ./configure –disable-cli –enable-shared –enable-win32thread – -extra-ldflags = -Wl, – output-def = libx264.def 然后’制作’ 第2步: 将libx264-142.dll重命名为libx264.dll并打开VS2012命令提示符并执行以下操作: LIB /DEF:libx264.def 它给了我libx264.lib和对象libx264.exp 第3步: 包含使用X264 API的VS2012项目中的lib文件。 问题: 当我启动项目时,我收到以下错误消息: “程序无法启动,因为您的计算机缺少libx264.dll” 题: 当我链接静态库时,为什么要查找dll? 我该如何解决这个问题? 我想构建一个静态X264库,我可以将其链接到我的项目中。 编辑: 我只需将dll放在与项目可执行文件相同的目录中。 但是 – 我的问题仍然存在:如何构建静态 x264库? 所以我不需要dll?

无法将libavformat / ffmpeg与x264和RTP同步

我一直在研究一些流媒体软件,它使用H.264通过网络从各种摄像机和流中获取实时信息。 为了实现这一点,我直接使用x264编码器(带有“zerolatency”预设)并提供NAL,因为它们可用于libavformat以打包到RTP(最终是RTSP)。 理想情况下,此应用程序应尽可能实时。 在大多数情况下,这一直运作良好。 不幸的是,存在某种同步问题:客户端上的任何video播放似乎都显示了一些平滑的帧,然后是短暂的暂停,然后是更多的帧; 重复。 此外,似乎有大约4秒的延迟。 我尝试过的每一个video播放器都会出现这种情况:Totem,VLC和基本的gstreamer管道。 我把它煮成了一个小小的测试用例: #include #include #include #include #include #include #define WIDTH 640 #define HEIGHT 480 #define FPS 30 #define BITRATE 400000 #define RTP_ADDRESS “127.0.0.1” #define RTP_PORT 49990 struct AVFormatContext* avctx; struct x264_t* encoder; struct SwsContext* imgctx; uint8_t test = 0x80; void create_sample_picture(x264_picture_t* picture) { // create a frame to […]

如何用libavcodec / x264编码h.264?

我试图使用libavcodec / libavformat编码video。 音频效果很好,但当我尝试编码video时,我收到以下错误: [libx264 @ 0x10182a000]broken ffmpeg default settings detected [libx264 @ 0x10182a000]use an encoding preset (vpre) 使用命令行ffmpeg很容易修复,但我试图在C中执行此操作。我的选项是 AVStream *pVideoOutStream = av_new_stream(pOutFormatCtx, 0); AVCodecContext *pVideoOutCodecCtx = pVideoOutStream->codec; pVideoOutCodecCtx->codec_id = CODEC_ID_H264; pVideoOutCodecCtx->codec_type = CODEC_TYPE_VIDEO; pVideoOutCodecCtx->bit_rate = pVideoInCodecCtx->bit_rate; pVideoOutCodecCtx->width = pVideoInCodecCtx->width; pVideoOutCodecCtx->height = pVideoInCodecCtx->height; pVideoOutCodecCtx->pix_fmt = pVideoInCodecCtx->pix_fmt; pVideoOutCodecCtx->sample_rate = pVideoInCodecCtx->sample_rate; pVideoOutCodecCtx->gop_size = 30; 但是avcodec_open()失败了。 我需要设置哪些其他值才能使x264满意?