Using GStreamer to transcode Video files with Hardware Accel


I am trying to convert a videofile from mpeg2 to h265 using omxh265enc.
Transcoding the video stream works fine. However the file has an audio and a video stream. I want to keep the audio stream as is, since it is already mp3. I tried the following queue:

gst-launch-1.0 filesrc location=sourcefile.mkv ! matroskademux name=demux matroskamux name=mux ! filesink location=destfile.mkv
demux.audio_0 ! queue ! mux.
demux.video_0 ! mpegvideoparse ! omxmpeg2videodec ! queue ! omxh265enc preset-level=3 bitrate=750000 EnableTwopassCBR=true control-rate=variable ! mux.

However this hangs in prerolling. Doing just one of the two streams work. What am I doing wrong?

I managed to get it working, there was a queue missing before the mux in the video part. I also needed an mpegaudioparse after demux.audio_0.

One oddity: The original file has mp3 as audio format the result mp2. Is there a way to just pass through the mp3?

For passing through the audio stream, please go to gstreamer forum.

We have a working re-muxing pipeline but aac stream has to be re-decoded and encoded again:

Uers in gstreamer forum may have more experinece and can share suggestion.