Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

93
Visualizações
Flickering in video stream in HTML

I'm currently working on a video streaming website with WebSockets, streaming data from the webcam using open cv Python, sending them over frame by frame to a web socket. the client web socket reads the data and displays the image. I'm however experiencing a flickering issue with the images when all the feed elements are not visible, however when all feeds are visible it seems to work fine.

I've attached the html code (using jinja templates) and also the javascript

Could someone help me figure out why this is happening and how I can overcome it?

Here are the two YouTube videos to show the issue:

Without flicker - YT (All camera elements with ids 0-5 are visible)

With flicker - YT (Only camera elements with ids 0-3 are visible, 4-5 aren't visible)

-Javascript

const sock2 = new WebSocket('ws://' + location.host + '/camera');
sock2.addEventListener('message', ev=>{
    for(i=0;i<6;i++){
        var webcam_element = document.getElementById(`camera_${i}`);
        webcam_element.src = "data:image/jpg;base64,"+ev.data;
    }
});

-HTML

{% for i in range(6) %}
            <div>
              <img class="feed" id="camera_{{ i }}">
              <div class="feed_title_div">
                <h5 class="font_def feed_title">Room</h5>
              </div>
            </div>
{% endfor %}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda