我正在尝试使用youtube-dl将YouTube NASA ISS实时流(或任何YouTube流)转码为rtmp或rtsp。我认为我的命令正确,但是由于某些原因,我无法连接到新转码的流。
这是我正在使用的命令:
youtube-dl -f best "https://youtu.be/RtU_mdL2vBM" -o - | ffmpeg -re -f mp4 -i pipe:0 -ar 44100 -f flv rtmp://localhost:1935/test/test'
该命令似乎可以正常工作,并且我看到有关从YouTube打开的流文件的信息,但是当我使用以下命令时,vlc报告它无法连接到该流。
vlc rtmp://localhost:1935/test/test
如果我使用下一条命令,则流在vlc中可以正确播放,并且我可以看到youtube-dl部分正在运行。
youtube-dl -o - "https://youtu.be/RtU_mdL2vBM" | vlc -
或者只是
vlc -vvv https://youtu.be/RtU_mdL2vBM
所以看来ffmpeg是问题所在,或者也许我需要在转码和所需目标(vlc或TouchDesigner)之间的流服务器。我还尝试使用vlc代替ffmpeg / youtube-dl:
vlc -vvv https://youtu.be/RtU_mdL2vBM --sout '#transcode{vcodec=h264,vb=800,acodec=none}:rtp{sdp=rtsp://:554/test}'
或
youtube-dl -o - "https://youtu.be/RtU_mdL2vBM" | vlc - --sout '#transcode{vcodec=h264,vb=800,acodec=none}:rtp{sdp=rtsp://:554/test}'
并使用
查看vlc rtsp://localhost:554/test
不幸的是,我无法使这些方法都起作用。如果我尝试像这样复制它,我什至看不到vlc中的流:
vlc -vvv https://youtu.be/RtU_mdL2vBM --sout '#duplicate{dst=display,dst="#transcode{vcodec=h264,vb=800,acodec=none}:rtp{,sdp=rtsp://:554/test}"}'
任何建议将不胜感激。谢谢!
编辑 这是要求的ffmpeg日志。该程序继续正常运行,所以大约一分钟后我中断了该程序。
ffmpeg version N-91805-g7bb90a9449 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20180813
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 19.100 / 56. 19.100
libavcodec 58. 27.101 / 58. 27.101
libavformat 58. 18.100 / 58. 18.100
libavdevice 58. 4.101 / 58. 4.101
libavfilter 7. 26.100 / 7. 26.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
[youtube] RtU_mdL2vBM: Downloading webpage
[youtube] RtU_mdL2vBM: Downloading video info webpage
[youtube] RtU_mdL2vBM: Downloading m3u8 information
[youtube] RtU_mdL2vBM: Downloading MPD manifest
[youtube] RtU_mdL2vBM: Downloading MPD manifest
[download] Destination: -
ffmpeg version N-91805-g7bb90a9449 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20180813
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 19.100 / 56. 19.100
libavcodec 58. 27.101 / 58. 27.101
libavformat 58. 18.100 / 58. 18.100
libavdevice 58. 4.101 / 58. 4.101
libavfilter 7. 26.100 / 7. 26.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
[hls,applehttp @ 0000025043b5b8c0] Opening 'https://r1---sn-a5meknsd.googlevideo.com/videoplayback/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8/sq/7083785/goap/clen%3D82062%3Blmt%3D1536264500502461/govp/clen%3D1207415%3Blmt%3D1536264500502461/dur/5.000/file/seg.ts' for reading
[hls,applehttp @ 0000025043b5b8c0] Opening 'https://r1---sn-a5meknsd.googlevideo.com/videoplayback/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8/sq/7083786/goap/clen%3D82114%3Blmt%3D1536264505368820/govp/clen%3D921521%3Blmt%3D1536264505368820/dur/5.000/file/seg.ts' for reading
Input #0, hls,applehttp, from 'https://manifest.googlevideo.com/api/manifest/hls_playlist/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/dover/11/playlist_duration/30/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8':
Duration: N/A, start: 77339.207089, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 0
Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 0
Stream #0:1: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 90k tbn, 120 tbc
Metadata:
variant_bitrate : 0
Output #0, mpegts, to 'pipe:':
Metadata:
encoder : Lavf58.18.100
Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 60 fps, 60 tbr, 90k tbn, 90k tbc
Metadata:
variant_bitrate : 0
Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 0
Stream mapping:
Stream #0:1 -> #0:0 (copy)
Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[https @ 00000250440f9400] Opening 'https://r1---sn-a5meknsd.googlevideo.com/videoplayback/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8/sq/7083787/goap/clen%3D82559%3Blmt%3D1536264513336444/govp/clen%3D1159272%3Blmt%3D1536264513336444/dur/5.000/file/seg.ts' for reading
[https @ 00000250440f9400] Opening 'https://r1---sn-a5meknsd.googlevideo.com/videoplayback/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8/sq/7083788/goap/clen%3D82284%3Blmt%3D1536264515970806/govp/clen%3D806499%3Blmt%3D1536264515970806/dur/5.000/file/seg.ts' for reading
[https @ 00000250442e6580] Opening 'https://r1---sn-a5meknsd.googlevideo.com/videoplayback/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8/sq/7083789/goap/clen%3D86065%3Blmt%3D1536264520896201/govp/clen%3D858826%3Blmt%3D1536264520896201/dur/5.250/file/seg.ts' for reading
[https @ 0000025044549a80] Opening 'https://manifest.googlevideo.com/api/manifest/hls_playlist/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/dover/11/playlist_duration/30/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8' for reading
Last message repeated 1 times
[https @ 00000250442e6580] Opening 'https://r1---sn-a5meknsd.googlevideo.com/videoplayback/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8/sq/7083790/goap/clen%3D84751%3Blmt%3D1536264525099796/govp/clen%3D1149917%3Blmt%3D1536264525099796/dur/5.168/file/seg.ts' for reading
[https @ 0000025044549a80] Opening 'https://manifest.googlevideo.com/api/manifest/hls_playlist/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/dover/11/playlist_duration/30/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8' for reading
[https @ 00000250442e6580] Opening 'https://r1---sn-a5meknsd.googlevideo.com/videoplayback/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8/sq/7083791/goap/clen%3D86308%3Blmt%3D1536264531550269/govp/clen%3D1347646%3Blmt%3D1536264531550269/dur/5.250/file/seg.ts' for reading
[https @ 0000025044549a80] Opening 'https://manifest.googlevideo.com/api/manifest/hls_playlist/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/dover/11/playlist_duration/30/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8' for reading
[https @ 00000250442e6580] Opening 'https://r1---sn-a5meknsd.googlevideo.com/videoplayback/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8/sq/7083792/goap/clen%3D63862%3Blmt%3D1536264536697249/govp/clen%3D1011009%3Blmt%3D1536264536697249/dur/3.835/file/seg.ts' for reading
[https @ 0000025044549a80] Opening 'https://manifest.googlevideo.com/api/manifest/hls_playlist/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/dover/11/playlist_duration/30/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8' for reading
[https @ 00000250442e6580] Opening 'https://r1---sn-a5meknsd.googlevideo.com/videoplayback/id/RtU_mdL2vBM.2/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/r1---sn-a5meknsd.googlevideo.com/playlist_type/DVR/gcr/us/ei/LImRW8WTKNbCkgaX_oXQBQ/initcwndbps/11730/mm/32/mn/sn-a5meknsd/ms/lv/mv/m/pl/20/manifest_duration/30/keepalive/yes/mt/1536264380/disable_polymer/true/ip/76.81.240.50/ipbits/0/expire/1536286092/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/0D92427B34C835DDD58D1ABFA8D1E131151867C1.359F90D7EB3E1E31A3BF19320022B95DF24E959E/key/dg_yt0/playlist/index.m3u8/sq/7083793/goap/clen%3D82043%3Blmt%3D1536264538567230/govp/clen%3D1385870%3Blmt%3D1536264538567230/dur/4.999/file/seg.ts' for reading
Error writing trailer of pipe:: Immediate exit requested.52 bitrate=2034.6kbits/s speed=1.41x
frame= 2670 fps= 86 q=-1.0 Lsize= 11385kB time=00:00:44.49 bitrate=2095.9kbits/s speed=1.44x
video:9580kB audio:695kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 10.808865%
Exiting normally, received signal 2.
[ffmpeg] Interrupted by user
[download] 100% in 00:32
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002c5ceebaa40] moov atom not found
pipe:0: Invalid data found when processing input
Exiting normally, received signal 2.
答案 0 :(得分:0)
嗯,解决方案最终变得非常简单。这是编写命令的正确方法(我在--sout选项之后缺少'=',并且不需要在参数两边加上引号;在Linux中这是不同的):
youtube-dl -o - "https://www.youtube.com/watch?v=UQt2iLKqBbI" | vlc - --sout=#transcode{vcodec=h264,vb=800,acodec=none}:rtp{sdp=rtsp://:554/test}
奇怪的是,我仍然无法获得ffmpeg进行转码。也许我那里有一些不正确的选择?
另外,如果我尝试使用下面的命令通过vlc获取流,我只会在图像左上角的一小部分被裁剪。
vlc -vvv https://youtu.be/RtU_mdL2vBM --sout=#transcode{vcodec=h264}:rtp{sdp=rtsp://:554/test}
我很好奇是否有人知道为什么我无法使用ffmpeg进行工作,或者为什么在使用vlc而非youtube-dl获取流时为什么会裁剪图像。
编辑 还有一个名为livestreamer的命令行工具似乎更可靠:http://docs.livestreamer.io
以下是您如何使用它的示例:
livestreamer --retry-streams 1 https://www.youtube.com/watch?v=UQt2iLKqBbI best -O | vlc - --sout=#transcode{vcodec=h264,vb=15000,acodec=none}:rtp{sdp=rtsp://:563/test,proto=udp}
如果您打算使用它,则可能需要编辑youtube插件。
C:\ Users [用户名] \ AppData \ Local \ Programs \ Python \ Python35 \ Lib \ site-packages \ livestreamer \ plugins \ youtube.py
在_get_stream_info下注释掉“ el”:在“ params”字典中的“ player_embedded”,如下所示:
params = {
"video_id": video_id,
#"el": "player_embedded"
}
谢谢!