# Slice-based encoding Source: [https://docs.qualcomm.com/doc/80-70015-50/topic/slice-based-encoding.html](https://docs.qualcomm.com/doc/80-70015-50/topic/slice-based-encoding.html) With slice support for video encoding, the video stream is divided or sliced into multiple separate sections so that you can encode them in parallel. You can use slice-based encoding for video playback, teleconferencing, and security camera use cases. The following commands enable you to implement slice-based encoding on a camera stream. ## H.264 - 1280x720, maximum slices per frame = 10: gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw\(memory:GBM\),format=NV12,width=1280,height=720,framerate=30/1,compression=ubwc,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=5 output-io-mode=5 extra-controls="controls,slice_partitioning_method=1;" ! filesink location="/opt/encoded.h264"Copy to clipboard - 1280x720, slices per frame = 8: gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw\(memory:GBM\),format=NV12,width=1280,height=720,framerate=30/1,compression=ubwc,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=5 output-io-mode=5 extra-controls="controls,slice_partitioning_method=1,number_of_mbs_in_a_slice=460;" ! filesink location="/opt/encoded.h264"Copy to clipboard - 1920x1080, slices per frame =3: gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw\(memory:GBM\),format=NV12,width=1920,height=1080,framerate=30/1,compression=ubwc,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=5 output-io-mode=5 extra-controls="controls,slice_partitioning_method=1,number_of_mbs_in_a_slice=2720;" ! filesink location="/opt/encoded.h264"Copy to clipboard - 1280x720, Max Bytes mode: gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw\(memory:GBM\),format=NV12,width=1280,height=720,framerate=30/1,compression=ubwc,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=5 output-io-mode=5 extra-controls="controls,slice_partitioning_method=2;" ! filesink location="/opt/encoded.h264"Copy to clipboard ## H.265 - 1280x720, maximum slices per frame = 10: gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw\(memory:GBM\),format=NV12,width=1280,height=720,framerate=30/1,compression=ubwc,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h265enc capture-io-mode=5 output-io-mode=5 extra-controls="controls,slice_partitioning_method=1;" ! filesink location="/opt/encoded.h265"Copy to clipboard - 1280x720, slices per frame = 8: gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw\(memory:GBM\),format=NV12,width=1280,height=720,framerate=30/1,compression=ubwc,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h265enc capture-io-mode=5 output-io-mode=5 extra-controls="controls,slice_partitioning_method=1,number_of_mbs_in_a_slice=460;" ! filesink location="/opt/encoded.h265"Copy to clipboard - 1920x1080, slices per frame = 3: gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw\(memory:GBM\),format=NV12,width=1920,height=1080,framerate=30/1,compression=ubwc,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h265enc capture-io-mode=5 output-io-mode=5 extra-controls="controls,slice_partitioning_method=1,number_of_mbs_in_a_slice=2720;" ! filesink location="/opt/encoded.h265"Copy to clipboard - 1280x720, Max Bytes mode: gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw\(memory:GBM\),format=NV12,width=1280,height=720,framerate=30/1,compression=ubwc,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h265enc capture-io-mode=5 output-io-mode=5 extra-controls="controls,slice_partitioning_method=2;" ! filesink location="/opt/encoded.h265"Copy to clipboard **Parent Topic:** [Camera and video encode](https://docs.qualcomm.com/doc/80-70015-50/topic/camera-and-video-encode.html) Last Published: Oct 27, 2025 [Previous Topic Two stream - 1080p MJPEG encoder](https://docs.qualcomm.com/bundle/publicresource/80-70015-50/topics/1080p-mjpeg-encoder.md) [Next Topic Intra-frame smart codec (H.264 and H.265)](https://docs.qualcomm.com/bundle/publicresource/80-70015-50/topics/intra-frame-smart-codec.md)