• 使用vlc串流http视频链接


    使用windowsGUI

    • 媒体---->打开网络串流
      在这里插入图片描述
    • 填入链接
      在这里插入图片描述
    • 下拉播放按钮,点击串流
      在这里插入图片描述
    • 点击下一个
      在这里插入图片描述
    • 点击添加
      在这里插入图片描述
    • 直接输入文件名如:video.mp4会下载到VLC的安装目录,所以我们点浏览来自己设置保存路径。
      在这里插入图片描述
    • 输入将要保存的文件名,下载时会自动创建在这里插入图片描述
    • 点击保存------>下一个。配置文件默认就好
      在这里插入图片描述
    • 点击流就会开始下载
      在这里插入图片描述
    • 出现进度条
      在这里插入图片描述
    • 注意:VLC的缓存不会即时写入文件中,故需要手动点×终止程序,视频才能观看。

    使用windows命令行

    vlc --intf=cvlc “这里填写url” :sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:file{dst=这里填写文件路径,no-overwrite} :no-sout-all :no-sout-keep

    在末尾追加 vlc://quit 可以在播放结束直接退出,有无界面可以使用–extraintf=logger 或 --intf=cvlc
    如:无界面

    vlc --intf=cvlc "http://123.60.223.219:7083/dev_vod/vod.m3u8?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NfbW9kZSI6IkhPTE8iLCJjaGFubmVsX2lkIjo2LCJkZXZpY2VfaWQiOiIyMTk4MDYxMjQwNlJNQjAwMDA2NyIsImVuZF90aW1lIjoiMjAyMjA3MTkxNzE1MzAiLCJlbnRlcnByaXNlX2lkIjoiIiwiZXhwaXJlX3RpbWVfY3VzdG9tIjoxNjU4MjY3MjUzLCJsaW5rX2tleSI6IjE2NTgyODYwNTMzMTA3MTYxNjdjNzIxYjg5YyIsInJlY29yZF90eXBlIjoiYWxsIiwicmVxdWVzdF9pZCI6IjJhYWVkNmI2LTA3ZDgtMTFlZC05NDA5LWZhMTYzZWFlZWFmZCIsInN0YXJ0X3RpbWUiOiIyMDIyMDcxOTE3MTQzMCIsInVzZXJfaWQiOiIxMjEzNDE3Mjc3MjAyMjA1MzAwOTU4MDYifQ.RKL8RzWlAFy0jJjv3BdDlxog7xH3FJwVSvaZlqpuBO4&device_id=21980612406RMB000067&channel_id=6&stream_type=0" :sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:file{dst=video2.mp4,no-overwrite} :no-sout-all :no-sout-keep
    
    • 1

    有界面

    vlc --extraintf=logger "http://123.60.223.219:7083/dev_vod/vod.m3u8?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NfbW9kZSI6IkhPTE8iLCJjaGFubmVsX2lkIjo2LCJkZXZpY2VfaWQiOiIyMTk4MDYxMjQwNlJNQjAwMDA2NyIsImVuZF90aW1lIjoiMjAyMjA3MTkxNzE1MzAiLCJlbnRlcnByaXNlX2lkIjoiIiwiZXhwaXJlX3RpbWVfY3VzdG9tIjoxNjU4MjY3MjUzLCJsaW5rX2tleSI6IjE2NTgyODYwNTMzMTA3MTYxNjdjNzIxYjg5YyIsInJlY29yZF90eXBlIjoiYWxsIiwicmVxdWVzdF9pZCI6IjJhYWVkNmI2LTA3ZDgtMTFlZC05NDA5LWZhMTYzZWFlZWFmZCIsInN0YXJ0X3RpbWUiOiIyMDIyMDcxOTE3MTQzMCIsInVzZXJfaWQiOiIxMjEzNDE3Mjc3MjAyMjA1MzAwOTU4MDYifQ.RKL8RzWlAFy0jJjv3BdDlxog7xH3FJwVSvaZlqpuBO4&device_id=21980612406RMB000067&channel_id=6&stream_type=0" :sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:file{dst=video2.mp4,no-overwrite} :no-sout-all :no-sout-keep
    
    • 1

    结束后立即退出:

    vlc --intf=cvlc "http://123.60.223.219:7083/dev_vod/vod.m3u8?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NfbW9kZSI6IkhPTE8iLCJjaGFubmVsX2lkIjo2LCJkZXZpY2VfaWQiOiIyMTk4MDYxMjQwNlJNQjAwMDA2NyIsImVuZF90aW1lIjoiMjAyMjA3MTkxNzE1MzAiLCJlbnRlcnByaXNlX2lkIjoiIiwiZXhwaXJlX3RpbWVfY3VzdG9tIjoxNjU4MjY3MjUzLCJsaW5rX2tleSI6IjE2NTgyODYwNTMzMTA3MTYxNjdjNzIxYjg5YyIsInJlY29yZF90eXBlIjoiYWxsIiwicmVxdWVzdF9pZCI6IjJhYWVkNmI2LTA3ZDgtMTFlZC05NDA5LWZhMTYzZWFlZWFmZCIsInN0YXJ0X3RpbWUiOiIyMDIyMDcxOTE3MTQzMCIsInVzZXJfaWQiOiIxMjEzNDE3Mjc3MjAyMjA1MzAwOTU4MDYifQ.RKL8RzWlAFy0jJjv3BdDlxog7xH3FJwVSvaZlqpuBO4&device_id=21980612406RMB000067&channel_id=6&stream_type=0" :sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:file{dst=video2.mp4,no-overwrite} :no-sout-all :no-sout-keep vlc://quit
    
    • 1

    使用linux命令行

    cvlc “url” --sout “#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:file{dst=文件名路径,no-overwrite}” --no-sout-all --sout-keep vlc://quit

    同上述一样,vlc://quit 代表结束即退出

    cvlc "http://122.9.45.24:7083/dev_vod/vod.m3u8?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NfbW9kZSI6IkhPTE8iLCJjaGFubmVsX2lkIjowLCJkZXZpY2VfaWQiOiIyMTk4MDYxMjM1NlJNNjAwMDAxMCIsImVuZF90aW1lIjoiMjAyMjA4MDExMzI5NDUiLCJlbnRlcnByaXNlX2lkIjoiIiwiZXhwaXJlX3RpbWVfY3VzdG9tIjoxNjU5NDE3NTk5LCJsaW5rX2tleSI6IjE2NTk0MzYzOTk2MDY3MzkyMjhkMzZkM2RmZSIsInJlY29yZF90eXBlIjoiYWxsIiwicmVxdWVzdF9pZCI6Ijg2OWIwMTlkLTEyNGUtMTFlZC05NDA5LWZhMTYzZWFlZWFmZCIsInN0YXJ0X3RpbWUiOiIyMDIyMDgwMTEzMjkzOSIsInVzZXJfaWQiOiIxODg3NDA0MDEzMjAyMjA0MTkxOTU0NTYifQ.bfpSlGu4u7KjmtzAa1QOumFC6Col3JGhRJ45lUDazKs&device_id=21980612356RM6000010&channel_id=0&stream_type=0" --sout "#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:file{dst=./videos/MicroEdge_.mp4,no-overwrite}" --no-sout-all --sout-keep vlc://quit
    
    • 1

    cvlc 是无界面的,如果你的想使用有界面的且你的linux支持界面,可以使用 vlc

    vlc "http://122.9.45.24:7083/dev_vod/vod.m3u8?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NfbW9kZSI6IkhPTE8iLCJjaGFubmVsX2lkIjowLCJkZXZpY2VfaWQiOiIyMTk4MDYxMjM1NlJNNjAwMDAxMCIsImVuZF90aW1lIjoiMjAyMjA4MDExMzI5NDUiLCJlbnRlcnByaXNlX2lkIjoiIiwiZXhwaXJlX3RpbWVfY3VzdG9tIjoxNjU5NDE3NTk5LCJsaW5rX2tleSI6IjE2NTk0MzYzOTk2MDY3MzkyMjhkMzZkM2RmZSIsInJlY29yZF90eXBlIjoiYWxsIiwicmVxdWVzdF9pZCI6Ijg2OWIwMTlkLTEyNGUtMTFlZC05NDA5LWZhMTYzZWFlZWFmZCIsInN0YXJ0X3RpbWUiOiIyMDIyMDgwMTEzMjkzOSIsInVzZXJfaWQiOiIxODg3NDA0MDEzMjAyMjA0MTkxOTU0NTYifQ.bfpSlGu4u7KjmtzAa1QOumFC6Col3JGhRJ45lUDazKs&device_id=21980612356RM6000010&channel_id=0&stream_type=0" --sout "#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:file{dst=./videos/MicroEdge_.mp4,no-overwrite}" --no-sout-all --sout-keep vlc://quit
    
    • 1
  • 相关阅读:
    ThreadLocal真会内存泄漏?
    Laravel文档阅读笔记-Adding a Markdown editor to Laravel
    Linux sed命令
    卷积网络识别乳腺癌
    死锁问题【javaEE初阶】
    【微机接口】中断系统:中断响应和处理的过程
    C语言之字符串函数二
    数据结构——二叉树【堆】
    深度学习入门(九) 多层感知机实现
    Java数据结构与算法
  • 原文地址:https://blog.csdn.net/qq_55796594/article/details/126127653