Closed popcornmix closed 9 years ago
A wrapper for libdcadec is already available in ffmpeg, that way you can use it through ffmpeg just fine.
Can you explain exactly what to do? Are you suggesting replacing the existing dcadec decoder? E.g. copy the source files from this project to libavcodec and modify
OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o dcadsp.o \
dcadata.o dca_exss.o \
synth_filter.o
to build this project's files?
Just build it with --enable-libdcadec --disable-decoder=dca, then libdcadec will be used, and the internal decoder disabled.
Note that this ability is only available in very recent versions, it was added just last week.
That option isn't in my stable version (n2.6). I see it went into master a few days ago. Excellent - I'll update to latest ffmpeg.
--disable-decoder=dca
That seems a bit radical, just use avcodec_alloc_context3(avcodec_find_decoder_by_name("libdcadec"))
.
That is assuming you don't control the code that uses it, or don't want to hardcode decoder names but make auto-selection simply work. I'm not sure what advantages avcodec dca would offer over libdcadec, so might as well turn it off!
Thanks for the help. I think I've got this working with kodi. It builds and reports DTS-HD MA 7.1. https://github.com/popcornmix/xbmc/commit/e653f7b6b6333881850d863c64e0ba84dda4c99c
I'm trying @wm4's suggestion of enabling both libraries and using avcodec_find_decoder_by_name("libdcadec") to optionally choose libdcadec. That works fine, but (I assume) the demuxer is using the old codec for parsing, as it reports 6 channels when using this scheme compared to 8 when disabling the old dca codec.
Can I at runtime make the parser use libdcadec?
Can we move this discussion to appropriate mailing list? This is not an issue with libdcadec.
@popcornmix: I guess that's true; you don't need to trust the demuxer's output though, just use what the decoder returns to you in AVFrame.
What kasper93 says is also true, but isn't this GH issue specifically about ffmpeg?
I think the issue can be closed. Integration in ffmpeg is available in Git, and Libav has the patches on their ML. Any further changes to how its integrated is really up to the projects, and should indeed be discussed there.
Yes, thanks for the pointers.
I wonder if you are planning on submitting this to ffmpeg/libav? It would certainly be very appreciated there (and for downstream projects like kodi).