Server: Support to LOAD/PLAY files with full filename

Created on 29 May 2019  路  14Comments  路  Source: CasparCG/server

We have the need to specify the full filename some times as we have the same filename with different extentions.

This feature exist in 2.0.7

CasparCG 2.2.0

loadbg 2-3 GC-G-LANG-VJ
202 LOADBG OK
loadbg 2-3 GC-G-LANG-VJ.mov
404 LOADBG FAILED

CasparCG 2.0.7

loadbg 2-3 GC-G-LANG-VJ
202 LOADBG OK
loadbg 2-3 GC-G-LANG-VJ.mov
202 LOADBG OK

typenhancement

Most helpful comment

@ducthiem90 Thanks for this PR.
I have almost same problem in image producer. I would like to ask you to make relative and absolute path support in image_producer.

I updated

1216

All 14 comments

i.e. you can use absolute path:
loadbg 2-3 "C://CasparCG//media//GC-G-LANG-VJ.mov"

Our need is not the full path, only the filename.
If there are two files with the same name, with different extensions, we need to be able to choose the correct one.

As the automation system is not aware of the directory structure of the different casparcg-servers

ex:
loadbg 2-3 GC-G-LANG-VJ.mov
loadbg 2-3 GC-G-LANG-VJ.dv
loadbg 2-3 GC-G-LANG-VJ.mxf
loadbg 2-3 GC-G-LANG-VJ

@thezulk, what's the need of having multiple files differentiated by the file extension?

@dotarmin why do you think that AMCP is involved? AMCP transfers everything to producer.

@ryci-us, why do you think that AMCP is involved? AMCP transfers everything to producer.

Wrong label and wrong issue, thanks for noticing this 馃憤

/Armin

I don't have permisson to push request. You can:

  1. Open file ffmpeg_producer.cpp
  2. Edit in probe_stem function
    for (auto it = boost::filesystem::directory_iterator(dir); it != boost::filesystem::directory_iterator(); ++it) { if (boost::iequals(it->path().stem().wstring(), stem2.filename().wstring()) && is_valid_file(it->path().wstring())) return it->path().wstring(); }

To
for (auto it = boost::filesystem::directory_iterator(dir); it != boost::filesystem::directory_iterator(); ++it) { if ((boost::iequals(it->path().stem().wstring(), stem2.filename().wstring()) || boost::iequals(it->path().filename().wstring(), stem2.filename().wstring())) && is_valid_file(it->path().wstring())) return it->path().wstring(); }

  1. Edit create_producer function
    if (!boost::contains(path, L"://")) { path = boost::filesystem::path(probe_stem(env::media_folder() + L"/" + path)).generic_wstring(); name += boost::filesystem::path(path).extension().wstring(); }

To

if (!boost::contains(path, L"://")) {
path = boost::filesystem::path(probe_stem(env::media_folder() + L"/" + path)).generic_wstring();
auto ext = boost::filesystem::path(path).extension().wstring();
if (!boost::iends_with(name, ext))
name += ext;
}

  1. Rebuild

I don't have permisson to push request. You can:

you can clone it, make a new local branch, edit code and send pull request, everything directly from website.

I don't have permisson to push request. You can:

you can clone it, make a new local branch, edit code and send pull request, everything directly from website.

Thanks.

@thezulk, what's the need of having multiple files differentiated by the file extension?

@dotarmin we have different formats for video clips and moving graphics, and sometimes the graphics department saves some moving graphics to both formats for redundancy. But if you use the video clip files as if they where motion graphics the alpha channel is solid and the screen goes black except for the moving graphic.

1216

Thanks @ducthiem90 for submitting a PR fixing this 馃憤

@ducthiem90 Thanks for this PR.
I have almost same problem in image producer. I would like to ask you to make relative and absolute path support in image_producer.

@ducthiem90 Thanks for this PR.
I have almost same problem in image producer. I would like to ask you to make relative and absolute path support in image_producer.

I updated

1216

This is in 2.2 now, and will be merged to 2.3 soon

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ronag picture ronag  路  5Comments

Julusian picture Julusian  路  5Comments

ronag picture ronag  路  7Comments

luckcfm picture luckcfm  路  5Comments

malmgrenola picture malmgrenola  路  5Comments