cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
572 Views
Registered: ‎09-28-2019

VTG + FFMPEG

Hello,

I'm implementing a simple video pipeline (TPG + VDMA) on Zynq.

I can see under linux /dev/video0 and /dev/media0 nodes.

I want to capture and display the video framebuffer. I'm using FFMPEG for this purpose.

When I run ffmpeg -i /dev/video0, I have this error:

[video4linux2,v4l2 @ 0x55890] Not a video capture device.
/dev/video0: No such device

Any suggestion?

Thanks.

 

0 Kudos
12 Replies
Highlighted
Mentor
Mentor
566 Views
Registered: ‎06-16-2013

Re: VTG + FFMPEG

Hi @tgharbi2020 

 

Would you make sure capability on /dev/video0 by the following command ?

 

v4l2-ctl -d /dev/video0 --info

 

Best regards,

0 Kudos
Highlighted
Observer
Observer
558 Views
Registered: ‎09-28-2019

Re: VTG + FFMPEG

 Hi @watati

This is the output of the command: v4l2-ctl -d /dev/video0 --info

Driver Info (not using libv4l2):
Driver name : xilinx-vipp
Card type : video_cap output 0
Bus info : platform:video_cap:0
Driver version: 4.14.0
Capabilities : 0x84201000
Video Capture Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04201000
Video Capture Multiplanar
Streaming
Extended Pix Format
0 Kudos
Highlighted
Observer
Observer
501 Views
Registered: ‎09-28-2019

Re: VTG + FFMPEG

Any other suggestion please?

0 Kudos
Highlighted
Observer
Observer
451 Views
Registered: ‎09-28-2019

Re: VTG + FFMPEG

Hi guys,

Is there any other suggestion/explanation?

I have the same output error ("not a video capture device") when using yavta.

0 Kudos
Highlighted
Mentor
Mentor
424 Views
Registered: ‎06-16-2013

Re: VTG + FFMPEG

Hi @tgharbi2020 

 

Whould you share BD, if possible ?

It's hard to explain it without block diagram.

 

Best regards,

0 Kudos
Highlighted
Observer
Observer
417 Views
Registered: ‎09-28-2019

Re: VTG + FFMPEG

Hi @watari

image.png

and for detailed vue:

image.png

0 Kudos
Highlighted
Mentor
Mentor
409 Views
Registered: ‎06-16-2013

Re: VTG + FFMPEG

Hi @tgharbi2020 

 

Whare do "vid_io_in" signals on vid_in_axis4 come from ?

What kind of signals are "vid_io_in" on vid_in_axis4 ?

I guess you need to add more something in dts or modify your design...

 

Also, refer the following URL.

Especially, you set proper value on each properties, after finding /dev/video*.

 

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841767/Xilinx+V4L2+driver

 

Best regards,

0 Kudos
Highlighted
Observer
Observer
404 Views
Registered: ‎09-28-2019

Re: VTG + FFMPEG

vio_io_in comes from a custom video decoder in FPGA, representing active video + sync signals.

I join here video dts section:

	amba_pl {
		#address-cells = <0x1>;
		#size-cells = <0x1>;
		compatible = "simple-bus";
		ranges;

		vdma: dma@43000000 {
			#dma-cells = <0x1>;
			clock-names = "s_axi_lite_aclk", "m_axi_s2mm_aclk", "s_axis_s2mm_aclk";
			clocks = <0x1 0xf 0x1 0xf 0x1 0xf>;
			compatible = "xlnx,axi-vdma-6.3", "xlnx,axi-vdma-1.00.a";
			interrupt-names = "s2mm_introut";
			interrupt-parent = <0x4>;
			interrupts = <0x0 0x3b 0x4>;
			reg = <0x43000000 0x10000>;
			xlnx,addrwidth = <0x20>;
			xlnx,flush-fsync = <0x1>;
			xlnx,num-fstores = <0x1>;

			dma-channel@43000030 {
				compatible = "xlnx,axi-vdma-s2mm-channel";
				interrupts = <0x0 0x3b 0x4>;
				xlnx,datawidth = <0x18>;
				xlnx,device-id = <0x0>;
				xlnx,genlock-mode;
				xlnx,include-dre;
			};
		};

		v_tpg@43c10000 {
			clock-names = "ap_clk";
			clocks = <0x1 0xf>;
			compatible = "xlnx,v-tpg-8.0", "xlnx,v-tpg-5.0";
			reg = <0x43c10000 0x10000>;
			xlnx,s-axi-ctrl-addr-width = <0x8>;
			xlnx,s-axi-ctrl-data-width = <0x20>;
			reset-gpios = <&gpio 54 1>;
			xlnx,max-height = <720>;
			xlnx,max-width	= <576>;
			tpg_ports: ports {
				#address-cells = <1>;
				#size-cells = <0>;
				tpg_port0: port@0 {
					/* Fill the field xlnx,video-format based on user requirement */
					reg = <0>;
					xlnx,video-format = <0>;
					xlnx,video-width = <8>;
					tpg_out: endpoint {
						remote-endpoint = <&vcap0_in0>;
					};
				};
			};
		};

		video_cap {
		    compatible = "xlnx,video";
		    dmas = <&vdma 0>;
		    dma-names = "port0";
		 
		    ports {
			#address-cells = <1>;
			#size-cells = <0>;
		 
			port@0 {
			    reg = <0>;
			    direction = "input";
			    vcap0_in0: endpoint {
				remote-endpoint = <&tpg_out>;
			    };
			};
		    };
		};
		
	};

 

0 Kudos
Highlighted
Moderator
Moderator
256 Views
Registered: ‎11-09-2015

Re: VTG + FFMPEG

HI @tgharbi2020 

Are you sure /dev/video0 represents the TPG?

Did you try enabling libv4l2?

 


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Highlighted
Observer
Observer
252 Views
Registered: ‎09-28-2019

Re: VTG + FFMPEG

Hi @florentw 

yes, video0 is the vcap of my pipeline: TPG + VDMA

I don't have any other internal/external video source.

I'm not sure about libv4l2 but I still have the same error even with yavta

I attach some log output

 

0 Kudos
Highlighted
Moderator
Moderator
171 Views
Registered: ‎11-09-2015

Re: VTG + FFMPEG

HI @tgharbi2020 

What vivado + petalinux versions are you using? 

Make sure you are using the latest one.

I believe in some earlier versions, the TPG had to be used as a path-through device, this might be why the driver was not exposing it as a capture device.

Regards


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Highlighted
Observer
Observer
165 Views
Registered: ‎09-28-2019

Re: VTG + FFMPEG

Hi @florentw 

I'm using vivado + petalinux 2018.3

I resolved the error by adding in bootargs: xilinx-video.is_mplane=0.

But, the capture is still not working, with another error:

ffmpeg -f v4l2 -list_formats all -i /dev/video0
... [video4linux2,v4l2 @ 0x6bff0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video0: Inappropriate ioctl for device

I have doubts about xilinx-video driver of xilinx linux 4.14.

So, I built the last xlnx kernel 5.4, but zynq boot hangs after pipeline registration:

https://forums.xilinx.com/t5/Video/xilinx-video-Zynq-boot-hangs-after-video-cap-pipeline/m-p/1085474

 

Finally, I tried to not use V4L2 framework. So, I tried to read framebuffer from DDR and stream it to a pipe, as an input for ffmpeg (ffmpeg -i pipe:0 ...). For this purpose, I need to define a callback function of video frame buffer write (linux app). Thus, my questions here: https://forums.xilinx.com/t5/Video/Video-Framebuffer-Write-handling-interrupt-in-linux-app/m-p/1085151#M31311 

 

Help is welcome

 

0 Kudos