summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_examiner.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-08-02 22:24:05 +0200
committerCarl Hetherington <cth@carlh.net>2020-08-02 22:24:05 +0200
commitaf680761cf7c3e97660e8e55c68f42e90b026bf9 (patch)
tree3245845f36c214023e936fce104c49b91168685c /src/lib/ffmpeg_examiner.h
parenta0545f58b3e90d3c09fa376900eafd6f8fb531cb (diff)
Detect soft 2:3 pulldown (telecine) files and decode them at 23.976.
DVD rips from NTSC DVDs are sometimes (always?) encoded using soft 2:3 pulldown. The video frames are actually 23.976 but FFmpeg detects them as 29.97. With the current approach of the video decoder ignoring most PTSs and assuming a constant frame rate it is vital that the file contains the number of frames per second that the detected frame rate predicts. This fixes large sync errors with NTSC DVD rips (#1790).
Diffstat (limited to 'src/lib/ffmpeg_examiner.h')
-rw-r--r--src/lib/ffmpeg_examiner.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_examiner.h b/src/lib/ffmpeg_examiner.h
index 9ffb8421b..4f5110ca0 100644
--- a/src/lib/ffmpeg_examiner.h
+++ b/src/lib/ffmpeg_examiner.h
@@ -77,6 +77,10 @@ public:
return _rotation;
}
+ bool pulldown () const {
+ return _pulldown;
+ }
+
#ifdef DCPOMATIC_VARIANT_SWAROOP
boost::optional<std::string> id () const {
return _id;
@@ -84,7 +88,7 @@ public:
#endif
private:
- void video_packet (AVCodecContext *);
+ void video_packet (AVCodecContext *, std::string& temporal_reference);
void audio_packet (AVCodecContext *, boost::shared_ptr<FFmpegAudioStream>);
std::string stream_name (AVStream* s) const;
@@ -101,6 +105,7 @@ private:
bool _need_video_length;
boost::optional<double> _rotation;
+ bool _pulldown;
#ifdef DCPOMATIC_VARIANT_SWAROOP
boost::optional<std::string> _id;