Patches for mediacodec (termux) encode/decode
Decode does not work reliably for me, but may be it depend on file and specific hardware? I used remap_video_codec in decode.opts and remapped vp9 to vp9_mediacodec Encode to h264/265 seems to work fine now, with system's ffmpeg 8.0.1
On Wed, Feb 4, 2026 at 9:55 PM Andrew Randrianasulu <[email protected]> wrote:
Decode does not work reliably for me, but may be it depend on file and specific hardware?
https://youtu.be/iPGsCDtDtrs should contain screen recording from my "device". You notice small black frame on timeline in very beginning- but with sw codec it really like bunch of black frames! But I issued few "clean memory" commands from Android interface before it started to work - at some point it was refusing to decode :(
I used remap_video_codec in decode.opts and remapped vp9 to vp9_mediacodec
Encode to h264/265 seems to work fine now, with system's ffmpeg 8.0.1
ср, 4 февр. 2026 г., 21:55 Andrew Randrianasulu <[email protected]>:
Decode does not work reliably for me, but may be it depend on file and specific hardware?
I used remap_video_codec in decode.opts and remapped vp9 to vp9_mediacodec
Encode to h264/265 seems to work fine now, with system's ffmpeg 8.0.1
sorry, I think 0001-Mediacodec-profile-for-termux.patch was already applied, at least I can see profiles in my clean git checkout on desktop but second patch is not? May be I should ask users on big bad LOR for some more testing .... or on reddit!
Built with all 5 patches (yes, 0001-Mediacodec-profile-for-termux.patch, was already checked into GIT) 0002-Make-parallel-make-install-work.patch 0001-Do-not-use-smart-filename-expansion-in-Makefile.am.patch 0002-Mediacidec-decode-to-use-with-remap_video_codec.patch 0001-Enabke-yuva16-integer-formats-for-testing.patch 0002-Allow-16bpc-only-with-ALLOW_OLD_16BPC-env.-var.patch But I have to look at them better yet and does 0002-Allow-16... fix it so that 0001-Enable-yuva16.. is acceptable patch? On Wed, Feb 4, 2026 at 10:44 PM Andrew Randrianasulu < [email protected]> wrote:
ср, 4 февр. 2026 г., 21:55 Andrew Randrianasulu <[email protected]>:
Decode does not work reliably for me, but may be it depend on file and specific hardware?
I used remap_video_codec in decode.opts and remapped vp9 to vp9_mediacodec
Encode to h264/265 seems to work fine now, with system's ffmpeg 8.0.1
sorry, I think
0001-Mediacodec-profile-for-termux.patch
was already applied, at least I can see profiles in my clean git checkout on desktop but second patch is not?
May be I should ask users on big bad LOR for some more testing .... or on reddit!
пт, 6 февр. 2026 г., 03:29 Phyllis Smith <[email protected]>:
Built with all 5 patches (yes, 0001-Mediacodec-profile-for-termux.patch, was already checked into GIT)
0002-Make-parallel-make-install-work.patch 0001-Do-not-use-smart-filename-expansion-in-Makefile.am.patch 0002-Mediacidec-decode-to-use-with-remap_video_codec.patch 0001-Enabke-yuva16-integer-formats-for-testing.patch 0002-Allow-16bpc-only-with-ALLOW_OLD_16BPC-env.-var.patch
But I have to look at them better yet and does 0002-Allow-16... fix it so that 0001-Enable-yuva16.. is acceptable patch?
Well, it disabled by default, so I think it should be safe? Einar's fork work exclusively with yuv(a)16 so may be at least titler code can be ported from there?
On Wed, Feb 4, 2026 at 10:44 PM Andrew Randrianasulu < [email protected]> wrote:
ср, 4 февр. 2026 г., 21:55 Andrew Randrianasulu <[email protected]
:
Decode does not work reliably for me, but may be it depend on file and specific hardware?
I used remap_video_codec in decode.opts and remapped vp9 to vp9_mediacodec
Encode to h264/265 seems to work fine now, with system's ffmpeg 8.0.1
sorry, I think
0001-Mediacodec-profile-for-termux.patch
was already applied, at least I can see profiles in my clean git checkout on desktop but second patch is not?
May be I should ask users on big bad LOR for some more testing .... or on reddit!
Andrew, working on checking all of your latest patches, Question below. Decode does not work reliably for me, but may be it depend on file and
specific hardware?
I used remap_video_codec in decode.opts and remapped vp9 to vp9_mediacodec
Question about previous line -- this is something you do locally for Termux? Nothing for me to do?
вс, 8 февр. 2026 г., 19:45 Phyllis Smith <[email protected]>:
Andrew, working on checking all of your latest patches, Question below.
Decode does not work reliably for me, but may be it depend on file and
specific hardware?
I used remap_video_codec in decode.opts and remapped vp9 to vp9_mediacodec
Question about previous line -- this is something you do locally for Termux? Nothing for me to do?
Yes. I think codec remapping already described in manual? You can add this termux-specific example into Termux (sub) section: bin/ffmpeg/decode.opts # apply at init decode loglevel=fatal formatprobesize=5000000 scan_all_pmts=1 remap_video_decoder libaom-av1=libdav1d remap_video_decoder vp9=vp9_mediacodec remap_video_decoder hevc=hevc_mediacodec I also made av1 encoding profile, but as turned out this SoC can only DEcode small (512 pix max!) av1s, not encode them. I do not see much of activity on reddit's r/termux or l.o.r forum with my request for testing, so I guess for now there is just me testing this.
On Sun, Feb 8, 2026 at 8:08 PM Andrew Randrianasulu <[email protected]> wrote:
вс, 8 февр. 2026 г., 19:45 Phyllis Smith <[email protected]>:
Andrew, working on checking all of your latest patches, Question below.
Decode does not work reliably for me, but may be it depend on file and specific hardware?
I used remap_video_codec in decode.opts and remapped vp9 to vp9_mediacodec
Question about previous line -- this is something you do locally for Termux? Nothing for me to do?
Yes. I think codec remapping already described in manual? You can add this termux-specific example into Termux (sub) section:
bin/ffmpeg/decode.opts
# apply at init decode loglevel=fatal formatprobesize=5000000 scan_all_pmts=1 remap_video_decoder libaom-av1=libdav1d remap_video_decoder vp9=vp9_mediacodec remap_video_decoder hevc=hevc_mediacodec
I also made av1 encoding profile, but as turned out this SoC can only DEcode small (512 pix max!) av1s, not encode them.
I do not see much of activity on reddit's r/termux or l.o.r forum with my request for testing, so I guess for now there is just me testing this.
Posted at termux-packages github discussions: https://github.com/termux/termux-packages/discussions/28424
participants (2)
-
Andrew Randrianasulu -
Phyllis Smith