Closed ritesh94 closed 6 years ago
Your FFmpeg command is wrong. -t
is the the duration in seconds and not a timestamp. Please test your command on your pc first because it seems like this is not an issue related with this library.
@Brianvdb
When I use the command to trim video to 15sec (88+15 = 103 sec) it works well.
-y -i /storage/emulated/0/abc.mp4 -ss 88 -t 103 -async 1 -c copy /storage/emulated/0/video_trimmed.mp4
How should I achieve 3 seconds video trim ?
-t 3
@Brianvdb
If I use -t 3
The video trims to 3secs but I get a black video output
ffmpeg -i input.mp4 -ss 20 -t 3 output.mp4
This command works fine for me. Where 20 is the starttime in seconds.
@Brianvdb
Dont know how, but now it worked using same command with -t 3
-y -i /storage/emulated/0/abc.mp4 -ss 88 -t 3 -async 1 -c copy /storage/emulated/0/video_trimmed.mp4
Just to confirm,
-t
will have the duration (in seconds) that we want to trim from startTime, correct?
(Eg: 15 for 15secs trim from startTime)
@ritesh94 Yes
ok Thanks @Brianvdb . Great library and great work as well :+1:
Hi guys, I've using this command for trimming video:
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.
It also cut 2s if I use -ss 00:00:01.200
, seem it can only cut by seconds instead of milliseconds
Can you guys please help me in this case.
@Brianvdb
When I try to trim a video to
3 sec
the output video becomes01 mins :23 sec
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
Video file details: Duration: 02 mins 51 secs Size: 1280x720
Below are the logs: