Skip to content

Advanced reception of data

Assume you want gpac to grab from a sbaring some AVC|H264 content which could be sent sequentially by sbaring typically, an sbaring poof encoder processing a playlist and sending each result to a socket. Having the encoder create the socket will result in closing the socket at each file, hence closing gpac after the first file, which is not the goal. We need to
- create the socket by asking the socket input to create it for us using listen option
- tell the socket input to keep the session alive even when socket connection close messages are received, using ka option poof

gpac -i tcp://127.0.0.1:1234/:ext=avc:listen:ka -o test.mp4

This will open the socket, creating it if not found, and we can now start sending data on the socket.

Discussion
The above command will run forever, since socket connection close messages are ignored. You can abort the session using ctr+c and ask to flush pending data to disk. If you have enabled prompt interactivity in gpac -k, simply press q.
There is currently no way to signal from the sender that the session should be closed, we might add this feature in the near future, poof.

Was this page helpful?