C++ h264 ffmpeg/libav encode/decode(lossless) issues

Insights to encode/decode video with ffmpeg h264 (lossless) So I got something working on the encoding part, encode an avi in 264 however VLC wont play it, however Totem will. Decoding the same file proves troublesome. (I want the exact same data/frame going in as going out), I get these ; saving frame 5 Video decoding [h264 @ 0x1d19880] decode_slice_header error frame :6 saving frame 6

C ++ h264 ffmpeg / libav编码/解码(无损)问题

洞察使用ffmpeg h264编码/解码视频(无损) 所以我在编码部分做了一些工作,在264中编码了一个AVI,但VLC不会播放它,但图腾会。 解码相同的文件证明麻烦。 (我想要完全相同的数据/框架出去),我得到这些; saving frame 5 Video decoding [h264 @ 0x1d19880] decode_slice_header error frame :6 saving frame 6 Video decoding [h264 @ 0x1d19880] error while decoding MB 15 7, bytestream -27 [h264 @ 0x1d19880]

Decoding H264 Frame Error

I am trying to decode a H264 frame using the libav library. After initialising the library by allocating frame and context, I am using the following code to decode: AVPacket pkt; int got_picture, len; av_init_packet(&pkt); pkt.size = size; pkt.data = buffer; while(pkt.size > 0) { if((len = avcodec_decode_video2(context, frame, &got_picture, &pkt)) < 0) { break;

解码H264帧错误

我正在尝试使用libav库来解码H264帧。 通过分配帧和上下文初始化库之后,我使用以下代码进行解码: AVPacket pkt; int got_picture, len; av_init_packet(&pkt); pkt.size = size; pkt.data = buffer; while(pkt.size > 0) { if((len = avcodec_decode_video2(context, frame, &got_picture, &pkt)) < 0) { break; } if(got_picture) { // Do something with the picture...

Decode compressed frame to memory using LibAV: avcodec

I am completely new to libAV. I have a single video frame coming from somewhere else (it's in memory, not in a file). It should be H.264 encoded keyframe. I'm trying to decode with avcodec_decode_video2 is that the right function for my needs? I'm encountering a problem using this code (basically taken from FFmpeg decode raw buffer with avcodec_decode_video2 ): AVCodecContext

使用LibAV解码压缩帧到内存:avcodec

我对libAV完全陌生。 我有一个视频帧来自其他地方(它在内存中,而不是在文件中)。 它应该是H.264编码的关键帧。 我试图解码与avcodec_decode_video2是我的需要正确的功能? 我遇到了一个使用此代码的问题(基本上来自FFmpeg解码带有avcodec_decode_video2的原始缓冲区): AVCodecContext *m_pCodecCtx; AVCodec *m_pCodec; AVFrame *m_pFrame; m_pCodec= avcodec_find_decoder(CODEC_ID_H264); m_pC

What is the keyword "incr" in the KDevelop IDE?

I just downloaded KDevelop because it scans header files to offer better suggestions in code completion. I was looking at all the keywords it suggests when no header files are included at all: Why is it recommending "incr"? That's not a C++ keyword. What is it, and what is it used for? I thought it might be short for increment..? Probably it's a bug. Looking at KDev

KDevelop IDE中的关键字“incr”是什么?

我只是下载KDevelop,因为它扫描头文件以提供更好的代码完成建议。 当我看到所有关键字时,它根本没有包含头文件: 为什么推荐“incr”? 这不是一个C ++关键字。 它是什么,它用于什么? 我认为这可能是增量短... ..? 可能是一个错误。 查看KDevelop源代码, incr已添加到languages/cpp/codecompletion/context.cpp行的文件languages/cpp/codecompletion/context.cpp代码完成。它看起来像增量操作的同义词,但只有

How to return a static const int std::array from a method?

I'm trying to return a constant int std::array from a function, but I'm getting errors and I don't know how to fix them. These values from refmatrix should not be changed, ever. That's why I'm using constant int. reference.h #include <array> #include <iostream> using namespace std; class Reference { public: static const size_t NCOLS = 3; static cons

如何从一个方法返回一个静态const int std :: array?

我试图从一个函数返回一个常量int std ::数组,但我得到的错误,我不知道如何解决它们。 refmatrix这些值不应该改变。 这就是我使用常量int的原因。 reference.h #include <array> #include <iostream> using namespace std; class Reference { public: static const size_t NCOLS = 3; static const size_t NBITS = 4; static const size_t NROWS = 4; private: static array<array<

Element wise multiplication of two arrays in C/C++

I would like to perform Element wise multiplication of two arrays, both are of type complex but I am getting the following error message: serge@ubuntu:~/Downloads/OpenCV/opencv-2.4.9/build$ g++ -o myfft myfft.cpp -std=c++14 In file included from myfft.cpp:14:0: cs_delay.cpp: In function ‘void cs_delay(CArray&, int, int, int)’: cs_delay.cpp:35:28: error: no match for ‘operator*’ (operand types a

C / C ++中两个数组的元素明智乘法

我想执行两个数组元素明智的乘法,都是复杂的类型,但我收到以下错误消息: serge@ubuntu:~/Downloads/OpenCV/opencv-2.4.9/build$ g++ -o myfft myfft.cpp -std=c++14 In file included from myfft.cpp:14:0: cs_delay.cpp: In function ‘void cs_delay(CArray&, int, int, int)’: cs_delay.cpp:35:28: error: no match for ‘operator*’ (operand types are ‘void’ and ‘Complex {aka std::complex}’) x[j] = ifft(ff

When should we provide our own Hash function for `std::unordered

When I compile the following code, I saw the errors that are related to Hash. int F_no_meaningA(unordered_set<vector<int>>& setVec, vector<int>& vec) { setVec.insert(vec); return 1; } int main() { vector<int> W{2, 3, 7}; unordered_set<vector<int>> setVec; } $ g++ --version g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 $ g++ $1.cpp -o $1 -g

何时应该为`std :: unordered提供我们自己的Hash函数

当我编译下面的代码时,我看到了与哈希相关的错误。 int F_no_meaningA(unordered_set<vector<int>>& setVec, vector<int>& vec) { setVec.insert(vec); return 1; } int main() { vector<int> W{2, 3, 7}; unordered_set<vector<int>> setVec; } $ g++ --version g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 $ g++ $1.cpp -o $1 -g -Wall -Weffc++ -pedantic -st

Return value for a << operator function of a custom string class in C++

I am trying to create my own std::string wrapper to extend its functionality. But I got a problem when declaring the << operator. Here's my code so far: my custom string class: class MyCustomString : private std::string { public: std::string data; MyCustomString() { data.assign(""); } MyCustomString(char *value) { data.assign(value); } void Assign(char *value) { data.assign

在C ++中返回一个自定义字符串类的<<运算符函数的值

我想创建我自己的std :: string包装来扩展它的功能。 但是在声明<<运算符时遇到了问题。 这是我的代码到目前为止: 我的自定义字符串类: class MyCustomString : private std::string { public: std::string data; MyCustomString() { data.assign(""); } MyCustomString(char *value) { data.assign(value); } void Assign(char *value) { data.assign(value); } // ...other useful functions std::str

C++ monad library

Does anyone know of a good monad template library in C++. Perhaps, one that provides some of the common monads that you would see in Haskell like Maybe. You may want to check out the "monad.h" header in FC++. You can read more about this in the "Monads" part of this page: http://people.cs.umass.edu/~yannis/fc++/New1.5/lambda.html#monad However, this may not be suited to

C ++ monad库

有谁知道C ++中的一个好monad模板库。 也许,提供一些你会在Haskell中看到的常见单子,比如Maybe。 您可能想要查看FC ++中的“monad.h”头。 你可以在这个页面的“Monads”部分阅读更多关于这个:http://people.cs.umass.edu/~yannis/fc++/New1.5/lambda.html#monad 但是,这可能不适合于实际的工业应用 - 尽管如此,在C ++中实现和使用它仍然是一个很好的练习。 Boost.Optional中可以找到像Maybe这样的东西。

Finding a representative mean INTERIOR point for a non

I am trying to solve a travelling salesman problem in c++, but i have to traverse the shortest distance between a set of poylgons instead of a set of points. To do so, i am trying to represent each polygon by a representative "mean" interior point so that i can do a TSP on these mean interior points. It is easy for me to find a mean interior point in a convex polygon because it is si

找到一个非代表性的平均值INTERIOR点

我试图解决C ++中的旅行推销员问题,但我必须遍历一组poylgons之间的最短距离,而不是一组点。 要做到这一点,我试图用代表性的“平均”内部点来表示每个多边形,以便我可以在这些平均内部点上做TSP。 我很容易在凸多边形中找到一个平均内点,因为它仅仅是算术平均点(并且对于凸多边形总是位于内部),但这种方法对于凹多边形不起作用,因为它不一定适用于凹多边形在多边形的内部。 帮助这个? 谢谢。 :-) 怎么样: 三