Jump to content
  • 1

Stream Folder or Segment Naming Convention


Karel
 Share

Question

Challenge: I need to find the stream name from the segment URL.


Is it somehow possible to change the segment folder or naming convention? The current segment names are like `{stream}000000000.ts` and that makes it complicated to extract the stream name from the segment URL `https://{server}:5080/LiveApp/streams/{stream}000000000.ts`. I would prefer to have each stream in a separate folder under /streams/ or have a naming convention that makes it possible to split, even thought that would still be error-prone.

Ideal

https://{server}:5080/LiveApp/streams/{stream}/000000000.ts

Alternative

https://{server}:5080/LiveApp/streams/{stream}-000000000.ts

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Hi @Karel
I hope you are doing well.

When creating a stream via REST method, a custom subfolder can be specified for each stream id. Here is a curl sample:

curl --location --request POST 'https://domain:5443/LiveApp/rest/v2/broadcasts/create' \
--header 'Content-Type: application/json' \
--data-raw '{ 
    "streamId":"stream1",
    "subFolder": "stream1"
}'

When mp4 and HLS files begin to upload, a subfolder will be created inside the streams directory in the s3 bucket.

Similarly, you can create a stream using the current date stamp subfolder, but you must delete the existing stream before creating a new one if you want to create the same stream for a different date.

curl --location --request POST 'https://domain:5443/LiveApp/rest/v2/broadcasts/create' \
--header 'Content-Type: application/json' \
--data-raw '{ 
    "streamId":"stream1",
    "subFolder": "stream1/14-10-2022"
}'

I hope this solution helps you.

Link to comment
Share on other sites

  • 0

Thanks @Yash, I'll see if I can fit that into my workflow. There's no solution that works without calling this REST method first? In this case, publishers may start sending a stream over RTMP at any time ...

Link to comment
Share on other sites

 Share

×
×
  • Create New...