Sam Leurs
Sam Leurs

Reputation: 2000

ffmpeg mov to mp4: not fast enough

I have a react native app in which users can take a video. I limited the duration of the video to max 30 seconds (for storage purposes). On iOS, a video is in the mov-format. On android, the video is in mp4-format.

For easy use, I convert the mov-file on ios to mp4 using ffmpeg. This is my command:

-i video.mov -preset ultrafast -vcodec h264 -acodec aac video.mp4

I was testing this, and everything works as expected, but converting a 30 second video almost takes to minutes, even with the -preset ultrafast flag.

A possible improvement would be copying the audio (-c:a copy) instead of re-encoding it, but I don't think it would be much faster.

Size is about 50mb for a 30 second movie.

Upvotes: 0

Views: 1873

Answers (1)

llogan
llogan

Reputation: 133873

If the MOV contains video and audio comaptible with MP4 then just re-mux (no re-encoding):

ffmpeg -i input.mov -c copy output.mp4

Upvotes: 3

Related Questions