ffmpeg-cpp icon indicating copy to clipboard operation
ffmpeg-cpp copied to clipboard

Linux support

Open avilleret opened this issue 3 years ago • 5 comments

Having trouble interfacing with the ffmpeg C API directly from C++, I would like to give a try to ffmpeg-cpp. Unfortunately, it's not that straightforward.

First of all, the windows only crtdbg.h is included from ffmpeg.h (and the later have a common name which could cause troubles on Linux). This can be fixed by adding the proper #ifdef statement.

But then, I got the following error :

../FFmpegException.h:18:23: error: looser exception specification on overriding virtual function ‘virtual const char* ffmpegcpp::FFmpegException::what() const’ 18 | virtual char const* what() const

I do think this is specific to Windows exception implementation.

If someone is interested in, the CMakelists is attached. It should go to source/ffmpeg-cpp/ffmpeg-cpp folder. This is a very kick of, only files besides the CMakelists.txt are taken (nothing from subdirectories). CMakeLists.txt

avilleret avatar Jul 24 '20 07:07 avilleret

So far, Linux is not really / officialy supported there.

If you don"t care about the license, you should have a look at : https://framagit.org/ericb/ffmpeg-cpp2

Or even https://github.com/ebachard/ffmpeg-cpp if you prefer github, but it's not up to date like the first repo.

HTH

ebachard avatar Jul 24 '20 15:07 ebachard

I know that linux is not officially supported here but since I read :

since the project itself is fully platform-independent.

in the readme.md I thought it was worth a try.

avilleret avatar Jul 24 '20 20:07 avilleret

I fully agree, I thought it was true like you. But is is not.

Back to the issue, and after a second read, your issue is caused by the exception handling : use strings instead, of char * everywhere + take care to some methods signatures, and it should help.

There are some other bad design issues IMHO (like serious visibility mess with some AV* structures, causing shadow issues, very difficult to track). If you prefer stick to this repository, I'd rather suggest you https://github.com/wvaarle/ffmpeg-cpp . This guy fixed a lot of issues and, IMHO, this is the better compromise.

Last but not least, if your time is precious, have a look at the framagit version I proposed you. FYI, once I'll have found a RPI 4/ 8GB, I'll improve (I mean I'll try to optimize) the Linux port on this machine.

ebachard avatar Jul 25 '20 07:07 ebachard

First of all, the windows only crtdbg.h is included from ffmpeg.h (and the later have a common name which could cause troubles on Linux).

Not just that it also includes windows.h

harshal-99 avatar Sep 12 '20 19:09 harshal-99

@harshal-99

Are you serious ? :-)

The code, the tree, the recent changes (completely wrong) ... and a lot of "details" show there are probably Microsoft devs behind that. When will C# beiing added btw ?

ebachard avatar Sep 28 '20 07:09 ebachard