int MWindow::enable_proxy()
{
+ int ret = 0;
if( edl->session->proxy_scale == 1 &&
edl->session->proxy_disabled_scale != 1 ) {
int new_scale = edl->session->proxy_disabled_scale;
Asset *asset = new Asset;
asset->format = FILE_FFMPEG;
asset->load_defaults(defaults, "PROXY_", 1, 1, 0, 0, 0);
- to_proxy(asset, new_scale);
+ ret = to_proxy(asset, new_scale);
asset->remove_user();
+ if( ret > 0 )
+ beep(2000., 1.5, 0.5);
}
return 1;
}
void MWindow::to_clip(EDL *edl, const char *txt, int all)
{
FileXML file;
- double start, end;
+ LocalSession *src = edl->local_session;
gui->lock_window("MWindow::to_clip 1");
- start = all ? 0 :
- edl->local_session->get_selectionstart();
- end = all ? edl->tracks->total_length() :
- edl->local_session->get_selectionend();
-
+ double start = all ? 0 :
+ src->inpoint_valid() ? src->get_inpoint() :
+ src->outpoint_valid() ? 0 : src->get_selectionstart();
+ double end = all ? edl->tracks->total_length() :
+ src->outpoint_valid() ? src->get_outpoint() :
+ src->inpoint_valid() ? edl->tracks->total_length() :
+ src->get_selectionend();
if( EQUIV(end, start) ) {
start = 0;
end = edl->tracks->total_length();
sfx = ep; ep += n;
}
for( char *cp=prxy; --n>=0; ++cp ) *sfx++ = *cp;
- const char *ext = format_asset->format == FILE_FFMPEG ?
- format_asset->fformat : File::get_tag(format_asset->format);
*ep++ = '.';
+ const char *ext = indexable->get_video_frames() < 0 ? "png" :
+ format_asset->format == FILE_FFMPEG ?
+ format_asset->fformat :
+ File::get_tag(format_asset->format);
while( *ext ) *ep++ = *ext++;
*ep = 0;
//printf("ProxyRender::to_proxy_path %d %s %s\n", __LINE__, new_path), asset->path);
Asset *ProxyRender::add_original(Indexable *idxbl, int new_scale)
{
if( !idxbl->have_video() ) return 0;
- if( idxbl->get_video_frames() <= 0 ) return 0;
// don't proxy proxies
if( strstr(idxbl->path,".proxy") ) return 0;
char new_path[BCTEXTLEN];
if( !proxy ) {
proxy = new Asset(new_path);
// new compression parameters
- proxy->copy_format(format_asset, 0);
+ int64_t video_length = idxbl->get_video_frames();
+ if( video_length < 0 ) {
+ proxy->format = FILE_PNG;
+ proxy->png_use_alpha = 1;
+ proxy->video_length = 1;
+ }
+ else {
+ proxy->copy_format(format_asset, 0);
+ proxy->video_length = video_length;
+ }
proxy->awindow_folder = AW_PROXY_FOLDER;
proxy->audio_data = 0;
proxy->video_data = 1;
if( proxy->height & 1 ) ++proxy->height;
proxy->actual_height = proxy->height;
proxy->frame_rate = idxbl->get_frame_rate();
- proxy->video_length = idxbl->get_video_frames();
edl_assets->append(proxy);
}
proxy->add_user();
VFrame src_frame(src_w,src_h, edl->session->color_model);
OverlayFrame scaler(processors);
+ int64_t video_length = orig->get_video_frames();
+ if( video_length < 0 ) video_length = 1;
- for( int64_t i=0, length=orig->get_video_frames(); i<length &&
+ for( int64_t i=0; i<video_length &&
!proxy_render->failed && !proxy_render->is_canceled(); ++i ) {
if( orig->is_asset ) {
src_file->set_video_position(i, 0);