gregoiregentil
gregoiregentil

Reputation: 1899

Gstreamer-1.0: mux raw video in a mp4 container

I have a raw video that I can play through gstreamer:

gst-launch-1.0 ... autovideoconvert ! autovideosink

I can encode this video:

gst-launch-1.0 ... ! autovideoconvert ! x264enc ! h264parse ! mp4mux ! filesink location=a.mp4

I would like now to put this raw video in a mp4 container "lossless", without any compression. How can I do that?

Upvotes: 1

Views: 4959

Answers (3)

mpr
mpr

Reputation: 3378

Sometimes the source data won't be suitable for re-muxing, but if it is a pipeline such as this should work:

gst-launch-1.0 filesrc location=... ! [DEMUX] ! h264parse ! qtmux ! filesink location=...

h264 data has different "stream formats" and "alignments" that it can be in. The stream formats are avc, avc3, and byte-stream. The possible alignments are au and nal. Different muxers take different combinations of these. h264parse will make that transformation if necessary.

And to re-iterate, sometimes the source data just won't be re-muxable into the desired container. It depends on a lot of factors.

Upvotes: 0

gregoiregentil
gregoiregentil

Reputation: 1899

I don't think I can use mp4mux but qtmux accept raw-uyvy. The following works:

gst-launch-1.0 ... ! autovideoconvert ! "video/x-raw,format=(string)UYVY" ! qtmux ! filesink location=a.mov

Upvotes: 0

Bogdan Wood
Bogdan Wood

Reputation: 61

You answered in your question. Don't do compression

gst-launch-1.0 ... ! autovideoconvert ! mp4mux ! filesink location=a.mp4

But you know, without compression this file will be large (GBytes.)

Upvotes: 1

Related Questions