Bug 5880

Summary: Enable samba support
Product: Fedora Reporter: Yaroslav Syrytsia <me>
Component: ffmpegAssignee: Dominik 'Rathann' Mierzejewski <dominik>
Status: CLOSED FIXED    
Severity: enhancement CC: belegdol, kwizart, leigh123linux, vascom2
Priority: P1    
Version: f33   
Hardware: All   
OS: GNU/Linux   
namespace:

Description Yaroslav Syrytsia 2020-12-26 14:08:20 CET
Hello, 

Starting from fedora version 33 (but 32 may be also affected), mpv cannot play any file via smb/cifs:

$ mpv smb://nas/share/sample.mkv
[ffmpeg] Protocol not found. Make sure ffmpeg/Libav is compiled with networking support.
Failed to open smb://nas/share/sample.mkv.

Exiting... (Errors when loading file)

That thing worked just fine for version 31.
I guess that may be related to change in mpv[1] which now handles SMB protocol via ffmpeg.

ffmpeg.spec[2] is already have a flag: `_with_smb` which must be defined to TRUE to make things (like mpv) work again.
I did a local test and rebuild ffmpeg with that flag enabled, and can confirm that mpv works again with smb:// protocol.

[1] -  https://github.com/mpv-player/mpv/commit/28ea1ed296a4e241ee57d9748ff0cfa073e5219c 
[2] - https://github.com/rpmfusion/ffmpeg/blob/master/ffmpeg.spec#L163

Just in case:
ffmpeg-4.3.1-11.fc33.x86_64
mpv-0.33.0-1.fc33.x86_64
Comment 1 leigh scott 2020-12-26 21:45:39 CET
mpv removed samba support and I don't intend to enable in ffmpeg.
Comment 2 Nicolas Chauvet 2020-12-26 22:15:07 CET
I think we could provide an alternative build of ffmpeg with "more" features using "modules"


As this bug is concerned, smb support could be achieved by gvfs and alikes, so we don't need to enable support for any remote/network filesystem is any player...
Comment 3 Vasiliy Glazov 2020-12-27 06:26:31 CET
What is the reason to not enable smb support in ffmpeg?
It seems good for user experience.
Comment 4 Yaroslav Syrytsia 2020-12-27 09:14:52 CET
>I don't intend to enable in ffmpeg.
@Leigh Scott do you have any specific reason for that ? 
Here is my use case on my laptop with f33 (kde), which I use to watch some movies:
- Open NAS via dolphin (just type in the address bar: smb://nas)
- Select some file to watch
* Drag&Drop file name onto konsole (you will have URL like smb://nas/share/example.mkv)
* Start mpv with that URL
- OR directly open the file via dolphin (it will call smplayer with mpv backend)

That workflow worked just fine in f31, and now in f33 I need to deal with gvfs somehow or even download the whole file (10GB+) into the local storage just to watch a movie. It makes me sad.

>I think we could provide an alternative build of ffmpeg with "more" features using "modules"
@Nicolas Chauvet, it's okay for me also. But honestly, there are just a few modules that can be enabled (in package build), and I don't think that invested time/work will worth it.
Comment 5 Yaroslav Syrytsia 2020-12-27 09:27:29 CET
There is the same issue for opensuse[1] which was fixed by building ffmpeg with SMB support enabled.

[1] - https://forums.opensuse.org/showthread.php/539418-tumbleweed-update-no-longer-can-play-videos-from-smb-share
Comment 6 leigh scott 2020-12-27 10:29:34 CET
(In reply to Vasiliy Glazov from comment #3)
> What is the reason to not enable smb support in ffmpeg?
> It seems good for user experience.

mpd and mpv dropped smb support because it is unstable, now mpv expects ffmpeg to provide it.

TBH I don't see why users can't mount their samba shares using cifs and play as a local file.
Comment 7 Nicolas Chauvet 2020-12-27 10:48:39 CET
(In reply to Yaroslav Syrytsia from comment #4)
...
> That workflow worked just fine in f31, and now in f33 I need to deal with
> gvfs somehow or even download the whole file (10GB+) into the local storage
> just to watch a movie. It makes me sad.
What's the problem with gvfs ?

The more feature are enabled in ffmpeg the bigger the binary is and more dependencies needs to be installed, even when one wants to keep the build minimal.

This has security consequences, one needs to maintain and trust the code that enable smbclient support (here in ffmpeg). I would prefer to defer this to gvfs instead, so we won't have to bother for remote network filesystem (smb/nfs/etc) Even if I usually trust ffmpeg maintenance...

IIRC, the reason why smb feature is a with conditional is because it's GPLv3+.(which we might already have enabled) So it would turn our ffmpeg build as GPLv3+ (instead of GPLv2+) which might have licensing issue with one or another dependency.
This reason might not hold nowadays... Needs to be evaluated.
Comment 8 Nicolas Chauvet 2021-01-03 10:13:16 CET
Ok, so with Leigh, we agreed that enabling smb in ffmpeg worth a try.
So it's done for f33+

But the more libraries are enabled, the more chances for a symbol version mismatch can occur. This occurs when a project is built with another compat version of a library and not another. This concern either ffmpeg library dependencies or "users" (such as video players, etc).

If such issue arise, we will have to revert back to minimize the dependency set of ffmpeg as we won't be able to workaround the issue in our side.
Comment 9 Yaroslav Syrytsia 2021-01-04 09:12:44 CET
(In reply to Nicolas Chauvet from comment #8)
> Ok, so with Leigh, we agreed that enabling smb in ffmpeg worth a try.
> So it's done for f33+

That's awesome. Thank you :)
Comment 10 leigh scott 2021-01-14 11:17:27 CET
It seems my smb fears are starting to materialize.

https://bugzilla.rpmfusion.org/show_bug.cgi?id=5897
Comment 11 Yaroslav Syrytsia 2021-01-14 11:21:45 CET
(In reply to leigh scott from comment #10)
> It seems my smb fears are starting to materialize.
> 
> https://bugzilla.rpmfusion.org/show_bug.cgi?id=5897

Are you sure that #5897 is related to ffmpeg ?
/usr/lib64/samba/libkrb5samba-samba4.so belongs to samba-client-libs-4.13.3-0.fc33.x86_64 (on my f33 system)
Comment 12 Julian Sikorski 2021-01-14 11:29:03 CET
It might be a samba bug but with the increased number of dependencies ffmpeg users are getting affected - apparently even if their use case has nothing to do with the dependency.
Comment 13 leigh scott 2021-01-14 11:31:26 CET
(In reply to Yaroslav Syrytsia from comment #11)
> (In reply to leigh scott from comment #10)
> > It seems my smb fears are starting to materialize.
> > 
> > https://bugzilla.rpmfusion.org/show_bug.cgi?id=5897
> 
> Are you sure that #5897 is related to ffmpeg ?
> /usr/lib64/samba/libkrb5samba-samba4.so belongs to
> samba-client-libs-4.13.3-0.fc33.x86_64 (on my f33 system)

ffmpeg with smb support uses 

libsmbclient.so.0()(64bit)
libsmbclient.so.0(SMBCLIENT_0.1.0)(64bit)

$ rpm -qf /usr/lib64/libsmbclient.so.0
libsmbclient-4.13.3-0.fc33.x86_64


$ ldd /usr/lib64/libsmbclient.so.0 |grep libkrb5samba-samba4
	libkrb5samba-samba4.so => /usr/lib64/samba/libkrb5samba-samba4.so (0x00007f1033c21000)