How to include metadata/tags in gstreamer's RTSP streaming - metadata

I want to insert metadata in RTSP streaming specifically in RTSP server. How exactly I can do that? My gstreamer pipeline is
"v4l2src device=/dev/video3 ! videoconvert ! v4l2h264enc ! rtph264pay name=pay0"
I want to insert a string of user defined data in RTSP stream. I tried an element called taginject but its of no use.
I tried passing this pipeline to gst_bin_iterate_all_by_interface() API which returns those elements which support GstTagSetter interface. But none of the elements in my pipeline support GstTagSetter interface. I tried using mux elements but those mux can not be linked to rtph264pay. I can't use any other encoding other than H.264.
Please suggest any other methods to insert metadata.
Thanks

Related

Is there a module replace with winpcap and scapy in Windows? or binding network-interface directly like using SO_BINDTODEVICE in linux

I'm looking for new solution to play h.264 steaming video ,which is based on 1722 protocol and entered in Ethernet from other device, in Windows 7 or 10 by using socket similarly with the way from linux environment.
I can bind network-interface directly using option of SO_BINDTODEVICE in linux and if I use that, video streaming is so smooth in vlc player and vlc statistics show bitrate is over 20,000 kb/s
so I tried two manners in Windows like below:
using scapy module in python
sniffing all raw packet Ethernet
attach data on payload and send packet to vlc player
result is poor, because the bitrate in vlc statistics is almost under 1500kb/s
using winpcap lib in C(VS)
sniffing all raw packet through pcap_next_ex or pcap_loop
attach data on payload and send packet to vlc player
result is bad, the bitrate in vlc statistics is 3000kb/s
1.
global dgramSock
dgramSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def prn(pkt):
global dgramSock
...
#filter to pick specific packet
...
#attach data on payload and naming myPacket
...
send_len = dgramSock.sendto(myPacket, ('127.0.0.1', 44514))
sniff(prn = prn, filter='ether)
2.
sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
addr.sin_port = htons(44514);
...
while( (pcap_next_ex(_handle, &header, &pkt_data)) >=0){
...
#filter to pick specific packet
...
#attach data on payload and naming myPacket
...
sendto(sock, (char *)myPacket, myPacketSize, 0, (struct sockaddr *)&(addr), sizeof(addr));
}
I think that two manner what I tried looks not essential way.
In Windows, what is the best solution to send raw packet to other program fastly without loss?
I don't know exactly my solution is correct approach or not but I left my solution for one who seek some solution same problem like me
My wrong approach what I have been was using VLC in Windows.
I guess VLC listener buffer seem to small not enough to get all streaming data from socket, so streaming data looks corrupted or broken, even though little part of top in video played normal streaming.
So I tried new player, FFmpeg. FFmpeg provide ffplay.exe. It seems to decoder same with VLC.
I just send streaming data through UDP stack and valid port from Visual studio or Python. There is no issue using UDP socket, but you need to check listener buffer is enough to get all packets coming via network card.(like API: pcap_set_buffer_size)
If you can success to send your streaming data toward specific port what you want to send, next step is run ffplay with some command.
simple example command to run ffplay
ffplay.exe -codec:v h264 -i udp://127.0.0.1:44514 -framerate 30
Tip) For beginner in ffmpeg like me, you should keep order of command, ffplay and ffmpeg have strong rule of arguments, but simple rule is explained as input and output rule. You have to give input option first and output option come behind -i(input) option
There is many branch to using ffplay or to your environment so my explanation would not match correctly in many situations.
If I can answer your question, I will keep track on that.
Thank you

How to enter an option during voice calls using at commands

I've been using a sim900 module to replicate many of the functions found in a basic cellphones for an embedded project. I've been successful with most functions with the exception of entering options during a voice call. I am actually looking for a generic solution (e.g. GSM 07.07 etc.) although the GSM/GPRS Module I'm using is the sim900.
Scenario: I initiate a call using ATD<number>; ,then automated voice asks me to dial "1" for an option. How do I send the "1"?
I've search high and low for an answer. I've been through the AT command manual over and over again. Please help.
Very good start in using the official GSM specification, although I want to note that 07.07 has been superseded by 27.007 a very long time ago, and you should use that document (or 27.005 if relevant).
I initially expected there to be two ways of achieving this, dial string modifiers or DTMF command, but I looking up the dial string in the 27.007 specification I do not find the p (pause) modifier1 I was expecting, and nearest thing, the W (wait) modifier is ignored and only included for compatibility.
Sending 0 through 9, A through D, * and # during a call is done using DTMF, although in a GSM network this is signalled separately out of band rather than sending in-band analogue tones. There is a specific command for sending DTMF tones called AT+VTS (with a horrible syntax). So that command is the answer to you question. Invoke it either from online command mode or from another serial connection.
1 The reason I was expecting a p modifier to exist is that I am able to enter one in phone book entries, e.g. `"12345678p123" which will dial 12345678, wait for the connection to be established and then send 123 as DTMF tones. But this is then obviously something (only) the user interface voice call handler manages and not the AT command handler.

Dont receive results other than those from first audio chunk

I want some level of real-time speech to text conversion. I am using the web-sockets interface with interim_results=true. However, I am receiving results for the first audio chunk only. The second,third... audio chunks that I am sending are not getting transcribed. I do know that my receiver is not blocked since I do receive the inactivity message.
json {"error": "Session timed out due to inactivity after 30 seconds."}
Please let me know if I am missing something if I need to provide more contextual information.
Just for reference this is my init json.
{
"action": "start",
"content-type":"audio/wav",
"interim_results": true,
"continuous": true,
"inactivity_timeout": 10
}
In the result that I get for the first audio chunk, the final json field is always received as false.
Also, I am using golang but that should not really matter.
EDIT:
Consider the following pseudo log
localhost-server receives first 4 seconds of binary data #lets say Binary 1
Binary 1 is sent to Watson
{interim_result_1 for first chunk}
{interim_result_2 for first chunk}
localhost-server receives last 4 seconds of binary data #lets say Binary 2
Binary 2 is sent to Watson
Send {"action": "stop"} to Watson
{interim_result_3 for first chunk}
final result for the first chunk
I am not receiving any transcription for the second chunk
Link to code
You are getting the time-out message because the service waits for you to either send more audio or send a message signalling the end of an audio submission. Are you sending that message? It's very easy:
By sending a JSON text message with the action key set to the value stop: {"action": "stop"}
By sending an empty binary message
https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/speech-to-text/websockets.shtml
Please let me know if this does not resolve your problem
This is a bit late, but I've open-sourced a Go SDK for Watson services here:
https://github.com/liviosoares/go-watson-sdk
There is some documentation about speech-to-text binding here:
https://godoc.org/github.com/liviosoares/go-watson-sdk/watson/speech_to_text
There is also an example of streaming data to the API in the _test.go file:
https://github.com/liviosoares/go-watson-sdk/blob/master/watson/speech_to_text/speech_to_text_test.go
Perhaps this can help you.
The solution to this question was to set the size header of the wav file to 0.

validate MPD file - using MPEG-DASH

I have just started using MPEG-DASH (from the client side), following the c057623_ISO_IEC_23009-1_2012 spec.
Does anyone know if there is a public lib or open source to validate MPD file I receive?
I have no problem in processing the xml.
Any help will be appreciated.
You may want to check this MPEG-DASH MPD Validator
The DASH Industry Forum provides great software resources for all things MPEG DASH.
Here another MPD Validator from dashif: DASHIF Validator.
In respect to the error "Cannot find the declaration of element ‘MPD'" provided by the mentioned MPEG-DASH MPD Validator, I observed it may happen even when the MPD tag is present, but it encounters some differences to the expected text, such as:
<MPD xmlns="urn:mpeg:DASH:schema:MPD:2011" ...>
instead of
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" ...>

NSURLRequest with HTTPBody input stream: Stream sends event before being opened

I want to send a large amount of data to a server using NSURLConnection (and NSURLRequest). For this I create a bound pair of NSStreams (using CFStreamCreateBoundPair(...)). Then I pass the input stream to the NSURLRequest (-setHTTPBodyStream:) and schedule the output stream on the current run loop. When the run loop continues, I get the events to send data and the input stream sends this data to the server.
My problem is, that this only works when the data fits into the buffer between the paired streams. If the data is bigger, then somehow the input stream gets an event (I assume "bytes available") but the NSURLConnection has not yet opened the input stream. This results in an error message printed and the data is not being sent.
I tried to catch this in my -stream:handleEvent: method by simply returning if the input stream is not yet opened, but then my output stream gets a stream closed event (probably because I never sent data when I could).
So my question is: How to use a bound pair of streams with NSURLConnection correctly?
(If this matters: I'm developing on the iOS platform)
Any help is appreciated!
Cheers, Markus
Ok, I kind of fixed this by starting the upload delayed, so that it starts after the NSURLConnection had time to setup its input stream.
It's not what I call a clean solution though, since relying on -performSelector:withObject:afterDelay: seems a bit hacky.
So if anyone else has a solution to this, I'm still open for any suggestions.