I am trying send h264 video in UDP packeted using gstreamer.
Like,
gstreamer v4l2src ! video/x-raw-rgb, widht=320, height=240 ! ffmpegcolorspace ! x264enc ! rtph264pay ! udpsink host=192.168.0.1 port=12345
Can someone tell me how to receive video on receiver side display on web browser..?
Thanks in advance..
Pra-win
Related
I'm working with the Pepper robot from SoftBank Robotics and GStreamer for RTP stream. I need to record the audio from the robot. I use gstreamer1.0 on my computer and gstreamer0.10 is installed on the robot.
Here are the command lines I use :
Pepper:
gst-launch-0.10 alsasrc name=mic provide-clock=true do-timestamp=true buffer-time=200000 mic. ! 'audio/x-raw-int, format=S16LE; channels=1, width=16, depth=16, rate=16000' ! udpsink host="computer_adress" port="speaker_port" sync=false
Computer:
gst-launch-1.0 -e udpsrc port="speaker_port" ! audio/x-raw, width=16, depth=16, rate=16000, channels=1 format=S16LE ! audioconvert ! filesink location=audio_file_name.mp3 sync=false
With these commands I only can get a mp3 file but with no sound in it.
I'm aware that some things are not correct but I don't know what. I'm a beginner with Gstreamer and RTP protocol. Could someone help me with that ? And maybe explain me how to stream audio with RTP from the robot.
Sorry if I made any English writing mistakes.
Thanks for your help.
I have streamed video via vlc player over rtsp and then I have displayed this video via gstreamer-0.10. However, While vlc was streaming video over rtsp, I suddenly lost stream in the first minute of stream before end of stream.
I have used following pipeline:
GST_DEBUG=2 gst-launch-0.10 rtspsrc location=rtsp://127.0.0.1:8554/test !
gstrtpjitterbuffer ! rtph264depay ! ffdec_h264 ! videorate ! xvimagesink
sync=false
I have got following output:
rtpjitterbuffer.c:428:calculate_skew: delta - skew: 0:00:01.103711536 too big, reset skew
rtpjitterbuffer.c:387:calculate_skew: backward timestamps at server, taking new base time
Got EOS from element "pipeline0".
Execution ended after 59982680309 ns.
Setting pipeline to PAUSED ...
gst_rtspsrc_send: got NOT IMPLEMENTED, disable method PAUSE
How to fix this problem ?
I have found solution. I have used rtspt://... instead of rtsp://... to enforce TCP instead of UDP.
gst-launch-0.10 rtspsrc location= rtspt://127.0.0.1:8554/test ! gstrtpjitterbuffer ! rtph264depay ! ffdec_h264 ! xvimagesink sync=false
I am developing an IP Streaming based media player. I am using the following pipelines:
Src:
gst-launch-1.0 -vvv udpsrc port=5004 ! application/x-rtp, payload=96 ! rtph2 64depay ! h264parse ! imxvpudec ! imxipuvideosink sync=false
Sink:
C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -v filesrc location=C:\\gstreamer\\1.0\\x86_64\\bin\\hash.h264 ! h264parse ! rtph264pay ! udpsink host=153.77.205.139 port=5004 sync=true
This was the proof of concept. Now, We wanted to have an application which can perform the same operation but with a little tweak when there is no streaming or when no data from the sink, we need to switch to offline base media player, means play a set of videos offline and when there is data on udp port, switch to streaming.
Following are my queries:
Is there any way to find out streaming has been completed after video play over IP
Is there any way to find out there is no streaming happening.
Please help. I am ready to help you if you need more details
For udpsrc there is timeout property, which sends a message on bus if there is no data available (you can try setting it to 1 second), for streaming is complted you should get EOS on the bus again. (try this pipeline gst-launch-1.0 -vvvm udpsrc port=5004 timeout=100000000 ! application/x-rtp, payload=96 ! rtph2 64depay ! h264parse ! imxvpudec ! imxipuvideosink sync=false)
I am trying to stream audio and video via Gstreamer via UDP but playback on VLC only returns video without audio. Currently I am using a sample of Big Buck Bunny and have confirmed that it does have audio. I am planning to use Snowmix to feed media to Gstreamer output in the future.
Streaming from file source via UDP to playback on VLC I currently perform by:
gst-launch-1.0 -v uridecodebin uri=file:///home/me/files/Snowmix-0.5.1/test/big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 ! queue ! videoconvert ! x264enc ! mpegtsmux ! queue ! udpsink host=230.0.0.1 port=4012 sync=true
which allows me to open a network stream in VLC on my Windows machine to receive packets and only plays video.
What am I missing from my command?
As RSATom stated previously, the audio is missing from the pipeline.
The correct pipeline for video and audio is the next (tested with the same input file):
gst-launch-1.0 -v uridecodebin name=uridec uri=file:///home/usuario/Desktop/map/big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 ! queue ! videoconvert ! x264enc ! video/x-h264 ! mpegtsmux name=mux ! queue ! udpsink host=127.0.0.1 port=5014 sync=true uridec. ! audioconvert ! voaacenc ! audio/mpeg ! queue ! mux.
Remember that in this case you're re-encoding all the content from the source video file, which means high CPU consumption. Other option would be to demux the content from the input file and mux again without encoding (using h264parse and aacparse).
How to record Audio using Microphone in AAC codec format in mp4 file using gstreamer ?
Please reply with pipeline info.
Thanks in advance.
If your default audio source is Microphone, then you can try
gst-launch autoaudiosrc ! audioconvert ! faac ! mp4mux ! filesink location=aac_audio.mp4
However if you have multiple audio sources and mic is not default audio source, then you have to specify device identifier of the mic input. Plus you need to know whether you have ALSA or OSS driver.
My suggestion would be to try
gst-launch alsa-src device=<device identifier for mic input> ! audioconvert ! faac ! mp4mux ! filesink location=aac_audio.mp4
or
gst-launch oss-src device=<device identifier for mic input> ! audioconvert ! faac ! mp4mux ! filesink location=aac_audio.mp4
depending on which driver you have.