Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: where can we make changes to ffmpeg conversions for slow medium or fast processing ? #2941

Open
spirogg opened this issue Oct 20, 2020 · 3 comments
Labels

Comments

@spirogg
Copy link

spirogg commented Oct 20, 2020

Important

Please follow this template!


What's happened?

  • I want to be able to change the processing speed of ffmpeg conversions

  • I forgot in what folder/file I can make updates to change the conversion of uploaded ffmpeg videos to fast medium slow etc. ?

  • Also it would be nice to have a admincp feature to change the conversion speed slow make a better picture, medium ok picture, fast so so picture but converts really fast
    *especially for website platforms that don't have super servers

  • the users will still be able to convert the video faster and won't be so slow

  • admins will be happy cause they won't loose their users because of slower servers than the super servers.

  • plus will help iOS and Android apps to speed up conversion of videos if server is not that good so users won;t have to wait forever to view the videos.

  • also itwould be nice to be able to convert to different ffpmeg ratios and have video player play them and have user options: auto 240 360 480 720 1080 etc.

  • so if admin wants to convert only to 360 he select 360 if he want to choose 240 & 360 he selects them

  • or only 360 480 720 he can choose those ratios or all 240 360 480 720 1080 etc.. this would be in the video app settings it would be nice to have for videos app especially for v5 newest coming phpfox platform :)

I THINK THIS IS GOOD IDEA PLEASE for v5 phpfox every website that you can upload videos has the player and the features especially in 2020 andyear 2021 please make this avail in new video app feature

I make a feature request here PHPfox-Official/phpfox-v4-feature-requests#995

but still need the answer for where i can change the ffmpeg conversion for now

thanks Spiro
...

phpFox version

(Example: phpFox 4.6.0)
4.8.1
...

Screenshots

...

@harrison05
Copy link
Contributor

Hi @spirogg

Speed of FFmpeg conversions based on the Cronjob cycle on your server. Because conversation only executes when cron run.

Regards.

@harrison05 harrison05 added the Q&A label Oct 21, 2020
@spirogg
Copy link
Author

spirogg commented Oct 21, 2020

@harrison05 please see this encoding is faster with certain FMPEG libx264
example CRFs 18 to 27, and presets below

you can speed up the encoding using crf and presets when using ffmpeg

this will speed up the time the video processes and shows up on the website.

Presets:

ultrafast
superfast
veryfast
faster
fast
medium
slow
slower
veryslow

and CRF numbers you can control the speed and quality

example in this link shows

  • FMPEG libx264 encodes 2 min video, CRFs 18 to 27, all presets except placebo, encode times and file sizes

https://gist.github.com/mattst/2a0ff8de12e0fedb2ad72ccf7131bf71#file-testcliptwomindata-csv

so utrafast conversion time is 13.91 seconds and that should show pretty fast to the user
then fast preset takes 79.71 seconds to conversion the same video
these are examples, so depending on the preset and CRF you can control the quality Speed and File size of your conversion.

Example:

Choose an x264 encoding preset
These presets affect the encoding speed. Using a slower preset gives you better compression, or quality per filesize, whereas faster presets give you worse compression. In general, you should just use the preset you can afford to wait for. Presets can be ultrafast, superfast, veryfast, faster, fast, medium (default), slow and veryslow. Here's an example:

ffmpeg -i input.mp4 -c:v libx264 -preset slow output.mp4

Encode lossless video
This is possible by specifying a CRF of 0, so simply use -crf 0:

ffmpeg -i input.mp4 -c:v libx264 -crf 0 output.mp4

ALSO SEE: https://trac.ffmpeg.org/wiki/Encode/H.264

that is what I need to know where the ffmpeg file in phpfox is, to be able to play with it to see the difference on our conversion speed quality and file size of the uploaded videos

  • if you can tell me what folder/file does the conversion

thanks

Spiro

@spirogg
Copy link
Author

spirogg commented Oct 21, 2020

@harrison05
**I found an older post this is the area I was looking for **

  • see also preset fast below in the file Encode,php this is the file i was looking for

here we can change Presets:

ultrafast
superfast
veryfast
faster
fast
medium
slow
slower
veryslow

this is Now
/public_html/PF.Site/Apps/core-videos/Job/Encode.php
EDIT
/public_html/PF.Site/Apps/core-videos/Job/Encode.php you will find this around = line 140 thru 152

        $videoCommand .= '-vcodec libx264' . ' '
            . '-acodec aac' . ' '
            . '-strict experimental' . ' '
            . '-preset fast' . ' '
            . '-f mp4' . ' ';

EDIT
/public_html/PF.Site/Apps/core-videos/Job/Encode.php you will find this around = line 148 thru 152

$videoCommand .= '-vcodec libx264' . ' '
. '-acodec aac' . ' '
. '-strict experimental' . ' '
. '-preset veryfast' . ' '
. '-f mp4' . ' ';

we can always use copy audio to not encode again

$videoCommand .= '-vcodec libx264' . ' '
            . '-c:a copy' . ' '
            . '-strict experimental' . ' '
            . '-preset veryfast' . ' '
            . '-f mp4' . ' ';

thanks,

Spiro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants