You are not logged in.

#1 2014-01-27 06:35:06

DaBungalow
Member
Registered: 2013-02-09
Posts: 30

Script for batch transcoding with FFMPEG

Hello fellow Archers,

I just thought I would let you all know that I am building and maintaining a script to recursively transcode/remux files using FFMpeg and MediaInfo.

The git repo is https://github.com/DaBungalow/PyTranscode.  I admit that the feature set is VERY limited, but I plan to add support for configuration and probably a GUI on down the line.  I am also considering adding tagging with TMDB, TheTVDB, and IMDB.  Any help would be greatly appreciated.

Let me know what you think.

Offline

#2 2014-01-27 07:14:24

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Script for batch transcoding with FFMPEG

from the github page:

I would ESPECIALLY keep all music files AWAY from this script.

ehm, what?

Last edited by Rasi (2014-01-27 07:14:52)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#3 2014-01-28 21:57:37

DaBungalow
Member
Registered: 2013-02-09
Posts: 30

Re: Script for batch transcoding with FFMPEG

I guess what I meant to say was that you shouldn't have any music files in the directory you want to transcode.  I think I wrote that line at 11 o'clock at night.  smile

Offline

#4 2014-01-29 19:46:54

DrZaius
Member
Registered: 2008-01-02
Posts: 193

Re: Script for batch transcoding with FFMPEG

VID_SETTINGS = "-vcodec", "libx264", "-crf", "15", "-preset", "slow"

Why 15? ~18 should be good enough for most sources for most people.

I recommend adding "-pix_fmt yuv420p" or "-vf format=yuv420p" so the output will be playable by non-FFmpeg based players. Otherwise, depending on your input, ffmpeg may attempt to minimize chroma subsampling; potentially resulting in an output that will be unplayable in players such as QuickTime.

If the video frame size is non-divisable by 2, then the encoding with libx264 will fail. You can use the scale video filter to slightly scale the video, if necessary, to prevent this. Probably several examples out there in the wild and also see FFmpeg Expression Evaluation.

AUDIO_SETTINGS = "-acodec", "copy",

Is there only audio re-muxing (no re-encoding)? Muxing will fail if the audio format is not accepted by the MP4 container format.

Last edited by DrZaius (2014-01-29 19:48:20)

Offline

#5 2014-01-30 08:16:08

DaBungalow
Member
Registered: 2013-02-09
Posts: 30

Re: Script for batch transcoding with FFMPEG

DrZaius wrote:
VID_SETTINGS = "-vcodec", "libx264", "-crf", "15", "-preset", "slow"

Why 15? ~18 should be good enough for most sources for most people.

I recommend adding "-pix_fmt yuv420p" or "-vf format=yuv420p" so the output will be playable by non-FFmpeg based players. Otherwise, depending on your input, ffmpeg may attempt to minimize chroma subsampling; potentially resulting in an output that will be unplayable in players such as QuickTime.

If the video frame size is non-divisable by 2, then the encoding with libx264 will fail. You can use the scale video filter to slightly scale the video, if necessary, to prevent this. Probably several examples out there in the wild and also see FFmpeg Expression Evaluation.

AUDIO_SETTINGS = "-acodec", "copy",

Is there only audio re-muxing (no re-encoding)? Muxing will fail if the audio format is not accepted by the MP4 container format.

Currently, these settings are ones that I personally use. I am attempting the best way to allow script configuration.  This should allow me to add support for any settings that a user would like. This is the first script that I have ever written to totally so I am still working on figuring out how to design this.

Offline

#6 2014-01-31 02:59:23

DaBungalow
Member
Registered: 2013-02-09
Posts: 30

Re: Script for batch transcoding with FFMPEG

DrZaius wrote:
VID_SETTINGS = "-vcodec", "libx264", "-crf", "15", "-preset", "slow"

Why 15? ~18 should be good enough for most sources for most people.

I recommend adding "-pix_fmt yuv420p" or "-vf format=yuv420p" so the output will be playable by non-FFmpeg based players. Otherwise, depending on your input, ffmpeg may attempt to minimize chroma subsampling; potentially resulting in an output that will be unplayable in players such as QuickTime.

If the video frame size is non-divisable by 2, then the encoding with libx264 will fail. You can use the scale video filter to slightly scale the video, if necessary, to prevent this. Probably several examples out there in the wild and also see FFmpeg Expression Evaluation.

AUDIO_SETTINGS = "-acodec", "copy",

Is there only audio re-muxing (no re-encoding)? Muxing will fail if the audio format is not accepted by the MP4 container format.

Offline

Board footer

Powered by FluxBB