I have a WinTV HVR950Q which works fine. The device needs a firmware
download at initialization time; I generally do a shell script as follows before running gst-launch with a v4l2src element. -- $ v4l2-ctl --list-devices $ sleep 1 $ v4l2-ctl -d 0 --set-standard ntsc sleep 1 $ v4l2-ctl -d 0 -i 2 -- This wakes the USB device up and transfers the firmware, then sets it to take video input on the s-video port. On Ubuntu, v4l2-ctl is found in the package ivtv-utils . /mallard _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Mallard you have lightened my day!
I did that and there it was the beautiful image from the tv card :D, just used -i 0 to select tv. Now another problem arises :S Doing: $ gst-launch v4l2src ! autovideosink It works perfectly! But if I want to encode it I am getting a green screen all funky :S $ gst-launch v4l2src device=/dev/video0 ! video/x-raw-yuv,fourcc=YU12,width=352,height=288 ! ffmpegcolorspace ! queue ! videoscale ! x264enc tune=zerolatency bitrate=1050 speed-preset=3 ! autovideosink It has to do with the pixel format? x264 accepts raw yuv in planar 4:2:0 correct? By doing fourcc=YU12 am I doing that? Regards! Paulo Paiva On 04/23/2011 05:42 PM, Mallard wrote: > I have a WinTV HVR950Q which works fine. The device needs a firmware > download at > initialization time; I generally do a shell script as follows before > running gst-launch > with a v4l2src element. > -- > $ v4l2-ctl --list-devices > $ sleep 1 > $ v4l2-ctl -d 0 --set-standard ntsc > sleep 1 > $ v4l2-ctl -d 0 -i 2 > -- > This wakes the USB device up and transfers the firmware, then sets it > to take video input > on the s-video port. > > On Ubuntu, v4l2-ctl is found in the package ivtv-utils . > > /mallard > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hi,
> But if I want to encode it I am getting a green screen all funky :S > $ gst-launch v4l2src device=/dev/video0 ! > video/x-raw-yuv,fourcc=YU12,width=352,height=288 ! ffmpegcolorspace ! queue > ! videoscale ! x264enc tune=zerolatency bitrate=1050 speed-preset=3 ! > autovideosink With this pipeline you are sending the encodeded stream to display which does not makes a lot of senese. So the funky screen is not surprising me :-) . What might have more sense is to multiplex the encoded stream in some container and then save it to the file or send over the network or whatever else but not sending it to the videosink. HTH, Andrey. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thanks for that Andrey!
So I tried to stream the image through rtsp-server using the line: (the rest of code is the generic gst-rtsp-server) str = g_strdup_printf ("( " "v4l2src device=/dev/video0 ! video/x-raw-yuv,width=352,height=288 ! queue ! ffmpegcolorspace !" "x264enc tune=zerolatency byte-stream=true bitrate=1050 threads=0 speed-preset=3 ! rtph264pay name=pay0 pt=96 " "alsasrc ! queue ! audioresample ! audioconvert ! faac ! rtpmp4apay name=pay1 pt=97 " ")"); Then I try to play it with mplayer rtsp://0.0.0.0:8554/play But it never starts :s mplayer keeps closing before playing the stream :S Any suggestions why is this happening? Regards! Paulo Paiva On 04/24/2011 06:39 PM, Andrey Nechypurenko wrote: > Hi, > >> But if I want to encode it I am getting a green screen all funky :S >> $ gst-launch v4l2src device=/dev/video0 ! >> video/x-raw-yuv,fourcc=YU12,width=352,height=288 ! ffmpegcolorspace ! queue >> ! videoscale ! x264enc tune=zerolatency bitrate=1050 speed-preset=3 ! >> autovideosink > With this pipeline you are sending the encodeded stream to display > which does not makes a lot of senese. So the funky screen is not > surprising me :-) . > > What might have more sense is to multiplex the encoded stream in some > container and then save it to the file or send over the network or > whatever else but not sending it to the videosink. > > HTH, > Andrey. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
> Thanks for that Andrey!
You are welcome! > Then I try to play it with mplayer rtsp://0.0.0.0:8554/play 0.0.0.0 looks strange to me. Should not it be 127.0.0.1 if you are using localhost (same computer running client and server) or other valid IP address? > Any suggestions why is this happening? It is impossible to provide any suggestions without more information about what is going wrong. You can try to increase the debug level for server and see how far does it go, i.e. if there is an attempt to open connection from the client, if yes, what request comes in, etc. Similarly, you can take a careful look at the output from mplayer. There is definitely some error messages telling you why it does not want to play video. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thanks Andrey for the quick reply!
> 0.0.0.0 looks strange to me. Should not it be 127.0.0.1 if you are > using localhost (same computer running client and server) or other > valid IP address? As for the IP 0.0.0.0 is the same as 127.0.0.1 so the problem is not there. > It is impossible to provide any suggestions without more information > about what is going wrong. You can try to increase the debug level for > server and see how far does it go, i.e. if there is an attempt to open > connection from the client, if yes, what request comes in, etc. > Similarly, you can take a careful look at the output from mplayer. > There is definitely some error messages telling you why it does not > want to play video. The output from the execution of the server with a --gst-debug=5 parameter is in annex. It is pretty extensive. After some analysis I know that the request is received and the server responds. For some reason it gets a teardown request from client, sever closes the connection and keeps going, the server does not close. (output2.log server stdio information ) $ mplayer -v rtsp://127.0.0.1:3001/fileplay, mplayer.log mplayer detects the audio and video encoding and then sends a teardown request... Any idea? Logs and source code can be found here: http://sips.inesc-id.pt/~ppaiva/logs.tar.bz2 Another thing, some time ago I asked here if there was some way of making rtsp-server use a defined port range. I made a function for that and added some code to other functions in order to make a proper work. Should that be added as a feature to gst-rtsp-streamer? If so how should I proceed ? Regards! Paulo Paiva _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
> As for the IP 0.0.0.0 is the same as 127.0.0.1 so the problem is not there.
Ok. I did not know it. > The output from the execution of the server with a --gst-debug=5 parameter > is in annex. It is pretty extensive. After some analysis I know that the > request is received and the server responds. For some reason it gets a > teardown request from client, sever closes the connection and keeps going, > the server does not close. (output2.log server stdio information ) I am afraid that the problem is beyond my ability to understand it without spending considerable amount of time on reproducing it and debugging. Sorry. The following are just my guesses which may or may not be helpful. 1. You are trying to stream video and audio. However, there is a message in mplayer log saying: "A single media stream only is supported atm." So I would suggest first to try to stream video or audio only and see if it works. 2. Maybe I am wrong here, but I think that video and audio stream should be first multiplexed in some container before being sent out to the network (for example WebM or something else suitable for streaming). However, in your server pipeline there is no multiplexer. So maybe this could be also an issue. Andrey. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hello all,
Some improvements have been made. With this command line (in the gst-server.c): str = g_strdup_printf ("( v4l2src ! video/x-raw-yuv,width=352,height=288 ! queue ! ffmpegcolorspace ! x264enc tune=zerolatency byte-stream=true bitrate=650 threads=0 speed-preset=3 ! rtph264pay name=pay0 pt=96 )"); And VLC Player got the video stream from my TV card nicely Now the problem is adding sound. Ideally it should be done by adding: ! alsasrc ! queue ! audioresample ! audioconvert ! faac ! rtpmp4apay name=pay0 pt=97 to the line above. But that doesn't work, the pipe crash :s The sound is coming from /dev/dsp2, any suggestions in how can I stream the audio with the video? Thanks all! Paulo Paiva On 04/25/2011 07:50 PM, Andrey Nechypurenko wrote: >> As for the IP 0.0.0.0 is the same as 127.0.0.1 so the problem is not there. > Ok. I did not know it. > >> The output from the execution of the server with a --gst-debug=5 parameter >> is in annex. It is pretty extensive. After some analysis I know that the >> request is received and the server responds. For some reason it gets a >> teardown request from client, sever closes the connection and keeps going, >> the server does not close. (output2.log server stdio information ) > I am afraid that the problem is beyond my ability to understand it > without spending considerable amount of time on reproducing it and > debugging. Sorry. > > The following are just my guesses which may or may not be helpful. > > 1. You are trying to stream video and audio. However, there is a > message in mplayer log saying: "A single media stream only is > supported atm." So I would suggest first to try to stream video or > audio only and see if it works. > > 2. Maybe I am wrong here, but I think that video and audio stream > should be first multiplexed in some container before being sent out to > the network (for example WebM or something else suitable for > streaming). However, in your server pipeline there is no multiplexer. > So maybe this could be also an issue. > > Andrey. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Paulo Paiva
---------- Forwarded message ---------- This is useful, but is not a general solution as the mapping of inputs to number is card/device dependent. While it is useful if you never change capture devices it doesn't really help an application that expects to use a "random" v4l2 capture device. The gst tuner interface is supposed to be the way to do it, but I'm finding it unreliable at changing the norm form the PAL default on power up to the NTSC mode I need. It seems to change the norm but the pipeline fails to start after the change. If I rerun the program it works the second time since the unsuccessful first run changed the norm. Using v4l2-ctl -s ntsc in an "onboot" cron script is a workaround. If you use PAL video shouldn't be an issue, I've yet to encounter a v4l or v4l2 device that defaults to NTSC on power up. As far as I know there is no way to select the video input or norm in a gst-launch command. v4l2-ctl -n will list the card input function and number so you can see what number is the input you want. Playing with v4l2-ctrl and the four capture devices currently active on my system I see the gst tuner interface seems to have set Video Standard = 0x0000b000 NTSC-M/M-JP/M-KR whereas v4l2-ctl -s ntsc-M sets 0x00001000. I wonder if this has anything to do with the pipeline not starting? _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |