• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

MoviePosterTypes.FROM_MOVIE

Advisor ,
Jul 07, 2016 Jul 07, 2016

Copy link to clipboard

Copied

Hi guys,

I'm running into some very strange issues when trying to use MoviePosterTypes.FROM_MOVIE in a very complex script. Most of the times the poster frames "jump back" to "None", and rarely all the movies in the document (regardless of the setting) get the same "from movie" image as a poster.

Moreso, in Indesign Server i get "Error: The poster image could not be changed to the requested image."

After fiddling around more my best guess is that the "from movie" poster frame is generated using the indesign embedded Flash engine (which also causes some crashes on mac, it seems) during some draw/redraw event, on desktop, and since the script is very intensive, that event doesn't fire properly. On Indesign Server, such drawing events don't exists, so it throws that error.

Has anyone ran into such a problem, or has any ideas?

Thanks,

V.

TOPICS
Scripting

Views

448

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jul 08, 2016 Jul 08, 2016

Copy link to clipboard

Copied

Hi Valid

how about sending the videos first to ffmpeg to extract the frames and then import that fame as an image.

Don't know if that will fit your work flow, just sharing a thought.

Trevor

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 08, 2016 Jul 08, 2016

Copy link to clipboard

Copied

Hi Trevor,

I've used the ffdmpeg trick for a few smaller projects, but i'm reluctant to use it in the main product, as it adds yet another dependency we have no control over.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 08, 2016 Jul 08, 2016

Copy link to clipboard

Copied

It might be linked to this.

From the SDK.

================

  /** A bool16 flag; when kTrue, indicates that the poster is a custom image created from the media

      content. If this flag is not set, and enPosterIsFromMedia is set, then the poster is the

  default image taken from the media content. For movies, the default image is usually the

  first frame, or it could be an image designated as the poster by the media file format (the

  QuickTime format, for example, supports a poster atom). Note that this flag can be set only

  if enPosterIsFromMedia is also set. */

  enCustomPosterFromMedia = kMediaPrefix + 3,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jul 10, 2016 Jul 10, 2016

Copy link to clipboard

Copied

I just saw this recent post [jsx] app.doScript synchronous / callback / event?  which would provide some form of solution but not a satisfactory one. I thought I'd mention it before someone else brings it up.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jul 08, 2016 Jul 08, 2016

Copy link to clipboard

Copied

Yep, you have a problem there, you can package a static binary of ffmpeg, imageMagik or whatever so it doesn't change on you but  when apple releases it Everest OS and it stops working then your stuck. That said some of these applications have a large enough user group that there likely to be patched quickly.

Can't comment on Pickory's SDK post.

Let us know if and what solution you come up with.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jul 10, 2016 Jul 10, 2016

Copy link to clipboard

Copied

Hi again.

I had another idea. It could be that the image you want to extract is included in the videos metadata. If not then don't bother reading further but if yes. you can probably use adobes metadata api to extract it. It's well documented (3 volumes) and easy to use.

The problem is converting the base 64 into binary. The jsx engine is far to slow to handle this so that leaves you with 2 options.

1) Send the string to the CEP engine and get it to send back the the binary. This is very quick to execute and easy to implement. I used this method for an InDesign spread preview extension I made Pickory​ probably remembers the thread. In the end I did go for it and pulled it off. I can't remember if ID Server can communicate with CEP but I think that it can.

2) Compile your on c++ decoder and call on that. It shouldn't be that tough there's enough examples of c++ base 64 decoders floating around for you to compile one. You would just need to learn how to send and receive the result.

Pickory​ can you post here an example of how to do that sort of thing.

Lets say we have a simple c++ decoder something like.

#include <iostream>

#include <string>

#include <sstream>

using namespace std;

int main(int argc, char* argv[])

{

    if (argc < 2) {

        std::cerr << argv[0] << " int" << std::endl;

        return 1;

    }

    int myResult;

    string myArg = argv[1];

    stringstream myStream(myArg);

    myStream >> myResult;

    myResult = myResult * 2 + 3;

    std::cout << myResult;

    return 0;

}

Now lets say that the complied code is stored as "Users/Trevor/CPlusPlus/times2plus3" so from terminal I would type in Users/Trevor/CPlusPlus/times2plus3 10 and terminal would spit 23 back a me. That's fine I'm used to being spat at.

How would I using just extended script (and not CEP with it's nodesjs capabilities) be able to call my decoder with some argument so I can process it.

Something like.

// This is quasi code and is not going to work as is so don't bother executing it!

Throw to times2plus3 10;

n = catch times2plus3's spit;

alert(n);

I would think that there should be 2 approaches, a) get jsx to execute times2plus3 and retrieve the result and b) include the times2plus3 in the jsx script and be able to call it as a function within the jsx.

This knowledge would be very helpful to fill some of jsx major gaps without resorting to plugin stuff or relying on CEP.

A bit off the topic but the answer could solve Valid's problem.

Regards to all,

Trevor

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 10, 2016 Jul 10, 2016

Copy link to clipboard

Copied

I suspect the problem is enPosterIsFromMedia is not set by default. There is a miss match between the scripting side and what InDesign now expects, previously, enCustomPosterFromMedia was sufficient and could be set from scripting by using MoviePosterTypes.FROM_MOVIE.

I don't have access to ID server, so I can not test this.

All the best.

P.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 11, 2016 Jul 11, 2016

Copy link to clipboard

Copied

LATEST

Thank you all.

Trevor, most of the movies won't have a metadata poster image, so from the get go it's not a solution for me. Besides, the application must work bot on Win and Mac, in all versions from CS6 to CC2015, both on Indesign Desktop and Server. Thus the reluctance to use any external tools, and that also means that using CEP is no go, as it is not supported on Server.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines