Large Video Conversion - Time Out
Using Jamroom
Hi Derrick,
I looked at this and compared it to the original in modules/jrVideo-release-1.2.3/plugins/flv.php. This snippet is the important part.
flv -acodec libmp3lame -vf scale=640:-2 -ar 22050 -ab 128k -vcodec libx264 -preset ultrafast -qp 0
I'm certainly no expert, but from what I can gather this is what the changes do.
-vf scale=640:-2 was added - which is probably what solved the widescreen to 4:3 problem.
-preset veryfast to -preset ultrafast - probably gave most of your speed boost. It increases speed by sacrificing compression. So your files take up more space on the server.
-ar 44,100 to -ar 22050 halves the audio sample frequency. Probably most noticeable on the "crispness" of the hi hat and such, but I agree most people wouldn't tell the difference. However, I don't see that as being the big speed boost.
-qp 0 was added. A write up I found says constant quantizer mode. Generally should not be used, since CRF gives better quality at the same bitrate. CRF defaults to 23 when not specified which is a reasonable balance between speed/compression/quality.
===================================
I'm wondering if you are not making a sacrifice in quality to increase speed, due to a separate issue. If I am understanding correctly, video conversion is extremely resource intensive, so a core being used for it should be registering high usage on a performance monitor.
However, my sever guy tells me when I am converting, my CPU usage is minimal, and that is controlled by the script. So perhaps we should be looking for commands that allow the CPU core to work harder to decrease time, rather than sacrificing quality (or compression) to decrease time.
I see there exists a command called -threads and another called -cpu which would have an effect on how the CPU is utilized, but I'm not competent enough to suggest settings.
===================================
Another method to approach this (according to some write ups), might be to simply copy over some files (when they are compatible with the container). Not sure if or how that would work in JR.
Quote:
An MP4 file normally contains H.264 video and AAC audio, both of which are compatible with the FLV container. You could simply copy over the streams:
ffmpeg -i input.mp4 -c copy output.flv
Since you're copying the streams, this will be as close to instantaneous as you're going to get and will not result in any loss of quality.
updated by @ken-rich: 02/01/15 09:09:12AM