Share

Customizing ffmpeg and image magick parameters

Warning:

Local installations of Flow Production Tracking are no longer offered. This documentation is intended only for those with existing instances of Flow Production Tracking Enterprise Docker. Click here for a list of our current offerings.

We use ffmpeg and image magick in the transcoder worker container to create web playable artifacts from the media you upload to Flow Production Tracking. Starting from version 10.1.0 of the transcoder worker, you can now override the parameters used to generate the media.

How to override parameters

First thing first, all the default commands are assign in the Dockerfile to there respective environment variables.

Environment Variable Default value Description
TRANSCODER_TRANSCODE_CONVERT_PDF_TO_MOVIE convert %{src_file} -background white -alpha remove -quality 100 -density 150 -resize x1080 -colorspace YUV %{temp_jpgs}
TRANSCODER_TRANSCODE_FFMPEG_PDF_TO_MOVIE ffmpeg -hide_banner -loglevel warning -i %{temp_jpgs} -pix_fmt yuv420p -r 24 -vf 'scale=trunc((a*oh)/2)*2:720' %{movie_file}
TRANSCODER_TRANSCODE_CONVERT_PSD_TO_MOVIE convert %{src_file}[0] -background white -alpha remove -quality 100 -density 150 -resize x1080 -colorspace YUV %{temp_jpgs}
TRANSCODER_TRANSCODE_FFMPEG_PSD_TO_MOVIE ffmpeg -hide_banner -loglevel warning -i %{temp_jpgs} -pix_fmt yuv420p -r 24 -vf 'scale=trunc((a*oh)/2)*2:720' %{movie_file}
TRANSCODER_TRANSCODE_AUDIO_FROM_MP3 ffmpeg -hide_banner -loglevel warning -i %{src_file} -strict -2 -vn -c:a libvorbis -ar 44100 -f %{format} %{dest_file}
TRANSCODER_TRANSCODE_AUDIO_FROM_OTHER ffmpeg -hide_banner -loglevel warning -i %{src_file} -strict -2 -vn -c:a libvorbis -ar 44100 -f %{format} %{dest_file}.mp3 && ffmpeg -hide_banner -loglevel warning -i %{dest_file}.mp3 -strict experimental -codec:a libmp3lame -f mp3 %{dest_file} && rm %{dest_file}.mp3 Transcode the audio from another source than MP3
TRANSCODER_TRANSCODE_H264_VCODEC -vcodec libx264 -pix_fmt yuv420p -vf 'scale=trunc((a*oh)/2)*2:720' -g 30 -b:v 2000k -vprofile high -bf 0 -crf 26
TRANSCODER_TRANSCODE_H264_ACODEC -strict experimental -acodec aac -ab 160k -ac 2
TRANSCODER_TRANSCODE_WEBM_VCODEC -vcodec libvpx -vf 'scale=trunc((a*oh)/2)*2:720' -g 30 -b:v 2000k -speed 1 -quality realtime -cpu-used 0 -qmin 10 -qmax 42 Here only the "vcodec" flag is overridable
TRANSCODER_TRANSCODE_WEBM_VCODEC -acodec libvorbis -aq 60 -ac 2 -pix_fmt yuv420p Here only the "acodec" flag is overridable

If you want to override these default commands, all you have to do is redefine them in the docker-compose.yml file using the right syntax.

Example:

 transcoderworker:  
  environment:  
    TRANSCODER_TRANSCODE_CONVERT_PDF_TO_MOVIE: <your_command>  
    TRANSCODER_TRANSCODE_H264_VCODEC: <your_command>  
[...]  

To apply your changes, recreate the container.

 docker-compose up -d transcoderworker 

Documentation

ffmpeg: https://www.ffmpeg.org/ffmpeg.html

Was this information helpful?