Merge branch 'feat-ffmpeg' into develop
Switched to encoding with ffmpeg 0.10
This commit is contained in:
commit
2a7bae6e1c
2 changed files with 12 additions and 10 deletions
3
README
3
README
|
@ -6,8 +6,7 @@ PREQUISITES:
|
||||||
The following components are needed:
|
The following components are needed:
|
||||||
|
|
||||||
* mplayer
|
* mplayer
|
||||||
* mencoder
|
* ffmpeg (tested with version 0.10, older versions may or may not work)
|
||||||
* MP4Box (from gpac package)
|
|
||||||
* python
|
* python
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
|
|
|
@ -123,13 +123,13 @@ def calculate(input):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
s = re.compile("^ID_VIDEO_ASPECT=(.*)$", re.M)
|
s = re.compile("^ID_VIDEO_ASPECT=(.*)$", re.M)
|
||||||
m = s.search(mp[0])
|
m = s.search(bytes.decode(mp[0]))
|
||||||
orig_aspect = m.group(1)
|
orig_aspect = m.group(1)
|
||||||
s = re.compile("^ID_VIDEO_WIDTH=(.*)$", re.M)
|
s = re.compile("^ID_VIDEO_WIDTH=(.*)$", re.M)
|
||||||
m = s.search(mp[0])
|
m = s.search(bytes.decode(mp[0]))
|
||||||
orig_width = m.group(1)
|
orig_width = m.group(1)
|
||||||
s = re.compile("^ID_VIDEO_HEIGHT=(.*)$", re.M)
|
s = re.compile("^ID_VIDEO_HEIGHT=(.*)$", re.M)
|
||||||
m = s.search(mp[0])
|
m = s.search(bytes.decode(mp[0]))
|
||||||
orig_height = m.group(1)
|
orig_height = m.group(1)
|
||||||
except:
|
except:
|
||||||
print("Error: unable to identify source video, exiting!")
|
print("Error: unable to identify source video, exiting!")
|
||||||
|
@ -195,13 +195,16 @@ def convert(input, output, res, abitrate, vbitrate, threads, mpopts):
|
||||||
"-f", "yuv4mpegpipe",
|
"-f", "yuv4mpegpipe",
|
||||||
"-i", vfifo,
|
"-i", vfifo,
|
||||||
"-i", afifo,
|
"-i", afifo,
|
||||||
"-acodec", "libfaac",
|
"-acodec", "aac",
|
||||||
|
"-strict", "experimental",
|
||||||
"-ac", "2",
|
"-ac", "2",
|
||||||
"-ab", str(abitrate),
|
"-ab", str(abitrate),
|
||||||
"-ar", "22500",
|
"-ar", "44100",
|
||||||
"-vcodec", "libx264",
|
"-vcodec", "libx264",
|
||||||
"-threads", str(threads),
|
"-threads", str(threads),
|
||||||
"-b", str(vbitrate),
|
"-vprofile", "baseline",
|
||||||
|
"-tune", "animation",
|
||||||
|
"-b:v", str(vbitrate),
|
||||||
"-flags", "+loop", "-cmp", "+chroma",
|
"-flags", "+loop", "-cmp", "+chroma",
|
||||||
"-partitions", "+parti4x4+partp8x8+partb8x8",
|
"-partitions", "+parti4x4+partp8x8+partb8x8",
|
||||||
"-subq", "5", "-trellis", "1", "-refs", "1",
|
"-subq", "5", "-trellis", "1", "-refs", "1",
|
||||||
|
@ -211,7 +214,7 @@ def convert(input, output, res, abitrate, vbitrate, threads, mpopts):
|
||||||
"-bt", "640", "-bufsize", "10M", "-maxrate", "1000000",
|
"-bt", "640", "-bufsize", "10M", "-maxrate", "1000000",
|
||||||
"-rc_eq", "'blurCplx^(1-qComp)'",
|
"-rc_eq", "'blurCplx^(1-qComp)'",
|
||||||
"-qcomp", "0.62", "-qmin", "10", "-qmax", "51",
|
"-qcomp", "0.62", "-qmin", "10", "-qmax", "51",
|
||||||
"-level", "30", "-f", "mp4",
|
"-x264opts", "level=3.0", "-f", "mp4",
|
||||||
output ]
|
output ]
|
||||||
|
|
||||||
# Start mplayer decoding processes in background
|
# Start mplayer decoding processes in background
|
||||||
|
|
Loading…
Reference in a new issue