architecture-samples icon indicating copy to clipboard operation
architecture-samples copied to clipboard

Flood logs of "AmSubtitle" when using ViewVideo

Open NabilPopo opened this issue 3 years ago • 1 comments

Dear Support Team,

I am using VideoView to run a serie of videos and whenever I check the Logcat I got flood of log with "AmSubtitle".

I want to remove this Log, what should I do ?

thank you

  1. Logcat flood log

  2. My code code

NabilPopo avatar Aug 25 '22 10:08 NabilPopo

Solution Options Since these are system-level logs, you cannot directly disable them via your code. However, here are 4 effective workarounds depending on your goal:

  1. Filter Logcat Output (Recommended for development) When debugging via Logcat, filter out unwanted tags so they don’t flood your view.

In Android Studio:

Use Logcat's filter box: Example:

-AmSubtitle Or set the filter to show only your app’s tag:

tag:MyAppTag 2. Use ExoPlayer Instead of VideoView (Best Long-Term Solution) VideoView is a wrapper around MediaPlayer, which is outdated and limited. Switching to ExoPlayer gives you:

Better performance

Fine-grained control

Less noise in logs

Cleaner subtitle and media pipeline handling

Replace VideoView with ExoPlayer like this:

val player = ExoPlayer.Builder(context).build() val playerView = PlayerView(context) playerView.player = player

val mediaItem = MediaItem.fromUri(videoUri) player.setMediaItem(mediaItem) player.prepare() player.play()

  1. Suppress Logs (Advanced/Not Recommended) You can’t remove "AmSubtitle" logs unless you:

Use a custom AOSP build of Android and remove that log line from the native media source code.

Root the device and override logcat behavior via native logd modifications (very risky, not advised).

So this is not a feasible route for normal app development.

  1. Use Logcat Level Filtering via ADB (for device-wide quiet logs) You can run this via ADB to limit verbose logs:

adb logcat :S AmSubtitle:S This silences all logs (:S) and specifically AmSubtitle as well.

To only show your app's logs:

adb logcat YOUR_APP_TAG:V *:S

VaradGupta23 avatar Jul 16 '25 04:07 VaradGupta23