You can specify timestamps in the streams, a from and to.
Example:
ffmpeg -i input.mkv -ss 00:15:25 -to 01:02:14 output.mp4
Here the -ss is the start time and -to is the ending.
It's better to control the codec used for the encoding, to make sure it's compatible with the container, and in your case if you want to upload, it's better to have something that plays in the browser, that's libx264.
Example:
ffmpeg -i input.mkv -ss 00:15:25 -to 01:02:14 -c:v libx264 output.mp4
The new is the -c:v which is "coded:video".
This is the basics for your use case.