Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
add option to skip x264 progress in log file
Browse files Browse the repository at this point in the history
  • Loading branch information
SAPikachu committed Mar 15, 2011
1 parent 2bb277e commit 1cbadab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion encx264_targets.py.sample
@@ -1,10 +1,11 @@

x264_path = 'x264.exe'
x264_path = r'x264.exe'


# possible values: idle, below_normal, normal, above_normal, high
default_priority = 'below_normal'

log_progress = False

common_params = "--threads auto --thread-input {tc} --sar {sar} "+ \
"--ref {ref} --aq-strength 1.5 "+ \
Expand Down
2 changes: 2 additions & 0 deletions impls/encx264_defaults.py
Expand Up @@ -5,3 +5,5 @@

# possible values: idle, below_normal, normal, above_normal, high
default_priority = 'below_normal'

log_progress = False
8 changes: 6 additions & 2 deletions impls/encx264_impl.py
Expand Up @@ -144,10 +144,12 @@ def encode_impl():
creationflags = priority_value,
universal_newlines = True)
for l in p.stdout:
log.write(l)
if l.startswith("["):
if log_progress:
log.write(l)
print(l.strip().ljust(78),end='\r')
else:
log.write(l)
print(l,end='')
if bitrate == -1:
m = re.search("kb\/s\:([0-9]+)",l)
Expand Down Expand Up @@ -204,10 +206,12 @@ def encode_impl():


for l in p.stdout:
log.write(l)
if l.startswith("["):
if log_progress:
log.write(l)
print(l.strip().ljust(78),end='\r')
else:
log.write(l)
print(l,end='')

print("")
Expand Down

0 comments on commit 1cbadab

Please sign in to comment.