Git Product home page Git Product logo

Comments (10)

jmeiners avatar jmeiners commented on August 16, 2024

If someone could point me to some info on how the buffering is supposed to work I would be happy to look into this issue. Really just looking for some pointers on where to start looking :)

from omxplayer.

popcornmix avatar popcornmix commented on August 16, 2024

Does running with 0.1 instead of 0.5 for fifo/buffer sizes help?
When you run with "-s" what values does "V:" and "S:" stabilise at?

from omxplayer.

jmeiners avatar jmeiners commented on August 16, 2024

0.1 doesn't work, here is the lowest values I have found that do work. It is odd that the audio_fifo tag is in seconds where the rest are in MB.
./vsmedia -s --video_fifo 0.25 --video_queue 0.25 --audio_fifo 2 --audio_queue 0.05 --threshold 0.1 udp://@192.168.1.128:5006

This yields a latency of about 7 seconds
Status
M:21895958 V: 1.69s 240k/ 240k A: 0.73 1.02s/ 2.00s Cv: 235k Ca: 24k

This shows the input cache basically full, with the output clock being presumably driven by trying to keep the output audio fifo centered at 50%. But the video output buffer is too small for that, so these numbers don't make sense....

from omxplayer.

jmeiners avatar jmeiners commented on August 16, 2024

V: = video_fifo in seconds (video_fifo is set via command line in MB, but 250Kb is not enough for 1.7s delay in 720p ???

m_player_video.GetDecoderBufferSize()-m_player_video.GetDecoderFreeSpace() / m_player_video.GetDecoderBufferSize() in Kb
What is decoder_buffer and why is it kept full?

A: = audio_fifo in seconds?

m_player_audio.GetDelay() / m_player_audio.GetCacheTotal() also in seconds?

CV = m_player_video.GetCached() in kb
ca = m_player_audio.GetCached() in kb

Audio is AAC 128kbps, so 16Kb would be 1 second of input audio. With a audio queue of 50Kb that should be 3.125 seconds ...

I guess I just don't understand how the buffers are allocated and used enough to know how to set the parameters.

from omxplayer.

jmeiners avatar jmeiners commented on August 16, 2024

Ok, found the problem. FFMPEG is buffering all the data it uses for stream format analysis. Just have to add the flag below to correct (when opening the stream).

// discards the frames buffered during stream analysis
m_pFormatContext->flags |= AVFMT_FLAG_NOBUFFER;

That said, there are still more issues elsewhere in the pipe. I don't think the OMX clock adjustment is working properly...

from omxplayer.

p51d78th avatar p51d78th commented on August 16, 2024

What file / line did you add the flag to to make FFMPEG not buffer the data?

from omxplayer.

jmeiners avatar jmeiners commented on August 16, 2024

OMXReader.cpp

Insert it after this line
m_pFormatContext->flags |= AVFMT_FLAG_NONBLOCK;

However, you should only do this on live streams otherwise you can cutoff the start of files.

from omxplayer.

p51d78th avatar p51d78th commented on August 16, 2024

Okay so that worked.

I am trying to use the PI as a low latency Video Decoder. Adding the NOBUFFER flag dropped the latency in half to about 2 seconds.

Any recommendations on getting it even lower? I am trying to get it below 400 ms if it is possible.

Thanks

from omxplayer.

popcornmix avatar popcornmix commented on August 16, 2024

See #55

from omxplayer.

popcornmix avatar popcornmix commented on August 16, 2024

I believe this is resolved. Please report additional issues on
#55

from omxplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.