Sam Carleton
Sam Carleton

Reputation: 1398

H.264 trimming/downsizing and streaming with Apache

I am doing some research on how to do two things: Trim and stream H.264 video.

  1. What does it take to trim a mpeg4 h.264 video to 30 seconds and downsize it to 480p. I am assuming I would need to find a 3rd party library that does H.264 encoding, doing a quick Google search and the only thing I find is VideoLan.org, but I cannot find their commercial license. Are there other options folks know of?

  2. How is streaming of H.264 to a HTML5 work? I know that with Flash, one can have one file format that requires the whole file to be downloaded, then it will play. The other format allows streaming, but requires a Flash server. I am going to be using Apache to serve up the images on the Intranet, how does one go about streaming them on Apache?

Upvotes: 0

Views: 422

Answers (1)

d33pika
d33pika

Reputation: 2017

1) You can use FFmpeg :

ffmpeg -i in.mp4 -s 720x480 -t 30 out.mp4

-s is to resize and -t is to dump only 30 seconds

2) For http streaming, if the moov atomc(contains the video headers and seek information), is present at the start of the video, the video will start playing as soon as it buffers up few seconds, it does not wait for the whole file to download. Forward seek is possible through ByteRange headers in http. To put moov atom in the beginning use qt-fastart . It comes with FFmpeg

qt-faststart in.mp4 out.mp4

Upvotes: 2

Related Questions