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

Video/Audio syncing issue #66

Open takimakura opened 1 year ago

takimakura commented 1 year ago

I am using the latest version 3.9 and it seems like there are audio/video syncing issue whenever the streamer does have collaborations with other live streamers.

I think it is issue related to the ffmpeg conversion

CyberbobGR commented 1 year ago

I have the exact same problem, video is fine until another person connects to live, then the audio continues in sync, but the video is in slow motion...

RealityQuizzicality commented 1 year ago

Try another app? I had the same problem using iterm, I changed back to mac's terminal and it’s fine now.

takimakura commented 1 year ago

I am having that issue running with Terminal

RealityQuizzicality commented 1 year ago

Until someone who knows about this can help you, Try using https://github.com/thefirstone265/tiktok-live-recorder.git

roju commented 1 year ago

You could try my fork: https://github.com/roju/tiktok-live-recorder I tested this and didn't notice any syncing issues with ffmpeg when other users joined.

Michele0303 commented 1 year ago

You could try my fork: https://github.com/roju/tiktok-live-recorder I tested this and didn't notice any syncing issues with ffmpeg when other users joined.

Thank you very much for your valuable solutions. I would appreciate it if you would make a pull request to the project

roju commented 1 year ago

@Michele0303 Which features would you like a PR for? My fork has some major refactoring and other changes so certain features may require some extra effort to rewrite as a PR. Feel free to use any of the code in your project.

Michele0303 commented 1 year ago

It would be helpful to solve the problem of lagging

wahyutamvan commented 1 year ago

You could try my fork: https://github.com/roju/tiktok-live-recorder I tested this and didn't notice any syncing issues with ffmpeg when other users joined.

@roju Forgive this question, can you provide an example of a command to execute recording tiktok live broadcasts? I am confused because after trying various commands I only get a command not found response such as for example main.py: command not found thank you for your time.

RealityQuizzicality commented 1 year ago

You could try my fork: https://github.com/roju/tiktok-live-recorder I tested this and didn't notice any syncing issues with ffmpeg when other users joined.

@roju Forgive this question, can you provide an example of a command to execute recording tiktok live broadcasts? I am confused because after trying various commands I only get a command not found response such as for example main.py: command not found thank you for your time.

python3 ttlr.py -user usernamehere -mode auto -ffmpeg -combine

takimakura commented 1 year ago

You could try my fork: https://github.com/roju/tiktok-live-recorder I tested this and didn't notice any syncing issues with ffmpeg when other users joined.

I am still getting the same out of sync issue with your fork it seems. Later half of the video, there is no sound while the video is playing.

takimakura commented 1 year ago

You could try my fork: https://github.com/roju/tiktok-live-recorder I tested this and didn't notice any syncing issues with ffmpeg when other users joined.

@roju Forgive this question, can you provide an example of a command to execute recording tiktok live broadcasts? I am confused because after trying various commands I only get a command not found response such as for example main.py: command not found thank you for your time.

python3 ttlr.py -user usernamehere -mode auto -ffmpeg -combine

Could you tell me more about the -combine option? I haven't included that while using in the past wondering if adding the option would help with the out of sync issue.

RealityQuizzicality commented 1 year ago

You could try my fork: https://github.com/roju/tiktok-live-recorder I tested this and didn't notice any syncing issues with ffmpeg when other users joined.

@roju Forgive this question, can you provide an example of a command to execute recording tiktok live broadcasts? I am confused because after trying various commands I only get a command not found response such as for example main.py: command not found thank you for your time.

python3 ttlr.py -user usernamehere -mode auto -ffmpeg -combine

Could you tell me more about the -combine option? I haven't included that while using in the past wondering if adding the option would help with the out of sync issue.

-combine When recording ends, concatenate all video files into a single file.

takimakura commented 1 year ago

@roju @Michele0303 I tested both versions of 4.0 again and can confirm that video and audio becomes out of sync after another live streamer joins/leaves Seems like the old v2.8 still work better even though it will cut off and start a new file every time a live streamer join/leaves Is that not reproducible on your side?

RealityQuizzicality commented 1 year ago

I am using the latest version 3.9 and it seems like there are audio/video syncing issue whenever the streamer does have collaborations with other live streamers.

I think it is issue related to the ffmpeg conversion

its been a while since i had this issue and im not sure this will help, but i assume you've tried updating ffmpeg, git, pip and python? or even rerunning pip install -r requirements.txt i used homebrew to install, update when possible.

takimakura commented 1 year ago

@RealityQuizzicality Yeah, I am pretty sure the packages are up to date. This problem has been persisting every since -ffmpeg option is required for auto recording.

takimakura commented 1 year ago

@RealityQuizzicality I tried https://github.com/thefirstone265/tiktok-live-recorder.git suggested above as well. It records in flv and does not seem to end properly so produces a file that is not indexed. I also find that once another streamer joins/leaves then the video stops updating

Michele0303 commented 1 year ago

My guess, is that when a new user joins the live stream, the stream link is changed. I need to investigate to confirm. @roju

roberto-sartori-gl commented 1 year ago

@Michele0303 I think it actually depends from - parameters that I don't know.

I observed the lag when a new user joins only with certain users - it is not always present.

With other users, it appears indeed that when a new user joins, the stream link changes - I see the live-recorder tool exiting, and I have to start a new recording to continue recording. Note that in this case I do not observe the lag though.

This is not the case with all users, I have live lasting like 2 hours with multiple users entering and exiting.

I can probably find some examples, but I would just search in the tiktok lives so let me know if you need some links anyway.