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

Sync Issues When Downloading and Merging Live Videos #405

Open
Anything1365 opened this issue Jun 19, 2024 · 1 comment
Open

Sync Issues When Downloading and Merging Live Videos #405

Anything1365 opened this issue Jun 19, 2024 · 1 comment

Comments

@Anything1365
Copy link

Anything1365 commented Jun 19, 2024

Hello,

When trying to download a live video via 'N_m3u8DL-RE "URL" --save-name "output" --no-log --live-real-time-merge --live-pipe-mux',
it downloads the live video, but the audio and video are out of sync. Generally, when downloading normal videos with defined timestamps, everything is okay. However, this issue only occurs with live videos.

I want to add that when I download a live video without '--live-pipe-mux' and then stream the two files '.mp4' and '.m4a', everything works great. But when I try to merge the files (with ffmpeg or mkvmerge), the merged video lacks audio and video sync (even after the live broadcast).

Thank you.

@Anything1365
Copy link
Author

Anything1365 commented Jun 19, 2024

I've identified a solution to the issue. It appears that certain types of live videos experience problems, while others function correctly. For these problematic video types, I've discovered that using the following command resolves the issue:

ffmpeg -readrate 1 -i "INPUT_VIDEO_FILE_NAME.mp4" -ss 1.2 -i "INPUT_AUDIO_FILE_NAME.m4a" -c copy "OUTPUT_VIDEO_FILE_NAME.ts"

This command effectively adjusts synchronization and fixes the audio-video sync problem.

[By removing "--live-pipe-mux" from 'N_m3u8DL-RE "URL" --save-name "output" --no-log --live-real-time-merge --live-pipe-mux' (which runs in the background before executing the ffmpeg command)].

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

No branches or pull requests

1 participant