Following is the command for trimming: (88 and 91 are the start and end time in seconds)
-y -i /storage/emulated/0/abc.mp4 -ss 88 -t 91 -async 1 -c copy /storage/emulated/0/video_trimmed.mp4
TrimUtil -- > Cmd : -y -i /storage/emulated/0/abc.mp4 -ss 88 -t 91 -async 1 -c copy /storage/emulated/0/video_trimmed.mp4
D/FFmpeg: Build.CPU_ABI : arm64-v8a
D/FFmpeg: ffmpeg is ready!
TrimUtil -- > FFMPEG isSupported
TrimUtil -- > FFMPEG onStart
D/FFmpeg: Running publishing updates method
TrimUtil -- > FFMPEG progress:ffmpeg version n3.4.2-9-ga877ab7 Copyright (c) 2000-2018 the FFmpeg developers
TrimUtil -- > FFMPEG progress: built with gcc 4.9.x (GCC) 20150123 (prerelease)
TrimUtil -- > FFMPEG progress: configuration: --target-os=linux --cross-prefix=/root/bravobit/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/root/bravobit/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-fontconfig --enable-libass --enable-libvpx --enable-ffprobe --enable-yasm --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-linux-perf --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --enable-nonfree --enable-network --enable-avresample --enable-avformat --enable-avcodec --enable-indev=lavfi --enable-hwaccels --enable-ffmpeg --enable-zlib --enable-gpl --enable-small --pkg-config=/root/bravobit/ffmpeg-android/ffmpeg-pkg-config --prefix=/root/bravobit/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/root/bravobit/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/root/bravobit/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-cxxflags= --extra-libs='-lpng -lx264 -lexpat -lm -logg'
TrimUtil -- > FFMPEG progress: libavutil 55. 78.100 / 55. 78.100
TrimUtil -- > FFMPEG progress: libavcodec 57.107.100 / 57.107.100
TrimUtil -- > FFMPEG progress: libavformat 57. 83.100 / 57. 83.100
TrimUtil -- > FFMPEG progress: libavdevice 57. 10.100 / 57. 10.100
TrimUtil -- > FFMPEG progress: libavfilter 6.107.100 / 6.107.100
TrimUtil -- > FFMPEG progress: libavresample 3. 7. 0 / 3. 7. 0
TrimUtil -- > FFMPEG progress: libswscale 4. 8.100 / 4. 8.100
TrimUtil -- > FFMPEG progress: libswresample 2. 9.100 / 2. 9.100
TrimUtil -- > FFMPEG progress: libpostproc 54. 7.100 / 54. 7.100
TrimUtil -- > FFMPEG progress:Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/abc.mp4':
TrimUtil -- > FFMPEG progress: Metadata:
TrimUtil -- > FFMPEG progress: major_brand : isom
TrimUtil -- > FFMPEG progress: minor_version : 512
TrimUtil -- > FFMPEG progress: compatible_brands: isomiso2avc1mp41
TrimUtil -- > FFMPEG progress: creation_time : 1970-01-01T00:00:00.000000Z
TrimUtil -- > FFMPEG progress: encoder : Lavf53.24.2
TrimUtil -- > FFMPEG progress: Duration: 00:02:50.86, start: 0.000000, bitrate: 1474 kb/s
TrimUtil -- > FFMPEG progress: Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1086 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
TrimUtil -- > FFMPEG progress: Metadata:
TrimUtil -- > FFMPEG progress: creation_time : 1970-01-01T00:00:00.000000Z
TrimUtil -- > FFMPEG progress: handler_name : VideoHandler
TrimUtil -- > FFMPEG progress: Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
TrimUtil -- > FFMPEG progress: Metadata:
TrimUtil -- > FFMPEG progress: creation_time : 1970-01-01T00:00:00.000000Z
TrimUtil -- > FFMPEG progress: handler_name : SoundHandler
TrimUtil -- > FFMPEG progress:Output #0, mp4, to '/storage/emulated/0/video_trimmed.mp4':
TrimUtil -- > FFMPEG progress: Metadata:
TrimUtil -- > FFMPEG progress: major_brand : isom
TrimUtil -- > FFMPEG progress: minor_version : 512
TrimUtil -- > FFMPEG progress: compatible_brands: isomiso2avc1mp41
TrimUtil -- > FFMPEG progress: encoder : Lavf57.83.100
TrimUtil -- > FFMPEG progress: Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 1086 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
TrimUtil -- > FFMPEG progress: Metadata:
TrimUtil -- > FFMPEG progress: creation_time : 1970-01-01T00:00:00.000000Z
TrimUtil -- > FFMPEG progress: handler_name : VideoHandler
TrimUtil -- > FFMPEG progress: Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
TrimUtil -- > FFMPEG progress: Metadata:
TrimUtil -- > FFMPEG progress: creation_time : 1970-01-01T00:00:00.000000Z
TrimUtil -- > FFMPEG progress: handler_name : SoundHandler
TrimUtil -- > FFMPEG progress:Stream mapping:
TrimUtil -- > FFMPEG progress: Stream #0:0 -> #0:0 (copy)
TrimUtil -- > FFMPEG progress: Stream #0:1 -> #0:1 (copy)
TrimUtil -- > FFMPEG progress:Press [q] to stop, [?] for help
TrimUtil -- > FFMPEG progress:frame= 1978 fps=0.0 q=-1.0 size= 14592kB time=00:01:20.25 bitrate=1489.5kbits/s speed= 161x
TrimUtil -- > FFMPEG progress:frame= 2042 fps=0.0 q=-1.0 Lsize= 15212kB time=00:01:22.83 bitrate=1504.3kbits/s speed= 161x
TrimUtil -- > FFMPEG progress:video:11277kB audio:3888kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.306889%
TrimUtil -- > FFMPEG onSuccess:ffmpeg version n3.4.2-9-ga877ab7 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.9.x (GCC) 20150123 (prerelease)
configuration: --target-os=linux --cross-prefix=/root/bravobit/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/root/bravobit/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-fontconfig --enable-libass --enable-libvpx --enable-ffprobe --enable-yasm --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-linux-perf --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --enable-nonfree --enable-network --enable-avresample --enable-avformat --enable-avcodec --enable-indev=lavfi --enable-hwaccels --enable-ffmpeg --enable-zlib --enable-gpl --enable-small --pkg-config=/root/bravobit/ffmpeg-android/ffmpeg-pkg-config --prefix=/root/bravobit/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/root/bravobit/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/root/bravobit/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-cxxflags= --extra-libs='-lpng -lx264 -lexpat -lm -logg'
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/abc.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01T00:00:00.000000Z
encoder : Lavf53.24.2
Duration: 00:02:50.86, start: 0.000000, bitrate: 1474 kb/s
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1086 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
Output #0, mp4, to '/storage/emulated/0/video_trimmed.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.83.100
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 1086 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
05-28 18:20:07.584 3488-3488/com.example.ritesh.exoplayertrim I/System.out: Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1978 fps=0.0 q=-1.0 size= 14592kB time=00:01:20.25 bitrate=1489.5kbits/s speed= 161x
frame= 2042 fps=0.0 q=-1.0 Lsize= 15212kB time=00:01:22.83 bitrate=1504.3kbits/s speed= 161x
video:11277kB audio:3888kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.306889%
TrimUtil -- > FFMPEG onFinish