8 Replies Latest reply on Jul 11, 2016 3:36 AM by Vamitul

    MoviePosterTypes.FROM_MOVIE

    Vamitul Level 4

      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.

        • 1. Re: MoviePosterTypes.FROM_MOVIE
          Trevorׅ Adobe Community Professional

          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

          1 person found this helpful
          • 2. Re: MoviePosterTypes.FROM_MOVIE
            Vamitul Level 4

            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.

            • 3. Re: MoviePosterTypes.FROM_MOVIE
              Pickory Level 3

              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,

              • 4. Re: MoviePosterTypes.FROM_MOVIE
                Trevorׅ Adobe Community Professional

                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.

                • 5. Re: MoviePosterTypes.FROM_MOVIE
                  Trevorׅ Adobe Community Professional

                  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

                  • 6. Re: MoviePosterTypes.FROM_MOVIE
                    Trevorׅ Adobe Community Professional

                    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.

                    • 7. Re: MoviePosterTypes.FROM_MOVIE
                      Pickory Level 3

                      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.

                      1 person found this helpful
                      • 8. Re: MoviePosterTypes.FROM_MOVIE
                        Vamitul Level 4

                        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.