Refer to gst-transcoder GStreamer command line utility for examples of transcoding including container, audio & video media file format, and resolution change.
gst-transcoder is a good tradeof between ease of use and abstraction of hardware acceleration, but if more performances are required please refer to how to transcode a video using hardware acceleration article.