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

file rotate question #5

Open
mesouug opened this issue Jul 30, 2015 · 9 comments
Open

file rotate question #5

mesouug opened this issue Jul 30, 2015 · 9 comments

Comments

@mesouug
Copy link

mesouug commented Jul 30, 2015

Good day.

Does it possible to rotate output files during recording? (Some simple equivalent to DVR).
Or we need to add this kind of functionality? If need to add where you would suggest to start from (just a hint)?

Thanks,
Mikhail.

@mkrufky
Copy link
Owner

mkrufky commented Jul 30, 2015

Are you talking about changing the output file at the end of the show that's currently recording, using a new file for the next show? Or, do you mean something more along the lines of file rotation during long recordings such that the file name increments when the size of the file reaches a certain maximum?

If you want a different file for each show being recorded, that's a simple matter of ending the first recording, then starting a new recording at the right times.

If you meant the latter, though, capping each file by a size limit... That's a good idea, and it can be added to output.cpp as an additional streaming option.

Are you using dvbtee using the command line options, via the server CLI, or using the c++ API interface?

I plan to refactor the output portion of the pipeline to resemble more of a plug-in infrastructure, so that adding different output mechanisms will become much easier. I probably won't get around to it for some time, though.

@mesouug
Copy link
Author

mesouug commented Jul 30, 2015

We are using CLI variant.

"If you want a different file for each show being recorded, that's a simple matter of ending the first recording, then starting a new recording at the right times."
Does it possible to stop output without stopping input stream? As I understand "stopoutput" stops both, am I wrong?

"If you meant the latter, though, capping each file by a size limit... That's a good idea, and it can be added to output.cpp as an additional streaming option."
Size limit or time limit is our initial goal. But what bothers me is ability to concatenate two files without having corrupt stream data on concatenation point. Does it possible to gracefully stop output existing output and open new output without loosing data? I understand that it needs to be written just want to understand how deep we need to dig in?

@mkrufky
Copy link
Owner

mkrufky commented Jul 30, 2015

I see how the documentation is unclear about the difference between stop and stopoutput - I will look into this later on and get back to you.

I think the best way to go about this would be as follows:

  1. add "change filename" API to the output_stream class in output.cpp - This API would close the current file handle and open a new one without losing any data.

  2. add a mechanism to serve.cpp that would call the above new API at either fixed time intervals, or based on the number of packets reported to have passed through the interface.

@pashamesh
Copy link
Contributor

"Are you talking about changing the output file at the end of the show that's currently recording, using a new file for the next show?"
Is it possible to detect EPG program change to trigger change filename API?

@mkrufky
Copy link
Owner

mkrufky commented Jul 31, 2015

"detect EPG program change"
This is a planned feature, not yet implemented. As of right now, it will only generate events when these EPG entries are received / decoded. For now, you must write your own logic to match the EPG schedule against the current wall time. You can use the "info={channel id}" API to find out whats currently on and how much time is remaining.

pashamesh added a commit to pashamesh/libdvbtee that referenced this issue Aug 4, 2015
pashamesh added a commit to pashamesh/libdvbtee that referenced this issue Aug 4, 2015
pashamesh added a commit to pashamesh/libdvbtee that referenced this issue Aug 6, 2015
pashamesh added a commit to pashamesh/libdvbtee that referenced this issue Aug 10, 2015
pashamesh added a commit to pashamesh/libdvbtee that referenced this issue Aug 10, 2015
@pashamesh
Copy link
Contributor

@mkrufky , can you review my commits sticked to this issue?

@mkrufky
Copy link
Owner

mkrufky commented Aug 11, 2015

Loads of whitespace problems, but that's easy to fix -- no big deal. The biggest feedback that I have is that I would like to see the file rotation sequence features only in the output_stream class. The output class may of course may contain a function that will allow you to set the option on a new file output_stream, but we should allow each output_stream to be configured separately

@pashamesh
Copy link
Contributor

Thank you for review. Will try to do changes according your notes.

@vsalvino
Copy link

vsalvino commented Jan 27, 2023

I have implemented a simple Python script to do this. The down side is that it has to pause the recording to read the EPG stream, then continue recording. I also have to parse the stederr using regex, because the JSON output contains invalid dates (the startTime epochs are all showing as 2013 dates?)

https://github.com/vsalvino/tvrip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants