diff --git a/cuburn/output.py b/cuburn/output.py index 7701004..4862f11 100644 --- a/cuburn/output.py +++ b/cuburn/output.py @@ -1,5 +1,6 @@ import io import os +import sys import tempfile from cStringIO import StringIO from subprocess import Popen, PIPE @@ -273,8 +274,8 @@ class X264Output(Output, ClsMod): try: subp.stdin.write(buffer(buf)) except IOError, e: - print 'Exception while writing. Log:' - print subp.stderr.read() + print >> sys.stderr, 'Exception while writing. Log:' + print >> sys.stderr, subp.stderr.read() raise e def encode(self, buf): @@ -388,8 +389,8 @@ class VPxOutput(Output, ClsMod): try: subp.stdin.write(buffer(buf)) except IOError, e: - print 'Exception while writing. Log:' - print subp.stderr.read() + print >> sys.stderr, 'Exception while writing. Log:' + print >> sys.stderr, subp.stderr.read() raise e def encode(self, buf): diff --git a/cuburn/render.py b/cuburn/render.py index b3cf59a..e8747b7 100644 --- a/cuburn/render.py +++ b/cuburn/render.py @@ -352,7 +352,7 @@ class RenderManager(ClsMod): # Do a blocking sync to free up resources. This may slightly reduce # parallelism but makes it a whole heck of a lot easier to keep # using the computer while things render. - print 'Launches became blocking, synchronizing' + print >> sys.stderr, 'Launches became blocking, synchronizing' iter_stream_right.synchronize() # Make sure the other stream is done flushing before we start diff --git a/main.py b/main.py index e4f3e4a..c8029bd 100755 --- a/main.py +++ b/main.py @@ -74,8 +74,8 @@ def main(args, prof): if getattr(file_like, 'close', None): file_like.close() for key, val in log: - print '\n=== %s ===' % key - print val + print >> sys.stderr, '\n=== %s ===' % key + print >> sys.stderr, val evt = buf = next_evt = next_buf = None for idx, t in enumerate(list(times) + [None]): @@ -98,12 +98,12 @@ def main(args, prof): os.rename(args.rawfn + '.tmp', args.rawfn) except: import traceback - print 'Failed to write %s: %s' % ( + print >> sys.stderr, 'Failed to write %s: %s' % ( args.rawfn, traceback.format_exc()) - print '%s%s (%3d/%3d), %dms' % ( + print >> sys.stderr, '%s%s (%3d/%3d), %dms' % ( ('%d: ' % args.device) if args.device >= 0 else '', name, idx, len(times), last_render_time_ms) - sys.stdout.flush() + sys.stderr.flush() save(None)