Reduce size of output mp4 file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Reduce size of output mp4 file

tgn1
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.

Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: Reduce size of output mp4 file

Tim Müller
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
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Reduce size of output mp4 file

tgn1
This post was updated on .
Could you please give me an example how I could add this to this current pipeline or I need to create another one? What is the best way to implement these encoders?

Thanks

EDIT: Also, I think using the video/x-h264 the camera auto encodes it to H264, isn't it?