31 #ifndef OPENSHOT_FFMPEG_READER_H 32 #define OPENSHOT_FFMPEG_READER_H 63 int is_near(
AudioLocation location,
int samples_per_frame,
int amount);
97 AVFormatContext *pFormatCtx;
98 int i, videoStream, audioStream;
99 AVCodecContext *pCodecCtx, *aCodecCtx;
100 AVStream *pStream, *aStream;
104 bool is_duration_known;
105 bool check_interlace;
107 bool has_missing_frames;
111 map<AVPicture*, AVPicture*> frames;
112 map<long int, long int> processing_video_frames;
113 multimap<long int, long int> processing_audio_frames;
114 map<long int, long int> processed_video_frames;
115 map<long int, long int> processed_audio_frames;
116 multimap<long int, long int> missing_video_frames;
117 multimap<long int, long int> missing_video_frames_source;
118 multimap<long int, long int> missing_audio_frames;
119 multimap<long int, long int> missing_audio_frames_source;
120 multimap<long int, long int> duplicate_video_frames;
121 map<long int, int> checked_frames;
128 long int pts_counter;
129 long int num_packets_since_video_frame;
130 long int num_checks_since_final;
131 tr1::shared_ptr<Frame> last_video_frame;
134 long int seeking_pts;
135 long int seeking_frame;
138 long int seek_audio_frame_found;
139 long int seek_video_frame_found;
141 long int audio_pts_offset;
142 long int video_pts_offset;
144 long int largest_frame_processed;
145 long int current_video_frame;
151 bool CheckSeek(
bool is_video);
154 bool CheckMissingFrame(
long int requested_frame);
157 void CheckWorkingFrames(
bool end_of_stream,
long int requested_frame);
160 void convert_image(
long int current_frame, AVPicture *copyFrame,
int width,
int height,
PixelFormat pix_fmt);
163 long int ConvertFrameToAudioPTS(
long int frame_number);
166 long int ConvertFrameToVideoPTS(
long int frame_number);
169 long int ConvertVideoPTStoFrame(
long int pts);
172 tr1::shared_ptr<Frame> CreateFrame(
long int requested_frame);
184 long int GetSmallestVideoFrame();
187 long int GetSmallestAudioFrame();
190 long int GetVideoPTS();
193 bool IsPartialFrame(
long int requested_frame);
196 void ProcessVideoPacket(
long int requested_frame);
199 void ProcessAudioPacket(
long int requested_frame,
long int target_frame,
int starting_sample);
202 tr1::shared_ptr<Frame> ReadStream(
long int requested_frame);
205 void RemoveAVFrame(AVPicture*);
208 void RemoveAVPacket(AVPacket*);
211 void Seek(
long int requested_frame)
throw(
TooManySeeks);
214 void UpdatePTSOffset(
bool is_video);
217 void UpdateAudioInfo();
220 void UpdateVideoInfo();
258 string Name() {
return "FFmpegReader"; };
263 Json::Value JsonValue();
264 void SetJsonValue(Json::Value root)
throw(
InvalidFile);
Header file for ReaderBase class.
Header file for OpenMPUtilities (set some common macros)
CacheMemory * GetCache()
Get the cache object used by this reader.
This abstract class is the base class, used by all readers in libopenshot.
Exception when a reader is closed, and a frame is requested.
Header file for CacheMemory class.
bool IsOpen()
Determine if reader is open or closed.
Header file for all Exception classes.
This class uses the FFmpeg libraries, to open video files and audio files, and return openshot::Frame...
Exception when no valid codec is found for a file.
Exception when no streams are found in the file.
Exception for files that can not be found or opened.
Exception for frames that are out of bounds.
This namespace is the default namespace for all code in the openshot library.
Exception for invalid JSON.
This struct holds the associated video frame and starting sample # for an audio packet.
CacheMemory final_cache
Final cache object used to hold final frames.
string Name()
Return the type name of the class.
Header file for FFmpegUtilities.
This class is a memory-based cache manager for Frame objects.
Exception when too many seek attempts happen.