Michele0303 / tiktok-live-recorder

🎥✨ A TikTok live streaming recorder tool written in Python. Capture and relive your favorite TikTok moments effortlessly. 🎥✨
MIT License
370 stars 102 forks source link

Automatic stop recording #45

Closed aCS6 closed 1 year ago

aCS6 commented 1 year ago

It would be helpful if users could specify the duration of the recording when starting the program. For example, if a live stream is scheduled to be 1 hour long but the user only wants to record 10 minutes of it, they should be able to input this duration. Once the recording reaches the specified duration (10 minutes in this case), the program should automatically stop.

I am currently conducting research and development to address this requirement. If anyone has any suggestions or opinions regarding this functionality or knows of any existing solutions, please feel free to comment. I am open to exploring different approaches and would appreciate any input or guidance on this matter.

Michele0303 commented 1 year ago

I found this:

https://askubuntu.com/questions/947553/scheduled-recording-ffmpeg-14-04-with-timer

aCS6 commented 1 year ago

@Michele0303 , I sincerely appreciate your insights and the solutions you provided. However, I would like to clarify my requirements as they differ slightly from the suggestions you made. I do not intend to schedule the recording; instead, I am seeking a way to stop the recording based on user input provided through a command-line argument, if available. I value your understanding and assistance in addressing this specific need.

Michele0303 commented 1 year ago

Sorry I wasn't specific enough. I wanted to show you the -t flag

image

So as for ffmpeg, it would be enough to change it to: ffmpeg.output(stream, output, t=max_duration)

aCS6 commented 1 year ago

oh. thanks. I lot of code is going to be reduced. @Michele0303 would you make the change? or I should give the PR, after the necessary changes ? thanks, anyway

Michele0303 commented 1 year ago

You make the changes and then send the PR. Thanks