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

How do I can change stream's resolution in real time? #477

Closed
pavel-vorobyev opened this issue Aug 10, 2021 · 1 comment
Closed

How do I can change stream's resolution in real time? #477

pavel-vorobyev opened this issue Aug 10, 2021 · 1 comment

Comments

@pavel-vorobyev
Copy link

This my config:

module.exports = {
  logType: 3,
  rtmp: {
    port: 1935,
    chunk_size: 60000,
    gop_cache: false,
    ping: 30,
    ping_timeout: 60,
  },
  http: {
    port: 8000,
    allow_origin: '*',
    mediaroot: '/DIRECT/PATH/rmtp-server/media'
  },
  trans: {
    ffmpeg: /DIRECT/PATH/rmtp-server/ffmpeg',
    tasks: [
      {
        app: 'live',
        ac: 'aac',
        vc: 'libx264',
        hls: true,
        hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]',
        dash: true,
        dashFlags: '[f=dash:window_size=3:extra_window_size=5]'
      }
    ]
  }
}

This is my client implementation. I'm using his.js

<div>
    <video id="video" muted="muted" autoplay></video>
</div>

import Hls from 'hls.js'

const video = document.getElementById('video') as HTMLVideoElement
const videoSrc = 'http://localhost:8000/live/qqq/index.m3u8'

if (Hls.isSupported()) {
    const hls = new Hls()
    hls.loadSource(videoSrc)
    hls.attachMedia(video)
    hls.startLoad()
}

How do I can implement stream resolution changing? What I need to do on the client and on the server sides to get it done? Thanks in advance.

@pavel-vorobyev
Copy link
Author

I checked the documentation carefully and found this. That's the key :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant