this is a great ideaI’ve thought about making an addon that allows videos to be uploaded, but then the backend sends them to the site’s YouTube for transcoding and hosting. Then the site controls the video but also doesn’t have the overhead of hosting/transcoding. Then I remembered I don’t have a site that needs video.![]()
Or make the problem even worse. You could have a channel with 10,000 videos and then someone comes along and uploads 3 copyright videos that get hard-struck and all 10,000 videos are gone.I'd like that for others reasons also, ie it would take care of copyright issues.
There is, for XF 2.1 and 2.2, built into 2.3:YouTube has become an annoyance with advertisements, embed blocking, required login, etc. I wish there were an easy way to host videos.
Something like this, as you only pay for what you use, would only be $24 more, provided bandwidth stays below 1TB, else it's $10 per TB more.21.5TB (5 TB used)
Go to admincpYouTube has become an annoyance with advertisements, embed blocking, required login, etc. I wish there were an easy way to host videos.
Unfortunately, no built-in feature or add-on can compress uploaded videos.Maybe there's a ready-made module that compresses videos for more compact storage, like Viber or WhatsApp do?
And this is sooooo bad(Unfortunately, no built-in feature or add-on can compress uploaded videos.
Thank you for such a detailed answer. It's difficult for me to create such scripts, but your idea works. So, my employees upload video reports during the day, and at night the server compresses them and archives them.IMO, the easiest way to do this without getting into crazy modding of attachments is to let the big file upload normally. set your limits accordingly.
each night, run a custom cron script that compresses each file from that day and use the exact same file name (compressed keeps the original file name) with ffmpeg like the details that can be found at a search like: https://www.google.com/search?q=ffmpeg+compress+video+from+php&rlz=1C1RXQR_enUS1127US1127&sca_esv=1b397ad422a0ef0a&biw=1536&bih=695&sxsrf=ANbL-n6LoWzyBnJem6L2p_sGjsovsteWZA:1770946074508&ei=Gn6OadbaHofZ5NoPttmW2AM&ved=2ahUKEwjWz7-dqNWSAxWHLFkFHbasBTsQ4dUDegQIBRAP&uact=5&oq=ffmpeg+compress+video+from+php&gs_lp=Egxnd3Mtd2l6LXNlcnAiHmZmbXBlZyBjb21wcmVzcyB2aWRlbyBmcm9tIHBocDIFECEYoAEyBRAhGKABMgUQIRigATIFECEYoAEyBRAhGKABMgUQIRifBUj3ClC2AlifCXABeAGQAQCYAXagAbUHqgEDNC41uAEDyAEA-AEBmAIKoALYB8ICChAAGLADGNYEGEfCAg0QABiABBiwAxhDGIoFwgIKEAAYgAQYFBiHAsICBRAAGIAEwgIGEAAYFhgewgIFECEYqwLCAgsQABiABBiGAxiKBcICBRAAGO8FmAMAiAYBkAYKkgcDMy43oAf7OLIHAzIuN7gH1QfCBwQwLjEwyAcWgAgA&sclient=gws-wiz-serp
execute the cron from xf once a day at 12:00:01 and make sure your script is set to get date(yesterday) only uploads.
use -y to allow overwrite.
if it misses one, no big deal. it's just big.
you'll need ffmpeg installed and allow php exec() on the server.
If you get a lot of videos a day, this will fail. it doesn't scale.
if you don't get any visitors at 12:00, the cron may miss something.
but if you get a handful of uploads a day, you can spend a few min in a cron updating/compressing them.
Things i didn't consider may be hashes or things that are built as a result of the file. might need to do some db updates here, i'm not sure. just spitballing a potential easy solution to do it 'lazy' after the fact.
if the script fails with -y, you may lose your source video.
There's far more elegant solutions, but this is quick and easy to buy space for vids that aren't really 'that important'.
This is an option for someone who sits at a PC. These video reports should be made by mechanics; they don't really like to figure things out.You could use the media gallery with FFmpeg and force transcoding of all videos.
And this add-on could make the file size even smaller.
Gives XFMG additional parameters for ffmpeg
- Yodrak
- ffmpeg shrink videos xfmg
- Add-ons [2.x]
Or compress those in posts after.
I have over 98,000 videos uploaded into threads/posts so I wanted to see if I can make any savings with ffmpeg, long story short, yes. I compressed 70,000 odd videos (mp4) and saved 154GB, for a 18% reduction of the total of 853GB. No loss in quality. So I'll leave it here. Probaly wouldn't hurt to chmod 600 the log file if you do it in /video.
Set your video path and run the bash script. Run it every now and then.
- will create a temp video file.
- if temp video file is smaller, replace original video.
- if bigger, delete temp video file.
- log result/check log on next run and...
- D.O.A.
- Replies: 3
- Forum: Server configuration and hosting
We use essential cookies to make this site work, and optional cookies to enhance your experience.