Compositor video distortion when saving to .ts format

Hi,

I’m Trying to save the composited video into .ts format while showing the live preview.Unfortunately, the live preview does not appear and also when i try to play the saved .ts file, the video has been distorted.

gst-launch-1.0 -e videotestsrc pattern=black ! video/x-raw,width=320,height=240 ! nvvidconv ! queue ! tee name=t5 ! queue ! comp1.sink_0 v4l2src device=/dev/presentation ! queue ! tee name=t1 ! video/x-raw, width=1920, height=1080, framerate=60/1 ! videorate ! video/x-raw, width=1920, height=1080, framerate=30/1 ! nvvidconv ! queue ! “video/x-raw(memory:NVMM),width=960,height=540,format=NV12” ! queue ! comp1.sink_1 v4l2src device=/dev/exCAM io-mode=2 ! tee name=t2 ! queue ! image/jpeg,width=1920,height=1080,framerate=30/1 ! videorate ! image/jpeg,width=1920,height=1080,framerate=30/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! queue ! “video/x-raw(memory:NVMM),width=960,height=540,format=NV12” ! queue ! comp1.sink_2 filesrc location=/home/usr/Downloads/logo-longg-black.png ! image/png,width=1720 ,height=1440,framerate=0/1,pixel-aspect-ratio=1/1 ! pngdec ! videoconvert ! imagefreeze ! video/x-raw,framerate=30/1 ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=1950,height=270,format=NV12,pixel-aspect-ratio=1/1’ ! queue ! comp1.sink_3 filesrc location=/home/usr/Downloads/logo-neww.png ! image/png,width=1720 ,height=1440,framerate=0/1,pixel-aspect-ratio=1/1 ! pngdec ! videoconvert ! imagefreeze ! video/x-raw,framerate=30/1 ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=1950,height=270,format=NV12,pixel-aspect-ratio=1/1’ ! queue ! comp1.sink_4 videotestsrc pattern=black ! textoverlay text=“Room A” text-width=1000 text-height=1000 valignment=top font-desc=“Sans, 0” ! videoconvert ! imagefreeze ! video/x-raw,framerate=30/1 ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=1950,height=270,format=NV12,pixel-aspect-ratio=1/1’ ! queue ! comp1.sink_5 nvcompositor name=comp1 sink_0::width=1920 sink_0::height=1080 sink_1::xpos=0 sink_1::ypos=295 sink_1::width=970 sink_1::height=540 sink_2::xpos=970 sink_2::ypos=295 sink_2::width=960 sink_2::height=540 sink_3::xpos=0 sink_3::ypos=0 sink_3::width=1950 sink_3::height=270 sink_4::xpos=0 sink_4::ypos=296 sink_4::width=150 sink_4::height=50 sink_5::xpos=800 sink_5::ypos=860 sink_5::width=500 sink_5::height=250 ! queue ! nvvidconv ! queue ! nvv4l2h264enc maxperf-enable=1 profile=4 ! queue ! h264parse ! queue ! mux. liveadder name=mix1 ! queue ! audioconvert ! voaacenc ! mux. alsasrc device=“hw:externAud,0” ! queue ! audio/x-raw ! queue ! audioresample ! “audio/x-raw,rate=48000” ! tee name=a1 ! queue ! mix1.sink_0 alsasrc device=“hw:channel1,0” ! queue ! audio/x-raw ! queue ! audioresample ! “audio/x-raw,rate=48000” ! queue ! mix1.sink_1 mpegtsmux name=mux ! filesink location=“ncccew56ww.ts”

Thanks in advance.

Hi,
Please try to encode video-only h264 stream and check if the content is valid. To make sure if works in video-only first.

I’m still facing the same issue.

gst-launch-1.0 -e videotestsrc pattern=black ! video/x-raw,width=320,height=240 ! nvvidconv ! queue ! tee name=t5 ! queue ! comp1.sink_0 v4l2src device=/dev/presentation ! queue ! tee name=t1 ! video/x-raw, width=1920, height=1080, framerate=60/1 ! videorate ! video/x-raw, width=1920, height=1080, framerate=30/1 ! nvvidconv ! queue ! “video/x-raw(memory:NVMM),width=960,height=540,format=RGBA” ! queue ! comp1.sink_1 v4l2src device=/dev/exCAM io-mode=2 ! tee name=t2 ! queue ! image/jpeg,width=1920,height=1080,framerate=30/1 ! videorate ! image/jpeg,width=1920,height=1080,framerate=30/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! queue ! “video/x-raw(memory:NVMM),width=960,height=540,format=NV12” ! queue ! comp1.sink_2 filesrc location=/home/ums4/Downloads/logo-longg-black.png ! image/png,width=1720 ,height=1440,framerate=0/1,pixel-aspect-ratio=1/1 ! pngdec ! videoconvert ! imagefreeze ! video/x-raw,framerate=30/1 ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=1950,height=270,format=RGBA,pixel-aspect-ratio=1/1’ ! queue ! comp1.sink_3 filesrc location=/home/ums4/Downloads/logo-neww.png ! image/png,width=1720 ,height=1440,framerate=0/1,pixel-aspect-ratio=1/1 ! pngdec ! videoconvert ! imagefreeze ! video/x-raw,framerate=30/1 ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=1950,height=270,format=NV12,pixel-aspect-ratio=1/1’ ! queue ! comp1.sink_4 videotestsrc pattern=black ! textoverlay text=“Room A” text-width=1000 text-height=1000 valignment=top font-desc=“Sans, 0” ! videoconvert ! imagefreeze ! video/x-raw,framerate=30/1 ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=1950,height=270,format=NV12,pixel-aspect-ratio=1/1’ ! queue ! comp1.sink_5 nvcompositor name=comp1 sink_0::width=1920 sink_0::height=1080 sink_1::xpos=0 sink_1::ypos=295 sink_1::width=970 sink_1::height=540 sink_2::xpos=970 sink_2::ypos=295 sink_2::width=960 sink_2::height=540 sink_3::xpos=0 sink_3::ypos=0 sink_3::width=1950 sink_3::height=270 sink_4::xpos=0 sink_4::ypos=296 sink_4::width=150 sink_4::height=50 sink_5::xpos=800 sink_5::ypos=860 sink_5::width=500 sink_5::height=250 ! nvvidconv ! nvv4l2h264enc ! h264parse ! mpegtsmux ! filesink location=test_1.mp4

Hi,
For distortion, do you mean video quality is not good? Or some frames are broken?

All you have mentioned above and the video has been stretched.

@DaneLLL this is how it looks like.

@pulzappcheck890, you’re submitting very complex cases, but provided as bold text is not a good idea, because on this forum, text is reformatted, and quotes are changed for something maybe visually nicest, but cannot be copy/pasted into terminal for easy trying.
Please provide your case as formatted text code as previously advised.
Also try to reorganize sub-pipelines so that these can be easily individually tried, such as below.
Try to prepare each input to its expected resolution for composing.
Try to narrow down if the issue can be reproduced with simulated sources such as below or if it happens only with some devices/plugins.

Does this work ?

gst-launch-1.0 \
videotestsrc  ! video/x-raw,width=640,height=480,framerate=60/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1920,height=1080' ! nvjpegenc ! image/jpeg,format=MJPG,width=1920,height=1080,framerate=60/1 ! queue name=exCAM \
videotestsrc pattern=ball ! video/x-raw,width=640,height=480,framerate=60/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1920,height=1080,framerate=60/1' ! nvvidconv ! video/x-raw,format=NV12 ! queue name=presentation \
\
videotestsrc pattern=black ! video/x-raw,width=320,height=240 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA,width=1920,height=1080,framerate=30/1' ! tee name=t5 ! queue ! comp1.sink_0 \
presentation. ! queue ! tee name=t1 \
   t1. ! queue ! video/x-raw, width=1920, height=1080, framerate=60/1 ! videorate ! video/x-raw, width=1920, height=1080, framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),width=970,height=540,format=RGBA' ! queue ! comp1.sink_1 \
exCAM. ! queue ! tee name=t2 \
   t2. ! queue ! image/jpeg,format=MJPG,width=1920,height=1080,framerate=60/1 ! videorate ! image/jpeg,width=1920,height=1080,framerate=30/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! queue ! 'video/x-raw(memory:NVMM),width=960,height=540,format=RGBA' ! queue ! comp1.sink_2 \
filesrc location=/usr/share/jetsonpowergui/logo/nv_logo.png ! image/png,width=272,height=203,framerate=0/1,pixel-aspect-ratio=1/1 ! pngdec ! videoconvert ! videoscale add-borders=0 ! video/x-raw,width=1950,height=270,pixel-aspect-ratio=1/1 ! imagefreeze ! video/x-raw,framerate=30/1,width=1950,height=270,pixel-aspect-ratio=1/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1950,height=270,format=RGBA,pixel-aspect-ratio=1/1' ! queue ! comp1.sink_3 \
filesrc location=/usr/share/jetsonpowergui/logo/nv_logo.png ! image/png,width=272,height=203,framerate=0/1,pixel-aspect-ratio=1/1 ! pngdec ! videoconvert ! videoscale add-borders=0 ! video/x-raw,width=150,height=50,pixel-aspect-ratio=1/1 ! imagefreeze ! video/x-raw,framerate=30/1,width=150,height=50 ! nvvidconv ! 'video/x-raw(memory:NVMM),width=150,height=50,format=RGBA,pixel-aspect-ratio=1/1' ! queue ! comp1.sink_4 \
videotestsrc pattern=blue ! video/x-raw,format=RGBA,width=1950,height=270,framerate=30/1 ! textoverlay text="Room A" valignment=top font-desc="Sans, 20" ! nvvidconv ! 'video/x-raw(memory:NVMM),width=500,height=250,format=RGBA,pixel-aspect-ratio=1/1' ! queue ! comp1.sink_5 \
nvcompositor name=comp1 \
 sink_0::xpos=0   sink_0::ypos=0   sink_0::width=1920 sink_0::height=1080 sink_0::zorder=0 \
 sink_1::xpos=0   sink_1::ypos=295 sink_1::width=970  sink_1::height=540  sink_1::zorder=1 \
 sink_2::xpos=970 sink_2::ypos=295 sink_2::width=960  sink_2::height=540  sink_2::zorder=2 \
 sink_3::xpos=0   sink_3::ypos=0   sink_3::width=1950 sink_3::height=270  sink_3::zorder=3 \
 sink_4::xpos=0   sink_4::ypos=296 sink_4::width=150  sink_4::height=50   sink_4::zorder=4 \
 sink_5::xpos=800 sink_5::ypos=860 sink_5::width=500  sink_5::height=250  sink_5::zorder=5 \
 ! nvvidconv ! autovideosink

Note that there may be some gstreamer messages that should be investigated… but this may work around so far… Maybe better not using EOS for this case.

gst-launch-1.0 \
videotestsrc  ! video/x-raw,width=640,height=480,framerate=60/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1920,height=1080' ! nvjpegenc ! image/jpeg,format=MJPG,width=1920,height=1080,framerate=60/1 ! queue name=exCAM \
videotestsrc pattern=ball ! video/x-raw,width=640,height=480,framerate=60/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1920,height=1080,framerate=60/1' ! nvvidconv ! video/x-raw,format=NV12 ! queue name=presentation \
\
videotestsrc pattern=black ! video/x-raw,width=320,height=240 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA,width=1920,height=1080,framerate=30/1' ! tee name=t5 ! queue ! comp1.sink_0 \
presentation. ! queue ! tee name=t1 \
   t1. ! queue ! video/x-raw, width=1920, height=1080, framerate=60/1 ! videorate ! video/x-raw, width=1920, height=1080, framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),width=970,height=540,format=RGBA' ! queue ! comp1.sink_1 \
exCAM. ! queue ! tee name=t2 \
   t2. ! queue ! image/jpeg,format=MJPG,width=1920,height=1080,framerate=60/1 ! videorate ! image/jpeg,width=1920,height=1080,framerate=30/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! queue ! 'video/x-raw(memory:NVMM),width=960,height=540,format=RGBA' ! queue ! comp1.sink_2 \
filesrc location=/usr/share/jetsonpowergui/logo/nv_logo.png ! image/png,width=272,height=203,framerate=0/1,pixel-aspect-ratio=1/1 ! pngdec ! videoconvert ! videoscale add-borders=0 ! video/x-raw,width=1950,height=270,pixel-aspect-ratio=1/1 ! imagefreeze ! video/x-raw,framerate=30/1,width=1950,height=270,pixel-aspect-ratio=1/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1950,height=270,format=RGBA,pixel-aspect-ratio=1/1' ! queue ! comp1.sink_3 \
filesrc location=/usr/share/jetsonpowergui/logo/nv_logo.png ! image/png,width=272,height=203,framerate=0/1,pixel-aspect-ratio=1/1 ! pngdec ! videoconvert ! videoscale add-borders=0 ! video/x-raw,width=150,height=50,pixel-aspect-ratio=1/1 ! imagefreeze ! video/x-raw,framerate=30/1,width=150,height=50 ! nvvidconv ! 'video/x-raw(memory:NVMM),width=150,height=50,format=RGBA,pixel-aspect-ratio=1/1' ! queue ! comp1.sink_4 \
videotestsrc pattern=blue ! video/x-raw,format=RGBA,width=1950,height=270,framerate=30/1 ! textoverlay text="Room A" valignment=top font-desc="Sans, 20" ! nvvidconv ! 'video/x-raw(memory:NVMM),width=500,height=250,format=RGBA,pixel-aspect-ratio=1/1' ! queue ! comp1.sink_5 \
nvcompositor name=comp1 \
 sink_0::xpos=0   sink_0::ypos=0   sink_0::width=1920 sink_0::height=1080 sink_0::zorder=0 \
 sink_1::xpos=0   sink_1::ypos=295 sink_1::width=970  sink_1::height=540  sink_1::zorder=1 \
 sink_2::xpos=970 sink_2::ypos=295 sink_2::width=960  sink_2::height=540  sink_2::zorder=2 \
 sink_3::xpos=0   sink_3::ypos=0   sink_3::width=1950 sink_3::height=270  sink_3::zorder=3 \
 sink_4::xpos=0   sink_4::ypos=296 sink_4::width=150  sink_4::height=50   sink_4::zorder=4 \
 sink_5::xpos=800 sink_5::ypos=860 sink_5::width=500  sink_5::height=250  sink_5::zorder=5 \
 ! nvvidconv ! nvv4l2h264enc ! h264parse ! mpegtsmux ! filesink location=test_1.ts

Interrupt with Ctrl-C after some seconds and check result with:

gst-play-1.0 test_1.ts

The layouts works fine when i play through gst-play and when i try to play the same video through the video player, still the video is heavily distorted

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.