Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use api2-decode-encode-video #45

Open
jeroen opened this issue Aug 22, 2018 · 3 comments
Open

How to use api2-decode-encode-video #45

jeroen opened this issue Aug 22, 2018 · 3 comments
Labels

Comments

@jeroen
Copy link

jeroen commented Aug 22, 2018

I am trying to build a tool to convert a bunch of png's into a video. I figured the best place to start was the example api2-decode-encode-video.cpp but I don't understand how to use the example. I compiled it using homebrew ffmpeg 4.0.2 on MacOS and then run with:

./api2-decode-encode-video input.png out.mkv

The line above always crashes when initiating the VideoEncoderContext with an error:

libc++abi.dylib: terminating with uncaught exception of type av::Exception: Codec context invalid media type

I tried other output names but get the same error. How am I supposed to use this example?

@h4tr3d
Copy link
Owner

h4tr3d commented Aug 24, 2018

Seems that codecpar using required new way for creation streams and codec contexts :-\ In current way codecpar keeps uninitialized, as result - media_type is UNKNOWN and exception is thrown.

@h4tr3d
Copy link
Owner

h4tr3d commented Aug 30, 2018

Heh, currently I have no time for correct fix. Quick WA is replace line:

#define USE_CODECPAR (LIBAVFORMAT_VERSION_MAJOR >= 58)

to

#define USE_CODECPAR (0)

at the https://github.com/h4tr3d/avcpp/blob/master/src/avutils.h

@h4tr3d
Copy link
Owner

h4tr3d commented Aug 30, 2018

WA was committed: 20b296b

@h4tr3d h4tr3d added the bug label Jun 16, 2019
mmomtchev added a commit to mmomtchev/ffmpeg that referenced this issue Nov 11, 2023
blocked by h4tr3d/avcpp#45
must upgrade avcpp on conancenter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants