It is currently 28 Mar 2017, 11:03



from 'too big image sequence' to 'video' using templates

Videos, graphics, Flash templates – how to create and play them using CasparCG

Moderators: Macey, Jonas Hummelstrand, didikunz

from 'too big image sequence' to 'video' using templates

Postby dlp » 27 Aug 2016, 14:20

Hi guys,

(french people wrting in english... sorry)

i'm developping a software to produce graphics for broadcast sports. Everything is ok for now except the following problem :

Most of my templates works well but some of my templates are using too big image sequences (for example : 200 full hd PNG files) to produce the background of dynamic texts. I say 'too big' because final result is not smooth anymore.

I just managed to produce some quicktime movie instead of using the image sequences. This movies contains alpha channel and that's cool.

BUT

(A) if i put the movie in a channel video layer with LOADBG (or LOAD) and the template (without image sequence) in a CG layer, back of text are black... How can i get rid of this ? ... (i've seen that a blur filter should resolve this but i can't find where it is)

(B) Let's say that i want to put, at the same time, a first template in CG layer 20 and a second one in cg layer 40, both without image sequences... AND put a different .mov file for each... one behind CG layer 20 and the other between CG layer 20 and CG layer 40... Is it possible ?

Chris
dlp
 
Posts: 7
Joined: 27 Aug 2016, 13:43

Re: from 'too big image sequence' to 'video' using templates

Postby thos-berlin » 27 Aug 2016, 16:23

Are your templates made with Flash ?
User avatar
thos-berlin
 
Posts: 302
Joined: 13 Apr 2013, 14:50

Re: from 'too big image sequence' to 'video' using templates

Postby dlp » 27 Aug 2016, 18:00

Yes ! with Adobe Flash Pro CS6.
dlp
 
Posts: 7
Joined: 27 Aug 2016, 13:43

Re: from 'too big image sequence' to 'video' using templates

Postby didikunz » 27 Aug 2016, 18:45

There is a good trick to do that very elegant. My clients always set to fields on every template, that get's fired: channel and layer. There I give the channel and layer where the template is running. So that I can play the background videoclip from WITHIN the template by connecting back to Caspar (it's always localhost) and play the video on a layer below.

There is this ActionScript file: https://dl.dropboxusercontent.com/u/13685023/CustomSocket.as that someone in the forum shared long time ago. That must be in the same folder as your .fla and .as file durring compile. Then you can write code like that:

Code: Select all
package
{
   import flash.display.MovieClip;
   import se.svt.caspar.ICommunicationManager;
   import se.svt.caspar.IRegisteredDataSharer;
   import se.svt.caspar.template.CasparTemplate;
   //other imports go here

   public class Test extends CasparTemplate
   {
      //The socket neccessary to connect to Caspar
      private var mysocket:CustomSocket = new CustomSocket("localhost", 5250);
      //The variables to hold channel and layer
      private var channel:int = 1;
      private var videoLayer:int = 0;
            
      private var timer:Timer = new Timer(100);
      private var timerMode:int = 0;
      
      private function Tick(event:TimerEvent):void
      {
         timer.stop();
         
           switch (timerMode) {
            case 0:      //stop the video
               mysocket.writeln("STOP " + channel + "-" + videoLayer);

               timer.delay = 100;
               timerMode = 1;
               timer.start();
               break;
                              
            case 1:      //kill the template
               removeTemplate();
         }
      }

      override public function postInitialize():void
      {
         //Initialize the timer
         timer.addEventListener(TimerEvent.TIMER, Tick);
      }
      
      override public function Play():void
      {
         //Play the clip
         mysocket.writeln("PLAY " + channel + "-" + videoLayer + " NameOfVideoclip");
         mysocket.flush();
         
         //In-animations go here
      }

      override public function Stop():void
      {
         //Out-animation go here
         
         //Fire the timer with enough delay, so that the animations have finished.
         timerMode = 0;
         timer.delay = 500;   //In miliseconds
         timer.start();
      }
      
      override public function SetData(xmlData:XML):void
      {         

         for each (var element:XML in xmlData.children())
         {
           if (element.@id == "channel")       
           {
              channel = element.data.@value;
           }
           if (element.@id == "layer")       
           {
              videoLayer = element.data.@value;
              videoLayer = videoLayer - 1;
           }
         }
      }
   }
}


You can download the example code also here: https://dl.dropboxusercontent.com/u/13685023/PlayClipInBackground.as
Didi Kunz
CasparCG Client-Programmer, Template Maker & Live CG-Operator
Media Support, CH-5722 Gränichen, Switzerland http://mediasupport.ch/
Problems? Guide to posting Bug reports & Feature requests
User avatar
didikunz
 
Posts: 3401
Joined: 10 May 2010, 09:08
Location: Aarau, Switzerland

Re: from 'too big image sequence' to 'video' using templates

Postby dlp » 27 Aug 2016, 18:55

Thanks a lot, i will check that.

Just for my understanding :
. Caspar server seems to have lot of graphics layers... let's say 9999
. It looks like there are also videolayer...
. How everything is rendered ? Does it looks like (from bottom to front) : videolayer1, videolayer2, ..., videolayer9999, graphicslayer1, graphicslayer2, ..., graphicslayer9999 ?
dlp
 
Posts: 7
Joined: 27 Aug 2016, 13:43

Re: from 'too big image sequence' to 'video' using templates

Postby didikunz » 27 Aug 2016, 22:14

There are only video-layers. They start from 0 the lowest to infinite (in theory) the topmost. You can have as many as your system can handle and I think the layer number internally is any kind of integer, so that some high number for the layer will crash. But beside this you can have a layer 0 and a layer 100. Caspar does not create unused layers, so you end up with 2 in this example.

In the Flash template commands there is a parameter called "flash-layer" that can be used to layer multiple flash templates in a single video layer. They will then run in the same instance of Flash player. I never use this, for performance reasons. Flash player is single threaded and runs only on one core, while multiple instances run on multiple cores.
Didi Kunz
CasparCG Client-Programmer, Template Maker & Live CG-Operator
Media Support, CH-5722 Gränichen, Switzerland http://mediasupport.ch/
Problems? Guide to posting Bug reports & Feature requests
User avatar
didikunz
 
Posts: 3401
Joined: 10 May 2010, 09:08
Location: Aarau, Switzerland

Re: from 'too big image sequence' to 'video' using templates

Postby Jesper Stærkær » 29 Aug 2016, 12:12

Newer versions of Flash Pro/Animate has better support for large image sequences.

A general tip is to crop the images to the minimum area used before importing.
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 835
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway


Return to Content

Who is online

Users browsing this forum: No registered users and 3 guests