X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ffileffmpeg.C;h=99fa71193af683c2df5194f7f67911ccf2bfeea9;hb=a985e771ecfb00f01c6405c7aa4fb958a780e558;hp=33f3fa478d4a13d0f2449601a90aa9c950ad0e4b;hpb=24db15d85f2e4c986ff91f992e815747c55948f3;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.C b/cinelerra-5.1/cinelerra/fileffmpeg.C index 33f3fa47..99fa7119 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.C +++ b/cinelerra-5.1/cinelerra/fileffmpeg.C @@ -240,6 +240,7 @@ int FileFFMPEG::open_file(int rd, int wr) 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 ) { @@ -253,6 +254,7 @@ int FileFFMPEG::open_file(int rd, int wr) (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); @@ -365,6 +367,21 @@ int FileFFMPEG::get_best_colormodel(Asset *asset, int driver) 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; iget_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) {