On Thu, Apr 12, 2018 at 10:59 PM, Michael Goffioul <
Post by Michael GoffioulPost by Michael GoffioulThat's something I'm considering. I had a quick look today, but it's not
gonna be trivial. In particular the changes required in frameworks/av/
to
Post by Michael Goffioulsupport the ffmpeg codecs. I'm having trouble finding an entry point,
like a
Post by Michael Goffioulpatch set to apply, or a git merge/rebase to start with. It ends up
with a
Post by Michael Goffioullarge amount of changes and conflicts. How would you start the process?
Right. It's not a trivial work. That's why I defer it.
Actually I only did that in old android 4.3/4.4 (jb-x86/kk-x86).
Fortunately the CM (LineageOS) guys picked my patches
to their repo and maintained them to android 5/6/7.
In nougat-x86 I just merged their patches back to our repo.
But seems LineageOS hasn't ported (or dropped?) it for oreo
so we may need to do it ourselves.
I found a partial port in HalogenOS repos (on github) for Android/8.1 and
tried that as a starting point. But it's incomplete and more importantly
they don't seem to use ffmpeg codecs, so that didn't really serve my
purpose. The change in the build system (blueprint), the relocation of
headers, and the lack of clear patch set makes the port work quite
cumbersome. I spent hours going through half of the conflicts after merging
nougat into oreo, 99% of which are not relevant for my use case (camera,
audio effects, exotic video format support...).
I took an alternate approach: instead of porting every customizations made
in branch nougat-x86, I only took the pieces that are needed to make the
extractor layer to work (so for instance, I dropped everything that is
related to libavextensions, camera, pcm/24bits...). I could get the
extractor layer to work, with va-api accelerated codecs for h264 and mpeg2.
I'll try to make it available later this week on github.
However, I still have problems with audio. I have a test video file
containing AC3 audio (48000 Hz, stereo, fltp, 384 kb/s). When I play it in
the gallery player, the sound is completely distorted and looks more like a
loud white noise. When I play it with ExoPlayer, which does not use the
extractor layer, it's fine. It seems to be related to the metadata that are
injected by FFmpegExtractor and passed to the codec, one notable difference
being the target PCM encoding used by SoftFFmpegAudio.
When the extractor layer is used, FFmpegExtractor set "pcm-encoding"
to kAudioEncodingPcmFloat, based on the content of the audio track. This is
passed down to the codec through FFMPEGSoftCodec::setRawAudioFormat and the
codec ends up building a resampling filter for "48000 Hz fltp => 48000 Hz
flt".
When the extactor layer is not used, there's not metadata available,
and FFMPEGSoftCodec::setRawAudioFormat uses the default
encoding kAudioEncodingPcm16bit. The codec ends up building a resampling
filter for "48000 Hz fltp => 48000 Hz s16".
Any hint or suggestion?
Thanks,
Michael.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.