[Libav-user] Create a muxer without enc_ctx = out_stream->codec

Charles linux2 at orion15.org
Tue Aug 23 21:12:40 EEST 2016


On 08/23/2016 11:59 AM, Nicolas George wrote:
> Le septidi 7 fructidor, an CCXXIV, Charles a écrit :
>> Am I even approaching the problem the right way?
>
> You are too vague.
>
>> Why does the muxer care about the encoding? Should he only know about the
>> packets?
>
> Most formats store that information somewhere in the file headers.
>
>> Without a demuxer how to you get stream data into the muxer?
>
> From the encoder, as I already hinted in my first mail and explained in the
> second. Did you even read it?
>
>> On 08/23/2016 09:47 AM, Nicolas George wrote:
>
> Remember top-posting is forbidden on this list; if you do not know what it
> means, look it up.
>
> Regards,
>

I have fixed the issues and it appears to work without deprecated calls.
https://gist.github.com/LinuxwitChdoCtOr/74c1721dd7688cf1d16509ea2a52d231

Somebody should add a bit in headers as the codecpar is in libavformat/avformat.h
but this usage is in libavcodec/avcodec.h

This is good stuff, just kind of in the wrong place....IMHO
  * @deprecated The semantics of this function are ill-defined and it should not
  * be used. If you need to transfer the stream parameters from one codec context
  * to another, use an intermediate AVCodecParameters instance and the
  * avcodec_parameters_from_context() / avcodec_parameters_to_context()
  * functions.

the "_to_" vs "_from_" was just escaping my vision... course I am an old fart.
I swear I looked at that section of the header a dozen times and never saw it.
Thankfully I was looking at avcodec_copy_context

demux -> avcodec_parameters_to_context
mux -> avcodec_parameters_from_context

just a suggest as a person looking in from the outside..

Thanks
cco

Nicolas,

I really DO appreciate the time you spent to respond. Which is why I asked the vague question about the constructs in play here.
After I read your first email, I updated the code, so it was useful.

I did NOT see your second email, only the first email that basically told me what I already knew.
Was setting too much crap and not connecting the encoder and stream the correct way.
FYI: This is a very difficult ABI to learn so "hints" are worthless when someone is stuck.

Maybe if I had seen your second email...

It would have been helpful if you had said:
"Hey dummy, you need avcodec_parameters_from_context for muxing"

Finally, top-posting, you are just being condescending at that point - "look it up". Frankly, to me, it came off as rude.
I actually read the rules and was bottom posting at first, but several people are top posting all the time so I tend to go with the flow of 
traffic. If it makes you fell better I will always bottom post in response to you, because that is the kind of person I am.

Doing the happy dance !@@!

Take care,
Charles




More information about the Libav-user mailing list