FFMpeg on TrueNAS Scale

g33kphr33k

Cadet
Joined
May 22, 2023
Messages
2
Hi folks

We've been using TrueNAS Scale for awhile now on a Gigabyte NAS and it's been great. It's a really over powered box and I'd like to utilise it a little more with a video encode script so I don't have to pull the videos across the network and back.

How would I go about installing ffmpeg from the repos on it? I know it's to be treated as an appliance, so I don't want to fiddle with it too much, but ffmpeg as a standalone should do no harm.

Any tips would be great, else I think I can grab a portable pre-compiled from somewhere or a straight up .deb.

Thanks.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The best way to do that is in a container, not on the host at all.

something like this perhaps... https://github.com/alfg/ffmpeg-commander

You just need to run the already compiled version from the Launch Docker Image button

kiuber/ffmpeg-commander​

then specify the port mapping you need (map to container port 80) and map some storage in there for your videos (thinking about permissions of course, so maybe also run the container as a user with the rights rather than defaults).

You need to connect to it with http://TrueNAS_IP:Port_you_forwarded/ffmpeg-commander once it's running.

An already running sample so you can see if it meets your needs first:

EDIT: Although, after looking into it to the last step, I now see it doesn't give you the chance to actually execute the command you build... what a stupid pile of crap for not offering that.

Anyway, something else will be needed... I do see something promising though... a reference on the options page to enabling ffmpegd...

Looks like running ghcr.io/alfg/ffmpegd instead and redirecting port 8080 is the way to go...
 
Last edited:

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
ffmpeg as a standalone should do no harm.

You can think that if you like, but the issue is that as you start to install libraries and have to twiddle with things to make it work, you run a real risk of breaking other stuff. Worse, when you upgrade the system, your changes will get flushed down the toilet like a bowl full of diarrhea and you'll have to start over with making your changes, which may not be particularly fun or desirable. This is why containers exist.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
OK, well forget everything in my post above, because it's super-close to what's needed, but not there to the end.

I think to get there, you would need a container with xorg, a browser and ffmpegd installed to auto-start, then from the x11 session, run the browser, and browse to the sample ffmpeg-commander site... it would then allow you to attach to the local ffmpegd in the container and issue commands.

I might, just as a challenge build such a container, but I don't have the time right away. If your container skills are good enough, maybe you can get there on your own.
 

g33kphr33k

Cadet
Joined
May 22, 2023
Messages
2
Thanks folks, but what I just read just makes me think simply mounting from another box is the way to go, it's far simpler. I'll take the network hit instead
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
This sounds like it could be a good application for a so-called "Linux jail":
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
This sounds like it could be a good application for a so-called "Linux jail":
I agree and had been thinking about that overnight.

It's the best and lightest solution to get access to files on the NAS and run processes "on the host", but not on the host OS.

apt-get packages are fine in the "jail".
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
OK, well forget everything in my post above, because it's super-close to what's needed, but not there to the end.

I think to get there, you would need a container with xorg, a browser and ffmpegd installed to auto-start, then from the x11 session, run the browser, and browse to the sample ffmpeg-commander site... it would then allow you to attach to the local ffmpegd in the container and issue commands.

I might, just as a challenge build such a container, but I don't have the time right away. If your container skills are good enough, maybe you can get there on your own.
X11 in a jail is tricky due to jail having limited rights. You could use tigervnc server to emulate an X11 session, but IIRC, you can't do a normal local X11 session because you can't run startx in the jail. I think, the other permission issue is also that, by default, you can't mount /proc which is needed for most window managers.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
X11 in a jail is tricky due to jail having limited rights. You could use tigervnc server to emulate an X11 session, but IIRC, you can't do a normal local X11 session because you can't run startx in the jail. I think, the other permission issue is also that, by default, you can't mount /proc which is needed for most window managers.
Nope.

I was able to just install the xorg package and then run the executable via a suitable x11 terminal client (in my case Xquartz)... I tried handbrake as one that I know works OK and sure enough, there it is. The OneDrive client also works like that (from another thread I was working on yesterday).
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Nope.

I was able to just install the xorg package and then run the executable via a suitable x11 terminal client (in my case Xquartz)... I tried handbrake as one that I know works OK and sure enough, there it is. The OneDrive client also works like that (from another thread I was working on yesterday).
I take it by executable, you mean xterm or some other X executable via ssh -X and not the actual `startx`?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
In xQuartz, ssh -Y user@jail.IP

In that terminal... handbrake

HandBrake window opens on my client.

The only pre-requisites for that are apt-get install xorg handbrake
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
In xQuartz, ssh -Y user@jail.IP

In that terminal... handbrake

HandBrake window opens on my client.
Ah I see, that's why it works. I was more referring to a local X session (full desktop environment) that you actually run through startx.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
So ultimately I was thinking of firefox or whatever browser as the websocket link for ffmpegd and the front-end. I guess it's all wasted time if it's too complicated for the folks who want to use it.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
All that said, the original request is probably just to run ffmpeg directly, so there's nothing to say that the jail approach is very complicated at all in doing that... just make a jail with access to the data and install ffmpeg... presto.
 

beagle

Explorer
Joined
Jun 15, 2020
Messages
91
I think it was discussed before, but LXC would be a great fit to replace jails on SCALE.

It would make life so much easier to many of the use cases where people are trying to shoehorn apps.

Also, it would be an easier path to migrate jails from Core.
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I think it was discussed before, but LXC would a great fit to replace jails on SCALE.

It would make life so much easier to many of the use cases where people are trying to shoehorn apps.

Also, it would be an easier path to migrate jails from Core.
Did you check out the link posted by @danb35 above... it's pretty much that, delivered already, no need to wait. (the jailmaker script to help with it from @Jip-Hop )
 

beagle

Explorer
Joined
Jun 15, 2020
Messages
91
Did you check out the link posted by @danb35 above... it's pretty much that, delivered already, no need to wait. (the jailmaker script to help with it from @Jip-Hop )
Yes, I saw the script mentioned on a few threads. That or LXC would work, but I'm looking for an official/supported implementation.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I'm looking for an official/supported implementation
@morganL already expressed positive support for this and there's no reason to think it will stop working at any point based on his comments.

There's also a request in Jira to officially include it as linked in that thread too.

If you're talking about some kind of GUI support, fair enough.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
@morganL already expressed positive support for this and there's no reason to think it will stop working at any point based on his comments.

There's also a request in Jira to officially include it as linked in that thread too.

If you're talking about some kind of GUI support, fair enough.

As you indicate. we have no plans to stop tis working.

However, we have not decided whether to promote or officially support this We'd like feedback and there are other longer term options.

Is it reliable and secure enough for traditional jail users?
 
Top