Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is nature of time stamp for a .ts segment? #56

Open
scottveirs opened this issue Jan 21, 2023 · 1 comment
Open

What is nature of time stamp for a .ts segment? #56

scottveirs opened this issue Jan 21, 2023 · 1 comment
Assignees
Labels

Comments

@scottveirs
Copy link
Member

Is the creation time for an HLS segment shown in the S3 streaming bucket the time the object was written to S3 or is it the time the segment was initiated by ffmpeg on the node computer?

The answer would be important for anyone trying to use the lossy data for localization (which is a worse choice than the FLAC), or for an accurate assessment of audio data gaps.

@scottveirs
Copy link
Member Author

This question is answered as I investigate a related issue this morning: does the created datetime stamp of the first .ts segment on the Raspberry Pi within the Docker container match the epoch datetime stamp of the S3 object where the latest.txt file and each HLS data set is stored, or not?

Examining the livestream from Sunset Bay via my browser, that the latest.txt file contains the value 1717743618 which I can convert using https://www.epochconverter.com/ to find this equivalent:

Your time zone: Friday, 
June 7, 2024 12:00:18 AM [GMT-07:00]

Logging into the AWS console, I observe in Sunset Bay's S3 location that the current latest.txt file (at s3://streaming-orcasound-net/rpi_sunset_bay/hls/1717743618/live000.ts has this datetime information:

Last modified
June 7, 2024, 00:00:30 (UTC-07:00)

This suggest that the first .ts segment may be created by ffmpeg 12 seconds after the latest.txt file is created on the Raspberry Pi, or that the datetime stamp of the .ts segment shown in the S3 console is actually the time the file was uploaded to S3 (12 seconds could be equal to the 10 seconds taken to create the first .ts file and 2 seconds to upload it to from the /tmp directory in the Rpi's container to the S3 bucket.

Using Dataplicity to login remotely to the node, and this command to ssh into the running streaming container --

root@4860bba5bb76:~# ls -lt --full-time --time=ctime /tmp/rpi_sunset_bay/hls/1717743618/

I get this precise time stamp for a .ts segment as it is being created and before it is uploaded and then removed from the /tmp directory:

-rw-r--r-- 1 root root 0 2024-06-07 17:48:39.497196487 +0000 live3890.ts

Searching for that segment back on the S3 console, I find this:

Last modified
June 7, 2024, 10:48:51 (UTC-07:00)

Which is again about ~12 seconds after the creation So, we can conclude that the Last modified datetime stamp on the .ts segments in S3 are the time of upload to S3, NOT the time of creation on the Orcasound node.

@scottveirs scottveirs self-assigned this Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant