Reduce size of output mp4 file

Tim Müller tim at centricular.com
Fri Jul 1 08:30:20 UTC 2016


On Thu, 2016-06-30 at 09:21 -0700, tgn1 wrote:

Hi,

> I have this pipeline:
> 
> gst-launch-1.0 -e v4l2src device=/dev/video1 \
> !  video/x-h264, width=800, height=448, framerate=24/1 ! tee
> name=myvid \
> ! queue ! decodebin ! xvimagesink sync=false \ myvid. ! mux.video_0 \
> alsasrc device=plughw:1,0 ! audio/x-
> raw,rate=44100,channels=2,depth=16 !
> audioconvert ! lamemp3enc ! queue ! mux.audio_0 \ 
> avimux name=mux ! filesink location=out.mp4
> 
> And I wanted to know if there's any possible way to make the size of
> mp4 file output smaller. If I stream for like 3minutes, the file size
> gets up to 3GB~. Do you have any solutions or suggestions? Please,
> help me.

You are not creating an mp4 file here. To create an mp4 file, use
mp4mux (or qtmux), and an AAC audio encoder and an H.264 video encoder.

You are muxing raw uncompressed video frames into the file here, and
those are huge. Try adding a video encoder.

Cheers
 -Tim

-- 

Tim Müller, Centricular Ltd - http://www.centricular.com


More information about the gstreamer-devel mailing list