iina/iina

High delay streaming with avi files

Opened this issue · 3 comments

System and IINA version:

  • macOS 10.14.6 and 14.4.1
  • IINA Version 1.3.4

Expected behavior:

Immediately start of the video file

Actual behavior:

There is a large delay when starting a filetype .avi/mpeg4 format from a NAS.
It takes measured from the double-click up to 10 seconds until the video is starting.
During this time the Beach Ball is spinning.

Steps to reproduce:

Use some old video files. The NAS is mounted via Samba, but it is not faster with AFP.

How often does this happen?

Always.

In IINA's settings on the Network tab at the top there is an Enable cache option:
cache-settings

Uncheck that option. Restart IINA. Try playing a file from the NAS. Did the behavior change?

It could be possible that the file is badly muxed, so that libav requires seeking back and forth (e.g. audio and video packets are at separate ends of the file instead of interleaved properly). Is this all files, or just a specific file?

Also I don't know much about media codec, but I've heard that avi is a particularly bad container format in that it doesn't properly support notion of DTS (decode stamp) or PTS (presentation stamp). See https://ffmpeg.org/pipermail/ffmpeg-devel/2011-February/104434.html

Almost any absurd combination of problem that can be imagined actually
exist. The most obnoxious one is probably AVI: the AVI format has no
timestamps whatsoever. The best timing information it provides is the
assumption that each packet code for exactly one frame, and each frame has
exactly the same duration. Thus, the packet number can more or less be
used as a DTS, but that's all.

It's quite possible that avi is not good for streaming over high-latency network, perhaps try remuxing into proper mp4 container?

I disabled the cache already. But I found the solution a few minutes ago:

I created in /private/etc a config file nsmb.conf with the content

[default]
protocol_vers_map=2

After a reboot everything is working fine, also with activated network cache.
Weird, in Mavericks this file didn't exist and playing movies from NAS always worked fine.