Looking at this case:
Seems the JPEG transcoding with:
gst-launch-1.0 filesrc location=test_h264.mp4 ! qtdemux ! h264parse ! avdec_h264 ! jpegenc ! fdsink \
| gst-launch-1.0 fdsrc ! 'image/jpeg,sof-marker=(int)0, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)180/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, chroma-site=(string)jpeg' ! jpegdec ! videorate ! video/x-raw,framerate=30/1 ! x264enc ! h264parse ! 'video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)2, profile=(string)high,width=(int)320, height=(int)240, framerate=(fraction)30/1' ! qtmux ! filesink location=testOut_JPG.mp4
results in correct video.
Though, using raw video in I420 format instead results in wrong video with an unexpected offset (at least on X axis):
gst-launch-1.0 filesrc location=test_h264.mp4 ! qtdemux ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw,format=I420,width=320,height=240,framerate=30/1 ! fdsink \
| gst-launch-1.0 fdsrc ! videoparse format=i420 width=320 height=240 framerate=180 ! video/x-raw,format=I420,width=320,height=240,framerate=180/1 ! videorate ! video/x-raw,format=I420,framerate=30/1 ! x264enc ! h264parse ! 'video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)2, profile=(string)high, width=(int)320, height=(int)240, framerate=(fraction)30/1' ! qtmux ! filesink location=testOut_I420.mp4
I’m using GStreamer 1.20.3 (arm64 NVIDIA AGX Orin).
Left: JPG transcoding, right: using I420 (note the green line on top, 256 bytes offset for Y ?)
Am I missing something or it is a bug in some element ?