h4tr3d / avcpp

C++ wrapper for FFmpeg
Other
429 stars 78 forks source link

Copy a stream without transcoding #120

Closed mmomtchev closed 4 months ago

mmomtchev commented 7 months ago

Is it possible with the current API to copy a stream - audio or video - without re-encoding it?

In order to create a new stream in the output FormatContext I must call FormatContext::addStream - which can be either with the codec context, either with nothing at all in order to create a bare-bones empty Stream.

However I don't see any method that allows me to setup this bare-bones empty Stream once I have created it.

There is also FormatContext::addStream with a Codec but this one seems to be deprecated as of ffmpeg 5.0.

h4tr3d commented 4 months ago

@mmomtchev , could you please check latest code? I updated today api2-remux.cpp sample sounds like now it works.

mmomtchev commented 4 months ago

I will into it, but I am currently working on something else. As I may have seen from my profile, I am living on social welfare and I have to eat with a few bucks per day, far below the poverty level in France because of an extortion involving the French police and the French judiciary - both on the national and the EU level. Usually, when people start blocking my PRs, I switch to another project to force the people extorting me to tell the whole story once again. Before, they were always posting simultaneously on two different issues to show me that something was part of the extortion. Now, they ask the same person to do it, probably hoping that they will eventually find a way to stop me from talking.

mmomtchev commented 4 months ago

Yes, with the latest modifications, now it works, I will see to include it in the Node.js bindings