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

Propper method to stop recording of finished live stream from youtube #21085

Closed
kristofejro opened this issue May 13, 2019 · 1 comment
Closed

Propper method to stop recording of finished live stream from youtube #21085

kristofejro opened this issue May 13, 2019 · 1 comment
Labels

Comments

@kristofejro
Copy link

@kristofejro kristofejro commented May 13, 2019

I would like to ask you about the propper method to stop recording of live stream from youtube.
I am downloading live stream from youtube with simple command:

youtube-dl.exe -o "D:\stream.mp4" "https://www.youtube.com/watch?v=sVMRgZQfsSM"

When the stream is finished (stream is no more available on youtube) in console I have something like this:

[https @ 0000000003c5b000] Opening 'https://r5---sn-f5f7lne6.googlevideo.com/videoplayback/id/5K1nBNWVa-M.1/itag/301/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D299/hls_chunk_host/r5---sn-f5f7lne6.googlevideo.com/playlist_type/DVR/ei/NAHXXOiKGJCfgAPNpLGwDg/gcr/pl/initcwndbps/16090/mm/32/mn/sn-f5f7lne6/ms/lv/mv/m/pl/17/keepalive/yes/mt/1557594323/disable_polymer/true/ip/88.88.88.88/ipbits/0/expire/1557616020/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,ei,gcr,initcwndbps,mm,mn,ms,mv,pl/signature/6B037A67434BF766F9BF9786AC0E856797E7BC99.730FDEAA1CE8734AEE02FDBACD8AC0AEEC238062/key/dg_yt0/playlist/index.m3u8/sq/7176/goap/clen%3D81066%3Blmt%3D1557596927968434/govp/clen%3D27169%3Blmt%3D1557596927968434/dur/5.000/file/seg.ts' for reading
[https @ 000000000463bcc0] Opening 'https://r5---sn-f5f7lne6.googlevideo.com/videoplayback/id/5K1nBNWVa-M.1/itag/301/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D299/hls_chunk_host/r5---sn-f5f7lne6.googlevideo.com/playlist_type/DVR/ei/NAHXXOiKGJCfgAPNpLGwDg/gcr/pl/initcwndbps/16090/mm/32/mn/sn-f5f7lne6/ms/lv/mv/m/pl/17/keepalive/yes/mt/1557594323/disable_polymer/true/ip/88.88.88.88/ipbits/0/expire/1557616020/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,ei,gcr,initcwndbps,mm,mn,ms,mv,pl/signature/6B037A67434BF766F9BF9786AC0E856797E7BC99.730FDEAA1CE8734AEE02FDBACD8AC0AEEC238062/key/dg_yt0/playlist/index.m3u8/sq/7177/goap/clen%3D81066%3Blmt%3D1557596932881505/govp/clen%3D27169%3Blmt%3D1557596932881505/dur/5.000/file/seg.ts' for reading
[https @ 0000000003c5b000] Opening 'https://r5---sn-f5f7lne6.googlevideo.com/videoplayback/id/5K1nBNWVa-M.1/itag/301/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D299/hls_chunk_host/r5---sn-f5f7lne6.googlevideo.com/playlist_type/DVR/ei/NAHXXOiKGJCfgAPNpLGwDg/gcr/pl/initcwndbps/16090/mm/32/mn/sn-f5f7lne6/ms/lv/mv/m/pl/17/keepalive/yes/mt/1557594323/disable_polymer/true/ip/88.88.88.88/ipbits/0/expire/1557616020/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,ei,gcr,initcwndbps,mm,mn,ms,mv,pl/signature/6B037A67434BF766F9BF9786AC0E856797E7BC99.730FDEAA1CE8734AEE02FDBACD8AC0AEEC238062/key/dg_yt0/playlist/index.m3u8/sq/7178/goap/clen%3D81404%3Blmt%3D1557596938914512/govp/clen%3D27169%3Blmt%3D1557596938914512/dur/5.000/file/seg.ts' for reading
[https @ 0000000004ebabc0] Opening 'https://manifest.googlevideo.com/api/manifest/hls_playlist/id/5K1nBNWVa-M.1/itag/301/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D299/hls_chunk_host/r5---sn-f5f7lne6.googlevideo.com/playlist_type/DVR/ei/NAHXXOiKGJCfgAPNpLGwDg/gcr/pl/initcwndbps/16090/mm/32/mn/sn-f5f7lne6/ms/lv/mv/m/pl/17/dover/11/keepalive/yes/mt/1557594323/disable_polymer/true/ip/88.88.88.88/ipbits/0/expire/1557616020/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,ei,gcr,initcwndbps,mm,mn,ms,mv,pl/signature/6B037A67434BF766F9BF9786AC0E856797E7BC99.730FDEAA1CE8734AEE02FDBACD8AC0AEEC238062/key/dg_yt0/playlist/index.m3u8'for reading

    Last message repeated 78 times

[https @ 0000000006d48c80] Opening 'https://manifest.googlevideo.com/api/manifest/hls_playlist/id/5K1nBNWVa-M.1/itag/301/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D299/hls_chunk_host/r5---sn-f5f7lne6.googlevideo.com/playlist_type/DVR/ei/NAHXXOiKGJCfgAPNpLGwDg/gcr/pl/initcwndbps/16090/mm/32/mn/sn-f5f7lne6/ms/lv/mv/m/pl/17/dover/11/keepalive/yes/mt/1557594323/disable_polymer/true/ip/88.88.88.88/ipbits/0/expire/1557616020/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,ei,gcr,initcwndbps,mm,mn,ms,mv,pl/signature/6B037A67434BF766F9BF9786AC0E856797E7BC99.730FDEAA1CE8734AEE02FDBACD8AC0AEEC238062/key/dg_yt0/playlist/index.m3u8'for reading

    Last message repeated 417 times

It is reapating about trying to download "seg.ts" and "index.m3u8" for reading.
It takes forever to repeat.
Then when I try to stop recording whith CTRL+C (pressed one time) I get:

Error writing trailer of file:D:\stream.mp4.part: Immediate exit requested
frame=150300 fps= 14 q=-1.0 Lsize= 1197824kB time=00:41:44.98 bitrate=3917.2kbits/s speed=0.234x
video:1159497kB audio:39141kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Exiting normally, received signal 2.
[ffmpeg] Interrupted by user
[ffmpeg] Downloaded 1226571824 bytes
[download] 100% of 1.14GiB in 02:58:55

...and the file it produces is unusable cannot be played by any video player.

How should I stop recording of live stream when it is finished? It does not stop by itself and CTRL+C method does not work for me.
When I stop recording with CTRL+C during the stream goes on everything is fine. The output file is just OK.
Problem is present with all versions of youtube-dl I have been using from old ones to the current release.
I saw issue #15717 but on my Windows 7 pressing CTRL+C one time does not wark as intended.

Can you please show me the propper method to stop recording of finished live stream from youtube or how to make it to stop automaticaly when it is finished.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 13, 2019

Live streams are handled by ffmpeg, address this to them.
Or use mpegts container --hls-use-mpegts.

@dstftw dstftw closed this May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.