2025/02/14

今天在 almalinux 9 dnf update出現以下錯誤


Error:

Problem: package iptables-legacy-1.8.10-4.1.el9.x86_64 from @System requires (iptables-libs(x86-64) = 1.8.10-4.el9 or iptables-libs(x86-64) = 1.8.10-4.el9_4), but none of the providers can be installed

- cannot install both iptables-libs-1.8.10-11.el9_5.x86_64 from baseos and iptables-libs-1.8.10-4.el9_4.x86_64 from @System

- cannot install both iptables-libs-1.8.10-4.el9_4.x86_64 from baseos and iptables-libs-1.8.10-11.el9_5.x86_64 from baseos

- cannot install the best update candidate for package iptables-libs-1.8.10-4.el9_4.x86_64

- cannot install the best update candidate for package iptables-legacy-1.8.10-4.1.el9.x86_64

(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

本來想把iptables-legacy iptables-libs 都移除 但因為這台跑docker 如果移除會連docker一起移掉

查到官方 forum有人提供解法

dnf --assumeyes swap iptables-legacy iptables-nft


https://forums.almalinux.org/t/almalinux-9-yum-update-iptables-legacy-and-iptables-libs-conflict/3818/2

2025/02/06

要如何讓使用者能看影片但不被下載

首先把 mp4 分片

ffmpeg -i abc.mp4 -codec: copy -start_number 0 -hls_time 15 -hls_list_size 0 -f hls abc.m3u8

分片後把 abc.mp4 移出目錄


建立 index.html


<html>
<head>
  <link href="https://vjs.zencdn.net/8.16.1/video-js.css" rel="stylesheet" />

  <!-- If you'd like to support IE8 (for Video.js versions prior to v7) -->
  <!-- <script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script> -->
</head>

<body>
  <video
    id="my-video"
    class="video-js"
    controls
    preload="auto"
    width="640"
    height="480"
    刪除以下一行
    poster="MY_VIDEO_POSTER.jpg"
    data-setup="{}"
  >
    <source src="MY_VIDEO.mp4" type="video/mp4" />
    <source src="MY_VIDEO.webm" type="video/webm" />
   刪除以上二行

    把第一步產生的所有分片檔放到 web server 的目錄 並依需求修改以下文字

    <source src='http://10.0.0.1/test/abc.m3u8' type="application/x-mpegURL">   
    
    <p class="vjs-no-js">
      To view this video please enable JavaScript, and consider upgrading to a
      web browser that
      <a href="https://videojs.com/html5-video-support/" target="_blank"
        >supports HTML5 video</a
      >
    </p>
  </video>

  <script src="https://vjs.zencdn.net/8.16.1/video.min.js"></script>
</body>
</html>


用browser打開即可觀看