I used the command;
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=YUYV --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw
I wrote a shell script that executed this command for 10 different times, and saving the file as
test1.raw
test2.raw
test3.raw
…
test10.raw
And I can see the video is playing, since the square of our pattern generator moves and changes position with each frame.
Then I’ve proceeded with the video;
v4l2-ctl --set-fmt-video=width=1280,height=720,pixelformat=YUYV --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100 -d /dev/video0 --stream-to=ov491.raw
scp ov491.raw burak@192.168.1.100:/home/burak/Desktop
[code]mplayer /home/burak/Desktop/ov491.raw -demuxer rawvideo -rawvideo w=1280:h=720:fps=30:format=yuy2
I can play the recorded raw video just fine with these commands.
But I need to stream the video with commands similar to these;
// usb camera
gst-launch-1.0 v4l2src device=/dev/video0 ! videorate max-rate=25 ! videoconvert ! omxh265enc qp-range=30,50:30,50:30,50 control-rate=4 bitrate=3000000 ! "video/x-h265, stream-format=(string)byte-stream" ! rtph265pay mtu=1400 ! udpsink host=192.168.1.100 port=5600 sync=false async=false
// watch stream on PC
gst-launch-1.0 udpsrc port=5600 ! application/x-rtp, encoding-name=H265, payload=96 ! rtph265depay ! h265parse ! queue ! avdec_h265 ! xvimagesink sync = false
However the first command outputs;
nvidia@tegra-ubuntu:~$ gst-launch-1.0 v4l2src device=/dev/video0 ! videorate max-rate=25 ! videoconvert ! omxh265enc qp-range=30,50:30,50:30,50 control-rate=4 bitrate=3000000 ! "video/x-h265, stream-format=(string)byte-stream" ! rtph265pay mtu=1400 ! udpsink host=192.168.1.100 port=5600 sync=false async=false
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video0' cannot capture in the specified format
Additional debug info:
gstv4l2object.c(3481): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Tried to capture in YU12, but device returned format YUYV
Execution ended after 0:00:00.001618073
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Any idea on how I can set the YUV12 to YUYV Shane? Thank you!