Reading from named pipe continuously
vinayraj
vinayrajalur at gmail.com
Tue May 29 21:58:00 UTC 2018
Hi All,
I want to stream rtp in pcap file to udpsink continuously. so i am trying
the following approach.
I am trying to read from namedpipe using gst-launch and there is another
script which is writing to namedpipe by reading binary file and writing it
in to pipe. The file i am reading is pcap, once read completes i seek back
to 0 and read from the beginning. Following is the example python script
writing to namedpipe in loop for 10 times
import os, sys
# Path to be created
path = "videopipe"
try:
os.mkfifo(path)
print("Path is created")
except OSError as e:
print("Failed to create FIFO: %s" % e)
rf = open('video.pcap', 'rb', 0)
wf = open(path, 'wb', 0)
for i in range(10):
for data in iter(lambda: rf.read(4096),b""):
wf.write(data)
print("Read complete")
rf.seek(0)
following is the gstreamer command:
gst-launch-1.0 filesrc location=videopipe ! pcapparse ! application/x-rtp !
rtph264depay ! rtph264pay pt=96 ssrc=3940036475 seqnum-offset=0
timestamp-offset=0 ! srtpenc
key=137c17f42f48ae171cb21d31f6366b7cad00efb2f96e4aab0b543426f559 ! queue !
udpsink host=localhost port=60000
The first iteration works fine, gstreamer reads from namedpiped and sends it
to udpsink and client is able to decode the video, the issue am facing is
that after first iteration gstreamer stops reading from the pipe.
Can anyone help me how to resolve this?
Thanks in advance,
Vinayraj
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list