The trim function on Android seem have a bit inaccuracy, this is the option that I used for trim:
{startTime: 0.4, endTime: 47}
The ffmpeg command is:
ffmpeg -y -i movie.mp4 -ss 00:00:00.400 -to 00:00:47 -preset ultrafast -c:v copy -c:a copy cut.mp4
But the result always have the duration 46s, that mean it always cut 1s instead of 400ms as the params above.
If I use {startTime: 1.2} it also cut 2s, seem it can not cut by milliseconds, just the seconds only.
On iOS it can work perfectly, maybe it's a bug come from ffmpeg, or we need to change some params for more accurate.
Expected Behavior
The trim function can work correctly, the video output should have the duration 46.6s
Current Behavior
The trim function on Android seem have a bit inaccuracy, this is the option that I used for trim:
{startTime: 0.4, endTime: 47}
The ffmpeg command is:
ffmpeg -y -i movie.mp4 -ss 00:00:00.400 -to 00:00:47 -preset ultrafast -c:v copy -c:a copy cut.mp4
But the result always have the duration 46s, that mean it always cut 1s instead of 400ms as the params above. If I use
{startTime: 1.2}
it also cut 2s, seem it can not cut by milliseconds, just the seconds only.On iOS it can work perfectly, maybe it's a bug come from ffmpeg, or we need to change some params for more accurate.
Expected Behavior
The trim function can work correctly, the video output should have the duration 46.6s
Your Environment
Android OS: 8.1 / 9.0 Samsung J7 Prime / Samsung S9+