diff --git a/transcoder/main.py b/transcoder/main.py index 7a0516f..793d40c 100644 --- a/transcoder/main.py +++ b/transcoder/main.py @@ -19,7 +19,7 @@ parser.add_argument( help='Override auto-detected multiplier for audio normalization.' ) parser.add_argument( - '--every_n_video_frames', type=int, default=1, + '--every_n_video_frames', type=int, default=2, help='Allows skipping frames of input video to lower effective output ' 'frame rate, which may give better quality for some videos.' ) @@ -31,6 +31,8 @@ def main(args): every_n_video_frames=args.every_n_video_frames, audio_normalization=args.audio_normalization) + print("Input frame rate = %f" % m.video.input_frame_rate) + max_bytes_out = 1024. * 1024 * args.max_output_mb if args.output: diff --git a/transcoder/video.py b/transcoder/video.py index 52a2104..795fb17 100644 --- a/transcoder/video.py +++ b/transcoder/video.py @@ -35,11 +35,11 @@ class Video: # TODO: possible to compute time offset for each frame instead? data = skvideo.io.ffprobe(self.filename)['video'] rate_data = data['@r_frame_rate'].split("/") # e.g. 12000/1001 - self._input_frame_rate = float( + self.input_frame_rate = float( rate_data[0]) / float(rate_data[1]) # type: float self.cycles_per_frame = ( - self.CLOCK_SPEED / self._input_frame_rate) # type: float + self.CLOCK_SPEED / self.input_frame_rate) # type: float self.frame_number = 0 # type: int # Initialize empty screen