diff --git a/process_podcast.py b/process_podcast.py index 90bcf6a..18a60e1 100755 --- a/process_podcast.py +++ b/process_podcast.py @@ -105,6 +105,7 @@ self.prepend_output_options(["-codec:a", "pcm_s16le", "-ac", "1", "-codec:v", "h264", + "-pix_fmt", "yuv420p", "-map", "[vconc]", "-map", "[anorm]"]) self.filters = [] @@ -389,8 +390,15 @@ def delete_temp_files(self): """Delete the temporary file(s) associated with the scene.""" + # Note: sometimes segments (especially frame segments) may + # share the same temporary file. Just ignore the file not + # found exception that occurs in these cases. if (self.input_file): - os.remove(self.input_file) + try: + os.remove(self.input_file) + except OSError as e: + if (e.errno != errno.ENOENT): + raise e super(FrameSegment, self).delete_temp_files() @@ -527,15 +535,6 @@ return datetime.timedelta(seconds=int(ss), milliseconds=int(ms)) -def read_segments_from_file(segments_file): - """Read a list of segment punch-in, punch-out point from a file.""" - segments = [] - with open(segments_file) as f: - for line in f: - segments.append(dict(zip(["in", "out"], line.split()))) - return segments - - def make_new_segment(type, filename, punch_in, punch_out, num): """Make a new segment instance of the correct class.""" log = logging.getLogger(PROGRAM)