I have noticed that gstreamer1.0 on Raspbian comes with the omx plugins:
pi@pi ~ $ gst-inspect-1.0 | grep omx omx: omxh264enc: OpenMAX H.264 Video Encoder omx: omxvc1dec: OpenMAX WMV Video Decoder omx: omxmjpegdec: OpenMAX MJPEG Video Decoder omx: omxvp8dec: OpenMAX VP8 Video Decoder omx: omxtheoradec: OpenMAX Theora Video Decoder omx: omxh264dec: OpenMAX H.264 Video Decoder omx: omxh263dec: OpenMAX H.263 Video Decoder omx: omxmpeg4videodec: OpenMAX MPEG4 Video Decoder omx: omxmpeg2videodec: OpenMAX MPEG2 Video Decoder
I have googled and tried to construct a pipeline that takes a MKV file and uses the omxh264dec as well as the omxh264enc to transcode it to mp4 format. The examples that I found do not work or are easily adaptable and the gstreamter docs are... complex. Any hints?
Background to my question: I am using Plex Mediaserver on the Pi to manage my videos. I am mainly using AppleTV, iPhone and iPad to watch that media. The Apple devices easily only support h264 and aac in a mp4/m4v container. Hence I want to transcode some of the videos which do not match this. Plex can do this, but without hardware acceleration, so it's very slow. Plus I want to scale some videos down from 1080p to 720p for the iPhone and for disk space reasons. gstreamer with omx is reasonably fast and can do all these things I guess.
I am currently using avconv to remux mkv files to mp4, and using the builtin AAC encoder to recode AC3 tracks to AAC. This is probably the best I can do without doing actual video transcoding. An example command line:
avconv -i input.mkv -vcodec copy -acodec aac -strict experimental -o output.mp4
This will use the builtin aac encoder, which has to be enabled via the experimental switch. It may have some quirks, but so far it has worked fine for me. As long as I do not want to scale videos down to 720p, this seems to be fine and uses minimal amount of CPU.