Captured Audio Stream and Video Streams from YouTube Live are out of Sync

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Captured Audio Stream and Video Streams from YouTube Live are out of Sync

Jim Ruxton
I am trying to retrieve a YoutubeLive stream and send the video stream
to a video loopback device and the audio to my souncard. This works
however it appears that the audio is delayed by a second or so. Is there
a better way to do this so they aren't out of sync or failing that is
there a way to set a delay on the video stream to compensate? Below is
my command. I am using the Sky News You Tube Live as a test signal. I am
on Ubuntu 19.10 .

ffmpeg -re -i $(youtube-dl -g -f 96
https://www.youtube.com/watch?v=9Auq9mYxFEE)  -f v4l2 /dev/video2 -f
alsa default

Thanks,

Jim


_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Captured Audio Stream and Video Streams from YouTube Live are out of Sync

Stephan Monecke
Have a look at the "-itsoffset" parameter for constant delays.
Also you might want to drop the "-re" [1].

[1] https://trac.ffmpeg.org/wiki/StreamingGuide#The-reflag
Best regards,
Stephan Monecke
--
Sent from my mobile device. Please excuse my brevity.

Am 9. Mai 2020 09:14:23 MESZ schrieb Jim Ruxton <[hidden email]>:

>I am trying to retrieve a YoutubeLive stream and send the video stream
>to a video loopback device and the audio to my souncard. This works
>however it appears that the audio is delayed by a second or so. Is
>there
>a better way to do this so they aren't out of sync or failing that is
>there a way to set a delay on the video stream to compensate? Below is
>my command. I am using the Sky News You Tube Live as a test signal. I
>am
>on Ubuntu 19.10 .
>
>ffmpeg -re -i $(youtube-dl -g -f 96
>https://www.youtube.com/watch?v=9Auq9mYxFEE)  -f v4l2 /dev/video2 -f
>alsa default
>
>Thanks,
>
>Jim
>
>
>_______________________________________________
>ffmpeg-user mailing list
>[hidden email]
>https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
>To unsubscribe, visit link above, or email
>[hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Captured Audio Stream and Video Streams from YouTube Live are out of Sync

Carl Eugen Hoyos-2
In reply to this post by Jim Ruxton


> Am 09.05.2020 um 09:14 schrieb Jim Ruxton <[hidden email]>:
>
> I am trying to retrieve a YoutubeLive stream and send the video stream to a video loopback device and the audio to my souncard. This works however it appears that the audio is delayed by a second or so. Is there a better way to do this so they aren't out of sync or failing that is there a way to set a delay on the video stream to compensate? Below is my command. I am using the Sky News You Tube Live as a test signal. I am on Ubuntu 19.10 .
>
> ffmpeg -re -i $(youtube-dl -g -f 96 https://www.youtube.com/watch?v=9Auq9mYxFEE)  -f v4l2 /dev/video2 -f alsa default

There is no synchronisation taking place between two outputs, if the delay is really constant between runs (I am not convinced it is), you can try the delay filters.

ffmpeg does not completely support your use case, it should work with ffplay.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Captured Audio Stream and Video Streams from YouTube Live are out of Sync

Jim Ruxton
Thanks Carl,
>
>> Am 09.05.2020 um 09:14 schrieb Jim Ruxton <[hidden email]>:
>>
>> I am trying to retrieve a YoutubeLive stream and send the video stream to a video loopback device and the audio to my souncard. This works however it appears that the audio is delayed by a second or so. Is there a better way to do this so they aren't out of sync or failing that is there a way to set a delay on the video stream to compensate? Below is my command. I am using the Sky News You Tube Live as a test signal. I am on Ubuntu 19.10 .
>>
>> ffmpeg -re -i $(youtube-dl -g -f 96 https://www.youtube.com/watch?v=9Auq9mYxFEE)  -f v4l2 /dev/video2 -f alsa default
> There is no synchronisation taking place between two outputs, if the delay is really constant between runs (I am not convinced it is), you can try the delay filters.
You are correct I now see that the delay is not consistent.
>
> ffmpeg does not completely support your use case, it should work with ffplay.

Are you saying I could use ffplay in a similar way to split the audio
and video from the stream but keep them in sync?


Jim

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Captured Audio Stream and Video Streams from YouTube Live are out of Sync

Carl Eugen Hoyos-2
Am Sa., 9. Mai 2020 um 18:48 Uhr schrieb Jim Ruxton <[hidden email]>:

> > ffmpeg does not completely support your use case, it should work with ffplay.
>
> Are you saying I could use ffplay in a similar way to split the audio
> and video from the stream but keep them in sync?

No I just wanted to highlight that ffmpeg -i input -f alsa default -f
v4l2... does no
A/V sync while ffplay input does.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Captured Audio Stream and Video Streams from YouTube Live are out of Sync

Jim Ruxton
Thanks Carl,

It sounds like I will need to find another way other than ffmpeg for
this use case then? Does anyone have any suggestions. I have tried
gstreamer but so far haven't had any luck there either.

Jim

On 2020-05-11 5:32 p.m., Carl Eugen Hoyos wrote:

> Am Sa., 9. Mai 2020 um 18:48 Uhr schrieb Jim Ruxton <[hidden email]>:
>
>>> ffmpeg does not completely support your use case, it should work with ffplay.
>> Are you saying I could use ffplay in a similar way to split the audio
>> and video from the stream but keep them in sync?
> No I just wanted to highlight that ffmpeg -i input -f alsa default -f
> v4l2... does no
> A/V sync while ffplay input does.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".