if( !ff || !asset->video_data ) return 1;
asset->width = ff->ff_video_width(vstream);
asset->height = ff->ff_video_height(vstream);
- asset->video_length = ff->ff_video_frames(vstream);
if( (asset->video_length = ff->ff_video_frames(vstream)) < 2 )
asset->video_length = asset->video_length < 0 ? 0 : -1;
asset->frame_rate = ff->ff_frame_rate(vstream);
asset->channels = audio_channels;
asset->sample_rate = ff->ff_sample_rate(0);
asset->audio_length = ff->ff_audio_samples(0);
+ strcpy(asset->acodec, ff->ff_audio_format(0));
}
int video_layers = ff->ff_total_video_layers();
if( video_layers > 0 ) {
(asset->video_length = ff->ff_video_frames(0)) < 2 )
asset->video_length = asset->video_length < 0 ? 0 : -1;
if( !asset->frame_rate ) asset->frame_rate = ff->ff_frame_rate(0);
+ strcpy(asset->vcodec, ff->ff_video_format(0));
}
IndexState *index_state = asset->index_state;
index_state->read_markers(file->preferences->index_directory, asset->path);
return BC_RGB888;
}
+int FileFFMPEG::can_render(const char *fformat, const char *type)
+{
+ FileSystem fs;
+ char option_path[BCTEXTLEN];
+ FFMPEG::set_option_path(option_path, type);
+ fs.update(option_path);
+ int total_files = fs.total_files();
+ for( int i=0; i<total_files; ++i ) {
+ const char *name = fs.get_entry(i)->get_name();
+ const char *ext = strrchr(name,'.');
+ if( !ext ) continue;
+ if( !strcmp(fformat, ++ext) ) return 1;
+ }
+ return 0;
+}
int FileFFMPEG::get_ff_option(const char *nm, const char *options, char *value)
{
if( dupl ) continue;
FFOptions_Opt *fopt = new FFOptions_Opt(this, opt, opt->name);
append(fopt);
+ AVDictionaryEntry *elem = av_dict_get(win->dialog->ff_opts,
+ opt->name, 0, AV_DICT_IGNORE_SUFFIX);
+ if( elem && elem->value ) fopt->set(elem->value);
char val[BCTEXTLEN], *vp = fopt->get(val, sizeof(val));
fopt->item_value->update(vp);
}