SuperJOE
SuperJOE

Reputation: 73

How to convert mp4 to mkv H.264 with gst-launch-1.0 on Raspberry Pi

Is my code correct ? I try to convert .mp4 to .mkv H.264 with gst-launch-1.0 on Raspberry Pi

gst-launch-1.0 -v filesrc location=sample_mpeg4.mp4 ! omxmpeg4videodec ! omxh264enc ! matroskamux ! filesink location=out.mkv

Upvotes: 0

Views: 3049

Answers (1)

thiagoss
thiagoss

Reputation: 2094

Do you get any errors? Please remember to mention that in future questions as it helps narrowing down the problems.

It should not be right, .mp4 is usually a termination for mp4 container format and not for mpeg4 video codec. You should need something like:

gst-launch-1.0 -v filesrc location=sample_mpeg4.mp4 ! qtdemux ! omxmpeg4videodec ! queue ! videoconvert ! omxh264enc ! matroskamux ! filesink location=out.mkv

This will only convert the video, audio on the original media file will be lost. It might also be more practical to just use uridecodebin for the decoding part:

gst-launch-1.0 -v uridecodebin uri=file:///path/to/sample.mp4 ! queue ! videoconvert ! omxh264enc ! matroskamux ! filesink location=out.mkv

Upvotes: 0

Related Questions