<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div><p style="margin: 0px 0px 1.1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-stretch: inherit; line-height: inherit; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; --_pr-img-mb: 0; color: rgb(35, 38, 41);">I have a 426x240 nv12 data file. I use the following command to play it, the resulting playback picture is distorted:</p><pre style="margin-top: 0px; margin-bottom: calc(1.5em); padding: var(--su12); border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-stretch: inherit; line-height: var(--lh-md); font-family: var(--ff-mono); font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: var(--fs-body1); vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; background-color: var(--highlight-bg); border-radius: var(--br-md); overflow-wrap: normal; color: var(--highlight-color);"><code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: var(--ff-mono); font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: var(--_pr-code-fs); vertical-align: baseline; box-sizing: inherit; background-color: transparent; white-space: inherit; color: var(--black-800); border-radius: 0px;"><span style="background-color: rgb(216, 216, 216);">gst-launch-1.0 filesrc location=426x240-nv12-25fps-5s.yuv ! videoparse format=nv12 width=426 height=240 framerate=1/1 ! videoconvert ! autovideosink</span></code></pre><p style="margin: 0px 0px 1.1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-stretch: inherit; line-height: inherit; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; --_pr-img-mb: 0; color: rgb(35, 38, 41);">I suspect that this problem is related to byte alignment. The width of the above file is 426, which is not 4-byte aligned; for some other 4-byte-aligned files, such as 428x240, 640x480, etc., using such commands can be played correctly:</p><pre style="margin-top: 0px; margin-bottom: calc(1.5em); padding: var(--su12); border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-stretch: inherit; line-height: var(--lh-md); font-family: var(--ff-mono); font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: var(--fs-body1); vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; background-color: var(--highlight-bg); border-radius: var(--br-md); overflow-wrap: normal; color: var(--highlight-color);"><code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: var(--ff-mono); font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: var(--_pr-code-fs); vertical-align: baseline; box-sizing: inherit; background-color: transparent; white-space: inherit; color: var(--black-800); border-radius: 0px;"><span style="background-color: rgb(216, 216, 216);">gst-launch-1.0 filesrc location=428x240-nv12-25fps-5s.yuv ! videoparse format=nv12 width=428 height=240 framerate=1/1 ! videoconvert ! autovideosink</span></code></pre><p style="margin: 0px 0px 1.1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-stretch: inherit; line-height: inherit; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; --_pr-img-mb: 0; color: rgb(35, 38, 41);">my question is :</p><p style="margin: 0px 0px 1.1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-stretch: inherit; line-height: inherit; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; --_pr-img-mb: 0; color: rgb(35, 38, 41);">1.Is my guess correct? (Non-4-byte alignment causes playback exception)</p><p style="margin: 0px 0px 1.1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-stretch: inherit; line-height: inherit; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; --_pr-img-mb: 0; color: rgb(35, 38, 41);">2.How to use the gst-launch to play such a video file?</p><p style="margin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-stretch: inherit; line-height: inherit; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; --_pr-img-mb: 0; color: rgb(35, 38, 41);"><br></p></div></div><img style="width:1px;height:1px" src="https://count.mail.163.com/beacon/webmail.gif?type=webmail_mailtrace&guid=1e85bb1839b59180342562d92af9b361">