Networking – How does VLC-player play Samba-shared video files

networkingsambavideovlc-media-playerwireshark

I have to Virtual Machines (Ubuntu 18.04) which are running on the same internal network.

The Server-VM stores a video in a folder which is shared to the Client-VM using Samba.

The bitrate of the video looks like this:
enter image description here

Now I use the VLC-player to play this video on the Client-VM.

The thing I am wondering about:

Method A:

When the shared folder is mounted, it is available for the Client-VM under the path: /run/user/1000/gvfs/smb-share:server=vm1server.local,share=testvideos/.

I play the video with this command (which is the same like doing "Open file" in the VLC GUI):

vlc /run/user/1000/gvfs/smb-share:server=vm1server.local,share=testvideos/bbb_sunflower_2160p_60fps_normal.mp4

I get the following datarate in Wireshark:

enter image description here

Method B

No matter if the shared folder is mounted, when I play the video with this command (which is the same like doing "Open network stream" in the VLC GUI):

vlc smb://vm1server.local/testvideos/bbb_sunflower_2160p_60fps_normal.mp4

I get the following datarate in Wireshark:

enter image description here

Note that the datarate is more or less the same. Only at the beginning, I get 12Mbit/s in the first example and 140Mbit/s in the second one.

Does anybody know the difference about the two methods I use to play the video?

Best Answer

This may simply be a case of different buffering approaches. In Method A, VLC allows Samba driver / filesystem / OS to read the data as needed. In Method B, VLC itself may decide to fill a large buffer on startup and then fall back to gradual reading. This would explain the initial spike.

Related Question