Author: Code Cowboy

Exploring and Notes about interesting code snipets

First of all i have to mention that comping software i am very new to had just compiled ffmpeg and imagic for my Dev MAMP work field. But after got hot with image and video processing software like MLT . I just found the gorgeous branch stills2dv . Zooming probably is not the big thing but how the lib speed and slow up the pans and zooms is the best and most intuitive i have seen. Building the workfile is like writing a Text script how to zoom and Pan . Very simple if you have a bit of feeling for Pans & Zooms .

This stills2dv package have some very sweet Zoom and Pan options for still images but was build for Linux and some outdated lybs and commands made it a bit hard for me compile. for future i will note here what i change to get it work .Last but not least dropped in as i would like huge panorama images and return a video that can be shared on social media platforms like Facebook or Instagram. That as a terminal batch proces without opening any editing software.

Future idea is to create the workfile for pan zoom with a html editor.

First of all watch the video to get a impression what is the still2dv can do

First make sure you have the needed libs Installed

X11 installed

most likely this packages are already on your machine

libc
gcc
make
libjpeg-dev
libpng-dev

 

Some changes for the PATH to work on OSX below my make file with corrected paths. The only change was in the first lines  -lXext and -lX11 made me some trouble till i installed XQuartz .

PREFIX = /usr
CC = gcc
COPTIONS = -Wall -g -O4
CLIBS = -ljpeg -lpng -lm -I/opt/X11/include -L/opt/X11/lib/ -lXext -lX11

all: stills2dv

hash: hash.c stills2dv.h
	$(CC) -o hash $(COPTIONS) hash.c

stills2dv: s2d_main.o s2d_ppm.o s2d_jpg.o s2d_png.o s2d_smoothing.o x_lowlevel.o
	$(CC) -o stills2dv  $(COPTIONS) s2d_smoothing.o s2d_ppm.o s2d_jpg.o s2d_png.o s2d_main.o x_lowlevel.o $(CLIBS)
	echo You may try the command: make example

s2d_main.o: s2d_main.c stills2dv.h
	$(CC) $(COPTIONS) -c s2d_main.c

s2d_jpg.o: s2d_jpg.c stills2dv.h
	$(CC) $(COPTIONS) -c s2d_jpg.c

s2d_png.o: s2d_png.c stills2dv.h
	$(CC) $(COPTIONS) -c s2d_png.c

s2d_ppm.o: s2d_ppm.c stills2dv.h
	$(CC) $(COPTIONS) -c s2d_ppm.c

s2d_smoothing.o: s2d_smoothing.c stills2dv.h
	$(CC) $(COPTIONS) -c s2d_smoothing.c

x_lowlevel.o: x_lowlevel.c
	$(CC) $(COPTIONS) -c x_lowlevel.c

clean:
	rm -f *.o stills2dv hash Example/out.mpg tmp/* out.mpg tmp.mpg ffmpeg2pass*.log *~

clean_temp:
	rm -f *.o tmp/* tmp.mpg ffmpeg2pass*.log

example: stills2dv
	mkdir -p tmp
	rm -f tmp.mpg out.mpg
	./stills2dv -tmpdir tmp -showoutput exampleworkfile.s2d
	ffmpeg -r 30.00 -f image2 -i tmp/%05d.jpg -i example_data_files/09_1_2_3_4.mp3 -vcodec mpeg4 -vb 9000k -ab 128k -aspect 16:9 -pass 1 tmp.avi
	ffmpeg -r 30.00 -f image2 -i tmp/%05d.jpg -i example_data_files/09_1_2_3_4.mp3 -vcodec mpeg4 -vb 9000k -ab 128k -aspect 16:9 -pass 2 out.avi
	rm -f tmp/* tmp.avi
	mplayer out.avi -fs



install: stills2dv
	cp -f stills2dv $(PREFIX)/bin
	chmod 755 $(PREFIX)/bin/stills2dv
	chown root:root $(PREFIX)/bin/stills2dv

To run the Install you need also to adapt the install part since root:root doesn’t exist on osx .The install done manually in the terminal

One more change on s2d_png.c since libpng updated some commands will not work. My s2d_png.c following error found on stackoverflow

Chances are you are compiling IM with png.h from libpng-1.5.x but
* Bugs png_longjmp” only exists inlibpng-1.5.x.
* libpng-1.6.17 already installed

changeds2d_png.c to following . Mostly replaced the old format to the new strukture

png_create_info_struct
/**********************************************************************
 *
 * s2d_png.c
 *
 * Author: Denis-Carl Robidoux
 *
 * Copyrights and license: GPL v3 (see file named gpl-3.0.txt for details
 *
 *  
 *
 ***********************************************************************/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include <png.h>

#include "stills2dv.h"

Image *readpng(char *fn)
{
  unsigned char header[8]={0};
  int x, y, width, height;
  unsigned char *row;

  png_structp png_ptr;
  png_infop info_ptr;

  unsigned char  ** row_pointers;
  unsigned char *data;
  Image *img;
  FILE *in;
  TRACE;
  in = fopen(fn, "rb");
  if (!in)
    {
      fprintf(stderr," File %s could not be opened for reading", fn);
      return NULL;
    }
  if (fread(header, 1, 8, in)!=8)
    {
      fprintf(stderr, "Failed reading header of %s\n", fn);
      fclose(in);
      return NULL;
    }
  if (png_sig_cmp(header, 0, 8))
    {
      fprintf(stderr," File %s is not recognized as a PNG file", fn);
      fclose(in);
    }
     
  png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
	
  if (!png_ptr)
    {
      fprintf(stderr," png_create_read_struct failed");
      fclose(in);
      return NULL;
    }

  info_ptr = png_create_info_struct(png_ptr);
  if (!info_ptr)
    {
      fprintf(stderr," png_create_info_struct failed");
    }

  if (setjmp(png_jmpbuf(png_ptr)))
    {
      fprintf(stderr," Error during init_io");
    }
  png_init_io(png_ptr, in);
  png_set_sig_bytes(png_ptr, 8);
  png_read_info(png_ptr, info_ptr);

  
  height = png_get_image_height( png_ptr,  info_ptr);
  width = png_get_image_width( png_ptr,  info_ptr);
  
  png_set_interlace_handling(png_ptr);
  png_read_update_info(png_ptr, info_ptr);
  if (setjmp(png_jmpbuf(png_ptr)))
    {
      fprintf(stderr," Error during read_image");
    }
  if((row_pointers = (unsigned char **) malloc(sizeof(unsigned char *) * height))==NULL)
    {
	fprintf(stderr, "Out of memory allocating rows index for png\n");
	png_destroy_info_struct(png_ptr, &info_ptr);
	//png_destroy_struct(png_ptr);
	return NULL;
    }
  for (y=0; y<height; y++)
    if((row_pointers[y] = (unsigned char *) malloc(  png_get_rowbytes(png_ptr, info_ptr) ))==NULL)
      {
	    fprintf(stderr, "Out of memory allocating rows for png\n");
	    while(y>1)
	  {	   
	    free(row_pointers[--y]);
	  }
	free(row_pointers);
	png_destroy_info_struct(png_ptr, &info_ptr);
	//png_destroy_struct(png_ptr);
	return NULL;
      }
  png_read_image(png_ptr, row_pointers);
  fclose(in);
  if((img=(Image *)malloc(sizeof(Image)))==NULL)
    {
      fprintf(stderr, "Out of memory creating header while opening png\n");
      png_destroy_info_struct(png_ptr, &info_ptr);
      //png_destroy_struct(png_ptr);
      for (y=0; y<height; y++)
	free(row_pointers[y]);
      free(row_pointers);     
      return NULL;
    }
  memset(img, 0, sizeof(Image)); 

  if((img->data=(unsigned char *)malloc(width * height * 3))==NULL)
    {
      fprintf(stderr, "Out of memory for image while opening png\n");
      png_destroy_info_struct(png_ptr, &info_ptr);
      //png_destroy_struct(png_ptr);
      for (y=0; y<height; y++)
	free(row_pointers[y]);
      free(row_pointers);     
      free(img);
      return NULL;      
    }
  if( png_get_color_type(png_ptr, info_ptr)  == PNG_COLOR_TYPE_RGB)
    {
      
      for (y=0;y<height;y++)
	{	  
	  memcpy(&img->data[y*width*3], row_pointers[y], width*3);
	}
    }else if ( png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGBA)
    {
      data=img->data;
      for (y=0;y<height;y++)
	{
	  row=row_pointers[y];
	  for(x=0;x<width;x++)
	    {
	      *(data++)=*(row++);
	      *(data++)=*(row++);
	      *(data++)=*(row++);
	      row++;
	    }
	}
    }else if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY)
    {
      data=img->data;
      for (y=0;y<height;y++)
	{
	  row=row_pointers[y];
	  for(x=0;x<width;x++)
	    {
	      *(data++)=*row;
	      *(data++)=*row;
	      *(data++)=*(row++);
	    }
	}
    }else if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA)
    {
      data=img->data;
      for (y=0;y<height;y++)
	{
	  row=row_pointers[y];
	  for(x=0;x<width;x++)
	    {
	      *(data++)=*row;
	      *(data++)=*row;
	      *(data++)=*(row++);
	      row++;
	    }
	}
    }else
    {
      fprintf(stderr, "Unsupported PNG format, we do not support indexed color (yet)\n");
      png_destroy_info_struct(png_ptr, &info_ptr);
      //png_destroy_struct(png_ptr);
      for (y=0; y<height; y++)
	free(row_pointers[y]);
      free(row_pointers);     
      free(img->data);
      free(img);
      return NULL;
    }
  img->width=width;
  img->height=height;
  png_destroy_info_struct(png_ptr, &info_ptr);
  //png_destroy_struct(png_ptr);
  for (y=0; y<height; y++)
    free(row_pointers[y]);
  free(row_pointers);     
  img->fn=strdup(fn);
  return img;
}

Now we are at the point that make and sudo make install works without any error.

IMPORTANT

We need XQuartz  works fromOS X 10.6.3 till  El Capitan  , Download and install this part output the images to the window and will get started from the terminal as soon Showoutput get executed.

Run in Terminal

stills2dv -tmpdir tmp -showoutput workfil_pano.s2d

Terminal returns and start prozessing your workfile and place all images in the tmp folder. My  workfil_pano is a simple pan from left to right

resolution 1200×830

fps 25

type jpg

img Kaiserpano.jpg zoom FITHEIGHT startpoint LEFT endpoint RIGHT duration 29.00Creating framCreating fCreaCreating frame #00024 at x= 244.22 y= 165.00 and zoom 4.06

After all Zoom Pan prozessed the tmp is full of single images now combine them with ffmpeg to get the final movie

ffmpeg -r 25.00 -f image2 -i tmp/%05d.jpg -i myaudiofile.mp3 -target pal-dvd -s 1920x1080 -vb 9000k outvid.mpg

I hope i dont forget anything , its already some days ago

Since i discovered the revolution Slider iam got a big fan of the Slider even its quite heavy load but on some pages its more than worth. But the problem as long its not a part of your theme the Slider will play only in my blog content area . So i wish to play revolutions slides even in the banner area . Socalled execute revolution Shortcodes on the single blog page and even on the frontpage slider .Where i normally chose images who should rotate.

Here a view lines of code i added to the theme frontpage theme template . To clarify i use the Blip Theme and Option Tree to setup theme options and more . Blimp is not any more maintenance so any change and upgrade i have to make myself.

<?php $sliders = ot_get_option('pxg_bliv_homepage_slider'); ?>
<div class="featured-inner flexslider">
 <ul class="slides">
 <?php 
 // ALL TIME RENDER BACKGROUND IMAGE 
 foreach ($sliders as $key => $slider) { ?>
 <li style="background-image: url('<?php echo $slider["image"] ?>')">
 <?php
 // IF REVOLUTION SLIDER 
 if (preg_match("/(?<=alias=\").*?(?=\"\])/s", $slider["title"], $result)){
 $revolID = $result[0];
 } 
 if (strpos($slider["title"],'[rev_slider') !== false) {
 echo do_shortcode('[rev_slider alias="'.$revolID.'"]');
 
 // RENDER ANY SHORTCODE WE FOUND IN TITEL 
 }elseif(strpos( $slider["title"], '[' ) !== false){ 
 
 echo do_shortcode($slider["title"]);
 
 // ELSE DAFULT SLider
 }else{ ?> 
 <div class="container">
 <span class="sub-title"><?php echo $slider["description"] ?></span>
 <span class="title"><?php echo $slider["title"] ?></span>
 </div>
 
 <?php } ?>
 </li> 
 <?php } ?>
 </ul>
 </div>

To explain the code , we check if a revolution slider shortcode is in the Title if so we extract the parameter and execute with do_shortcode the Slider . After we look if any other shortcode is in the Title if so we execute that . In my case i use iframe Advanced and sometime i would like to render some fancy D3 animation or Odyssey.js   in the header.  If No shortcode is found we render the default images set in the theme Settings.

this is probably not 100% foolproof but for now it works quite well. Code above is for the front-page.php but its nearly the same for the single blog post page . Below how it looks like from a test blog. header cover is with revolution slider and fully anim able from the backend . The Slider loads beforehand the default image still the Big Slider is finally loaded. This is nothing that make since for fast pages but since i seperate Blog and Main page it will not affect the blog.

Screen shot 2016-01-07 at 14.37.00

Just wrote this down to remember all the little changes for later, or if i change the theme one day. Formating of the code need to be changed to be a little bit clearer

 

[nectar_dropcap color=”#1e83ec”]S [/nectar_dropcap]eparated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way. l using her.Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

[split_line_heading]

But nothing the copy said could convince her

and so it didn’t take long until a few insidious

Copy Writers ambushed her

[/split_line_heading]

The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek, then she continued her way. On her way she met a copy.

Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way. l using her.Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

A New Beginning Awaits

Even the all-powerful Pointing has no control over the situation.

Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen.

She packed her seven versalia, put her initial into the belt and made herself on the way. l using her.Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

[nectar_dropcap color=”#50d18d”]S [/nectar_dropcap]eparated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way.

l using her.Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

Sentences fly into your mouth.

far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

Her hometown Bookmarksgrove.

far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

[testimonial_slider style=”default”][testimonial title=”Testimonial” tab_id=”1452009327934-7″ name=”Blind Text” quote=”And if she hasn’t been rewritten, then they are still using her. Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.”] Click the edit button to add your testimonial. [/testimonial][/testimonial_slider]

Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen.

She packed her seven versalia, put her initial into the belt and made herself on the way. l using her.Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

MLT mltframework install for OSX

A short overview how to install MLT on a Mac OSX since most hints are for Linux user and the path is not that simple for a non Linux User its a work in progress with a long way to debug the missing GTK . Without GTK we will not get any Text over the Videos as all other modules will fail to render Text.  These is a long journey to compile MLT and all needed packages on a OSX 10.6 with brew . I have to mention here that iam a total Unix nop and mostly i log the process here to repeat the same on a second framework or other versions. Why i document all steps and possible errors in that details ? At the moment i run my dev MAC on Snow Leopard the same procedure  i will need to repeat on upgrade to El Captain and hopefully this blog post helps a bit. Additional quote new in compiling software so its a learning procedure log. Pleas keep in mind iam just a beginner with compiling software so probably they are better ways.

What is MLT ? 

An open source multimedia framework, designed and developed for television broadcasting. For Processing Video Effect a very open plugin architecture make it easy to extend it . Probably the most powerful Multimedia Framework you can find with a very aktive Developer ! Kdenlive is only a GUI. All video processing is done by MLT. Recommended if you want to learn MLT is Shotcast APP a guy interface for MLT from the same developer.

Tell the User Stories

Need the MLT with ffmpeg to use for some movie generation via php . The first MLT install was quite smooth except that i don’t care to much about some missing libys and additional sound libs what result in a fail of text rendering on video. MLT Framework compiled from Source.

FFMpeg and IMAGEemagick was installed already and working on the MAMP environment using 10.6 Snow Leopard xcode  X11: 2.3.6 => /usr/X11

In my case i use Homebrew for most packages , the mltframeworks describe how to process with macports what i don’t want to install again . First of all check that your brew is updated and correct working. Keep in mind that some make prozess take very long  ! Best place to start was the kdenlive help page  even it was for linux.

Why Homebrew installs into /usr/local  ? Because its easy and save.

 Packages updated keep all fresh

Fix all errors you can find. Thats sound easy but will be the most important part. If the brew upgrade process fail or get stuck just execute one by one formula by brew update [formula]

brew update &  brew upgrade

brew doctor

Check the needed dependencies for MLT , below a list with marked Ok for brew formulas and NoP for none. UPDATE brew now offer a MLT formula but with no config option and default is with -disable-gtk  what means no text overlay 🙁

The Simple way with brew

brew install mlt

brew config : ./configure –prefix=/usr/local/Cellar/mlt/0.9.6 –disable-jackrack –disable-swfdec –disable-gtk

The downside it will install MLT without GTK so no text over video rendering engine. even if you change the config flags gtk it will not compile without some errors. But a good starting point to experiment with MLT.

If something runs wrong

brew install --verbose --debug mlt

Required packages for a Linux install, since the devel Dev versions are not available in a OSX we need compile them from source.To compile anything on OS X, you’ll need to have XCode .
Installing X11 : In OS X 10.8 Mountain Lion and later, X11 is not provided anymore. You need to install XQuartz, from http://xquartz.macosforge.org/landing/. In earlier version of OS X, this is not stricly necessary, but recommended as XQuartz is more robust and updated that the system-provided X11.
In our case GTK and Cairo can compiled with X11 or without ,default is without that will brake our build for MLT.One big problem compiling MLT with GTK was that it get the wrong libs. To force the build process to use our own gtk+ we place the PATH for GTK before the X11 PATH in our private_Bash ,Like below. How to compile gtk+ with the dev packages is excellent explained in Building GTK-OSX this was the only source who describe how to compile gtk -dev what is needed for MLT with GTK on OSX.  Mac OSX (Snow Leopard in this case) already ships with many libs  (or a own version of it). Brew will install this as keg-only to use it in your build you have to set the the CXXFLAGS LDFLAGS in your make file.

LDFLAGS

CXXFLAGS

export PKG_CONFIG_PATH=/usr/local/gtk/inst/lib/pkgconfig:/usr/X11/lib/pkgconfig/:/usr/X11/lib/pkgconfig/

Following Libs needet for compiling MLT on Linux :

libxml2 libsdl libsdl-image libavdevice (installed with ffmpeg) libswscale libvorbis libsamplerate frei0r (Built from source) libdv libavformat libquicktime           

KDNlive installing MLT

Highly recommended Audio Packages -dev builds are needed for compiling (Linux) libsox-dev libjack-dev ladspa-sdk

Tools for building MLT needed:  cmake , git ,subversion , pkg-config ,autoconf  default install dir for packages will be  /usr/local/include/

MLT GTK+ Install problems

It seems that many people have the same problem here and here  if you are not a soft pro. This post brought me to the right path general GTK+ problems read more about troubleshooting GTK 

missing symbols when gtk is built with Quartz backend

Installing required Libraries  brew  Modules Formulars :

If the package installer fails you can try to install every package one by one.

Cairo 

Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.  Cairo formula

brew install cairo

frei0r : Filter modul , install frei0r

brew install frei0r

Pango : Internationalized text layout and rendering library Install Pango

brew install pango

GTK2 Why is this package not being found ?

GTK+ : This was quite the  hardest nuts, MLT never found the gtk2 package respond after config with . Important remove any trace of fink and macport reported by brew doctor else it will brake your build since its a  jhbuild  Mixing Fink or MacPorts and GTK-OSX will fail.

Configuring modules/gtk2:
- GTK2 components not found: disabling

What is GTK ? Gtk is a unix graphical framework originally designed to run on Unix systems with X-Windows but it provides multiple backends including one for OS X’s Quartz graphics engine, so it can be built to run on OS X without enabling the X11 subsystem.

tray install GTK 2.0 first with  brew but still the development devels are missing

brew install gtk+

Debugging GTK2

In my case gtk2 never get recognsied by MLT ./config .

1. Check the config Flags for GTK, the first gives the option to link the libs, the second the paths; I usually use something like

pkg-config gtk+-2.0 --libs
pkg-config gtk+-2.0 --cflags

To debug the installer you can add following into the gdk build configure script  located in the melt0.8.9/src/modules/gtk2 . add the debugger for pkg-config around line 24 where it chose to brake your GTK . It will output all the single steps and paths to make it easy to find the bottle neck.

pkg-config $pkgconfig_prefix gtk+-2.0 --debug

FLAGS output

Package libpng16 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpng16.pc’
to the PKG_CONFIG_PATH environment variable
Package ‘libpng16’, required by ‘gdk-pixbuf-2.0’, not found

 

Libexif  :EXIF parsing library

brew install libexif

QT : Install

install QT important need some quite long time 120 min

brew install qt

SOX  SoX – Sound eXchange apply various effects and convert sound formats. Sound Modules

Install Sox

brew install sox

 

swfdecFlash  modul no brew formula  last update 2008 version 0.8 SWFDEC is also as binary available see FAQ . Mltframework have a own fork swfdec  2012  install swfdec

git clone git://anongit.freedesktop.org/swfdec/swfdec

cd swfdec

MoveIT :

openGL Filters    Release Movit 1.1.3.         2015 by Steinar H. Gunderson . Meanwhile in the Galaxy

git clone “http://git.sesse.net/movit/”

Install Ffmpeg with MAX options

MLT Config Option

To understand the MLT build script its build with jhbuild . Since we need the full developer envoirment for GTK we build our own GTK build for OSX   this guranti us that we have a mostly complete GTK developer Enable GPL is needed to activate all GPL modules   –enable-gpl . Check the MLT Dependencies 

Prefix MLT  –prefix=/usr

Additional we can add prefix for our GTK2 –prefix

Compile and Install MLT for Mac OSX

Thats the most easy part at least on the first run …

git clone git://github.com/mltframework/mlt.git
cd mlt

./configure --prefix=/usr --enable-gpl

 

Terminal out

Configuring framework:
Configuring modules:
Configuring modules/avformat:
Configuring modules/core:
Configuring modules/decklink:
Configuring modules/feeds:
Configuring modules/frei0r:
Configuring modules/gtk2:
- GTK2 components not found: disabling
Configuring modules/jackrack:
- ladspa not found; disabling
Configuring modules/kdenlive:
Configuring modules/linsys:
- does not build on OS X or Windows: disabling
Configuring modules/lumas:
Configuring modules/motion_est:
Configuring modules/normalize:
Configuring modules/oldfilm:
Configuring modules/opengl:
- movit not found: disabling
Configuring modules/plus:
Configuring modules/plusgpl:
Configuring modules/qt:
- Libexif found, enabling auto rotate
- Qt version 4.x detected
./configure: line 183: kde4-config: command not found
- fftw found, enabling lightshow
Configuring modules/resample:
Configuring modules/rtaudio:
Configuring modules/sdl:
Configuring modules/sox:
Configuring modules/swfdec:
- swfdec not found: disabling
Configuring modules/vid.stab:
- vid.stab not found: disabling
Configuring modules/videostab:
Configuring modules/vmfx:
Configuring modules/xine:
Configuring modules/xml:
Configuring mlt++:
Configuring swig:
GPLv2 license used; GPLv3 components disabled

GTK+ options:   –gtk2-prefix=path

make clean
make -j3
sudo make install

Get All Config Flags for MLT   ./configure –help

version: melt 0.9.7

 

After Recompiling GTK+ we get following output . GTK found but all packages installed with brew are now missing . Suggesting some PATH is missing in $PKG_CONFIG_PATH

./configure --prefix=/usr --enable-gpl

Configuring framework:
Configuring modules:
Configuring modules/avformat:
- libavformat not found: disabling
Configuring modules/core:
Configuring modules/decklink:
Configuring modules/feeds:
Configuring modules/frei0r:
Package frei0r was not found in the pkg-config search path.
Perhaps you should add the directory containing `frei0r.pc'
to the PKG_CONFIG_PATH environment variable
No package 'frei0r' found
Configuring modules/gtk2:
- Libexif not found, disabling exif features (auto rotate)
Configuring modules/jackrack:
- jackrack not found: disabling
- ladspa not found; disabling
Configuring modules/kdenlive:
Configuring modules/linsys:
- does not build on OS X or Windows: disabling
Configuring modules/lumas:
Configuring modules/motion_est:
Configuring modules/normalize:
Configuring modules/oldfilm:
Configuring modules/opengl:
- movit not found: disabling
Configuring modules/plus:
- fftw not found: disable fft and dance filters
Configuring modules/plusgpl:
Configuring modules/qt:
- Libexif not found, disabling exif features (auto rotate)
- Qt not found - disabling
./configure: line 183: kde4-config: command not found
- fftw not found: disabling lightshow filter
Configuring modules/resample:
- libsamplerate not found: disabling
Configuring modules/rtaudio:
Configuring modules/sdl:
Configuring modules/sox:
- sox not found: disabling
Configuring modules/swfdec:
- swfdec not found: disabling
Configuring modules/vid.stab:
- vid.stab not found: disabling
Configuring modules/videostab:
Configuring modules/vmfx:
Configuring modules/xine:
Configuring modules/xml:
Configuring mlt++:
Configuring swig:
GPLv2 license used; GPLv3 components disabled
echo $PKG_CONFIG_PATH
/usr/X11/lib/pkgconfig/:/usr/X11/lib/pkgconfig/

POST in Progress 

Video Editing with Scripts

And finaly got it GTK to work

What was the problem ? many libraries not linked since there was a version on the system. with the terminal command we debugg every single lib gtk is complaining and force a link . We needed a force link for cairo ,pixman ,fontconfig ,libpng   for Freetype with

–overwrite freetype

pkg-config --libs --cflags gtk+-2.0

 

Recent Config

./configure --prefix=/usr --enable-gpl

Configuring framework:
Configuring modules:
Configuring modules/avformat:
Configuring modules/core:
Configuring modules/decklink:
Configuring modules/feeds:
Configuring modules/frei0r:
Configuring modules/gtk2:
- Libexif found, enabling auto rotate
Configuring modules/jackrack:
Configuring modules/kdenlive:
Configuring modules/lumas:
Configuring modules/oldfilm:
Configuring modules/opengl:
- movit not found: disabling
Configuring modules/plus:
Configuring modules/rtaudio:
Configuring modules/sdl:
Configuring modules/sox:
Configuring modules/swfdec:
- swfdec not found: disabling
Configuring modules/vmfx:
Configuring modules/xml:
Configuring mlt++:
Configuring swig:
LGPLv2.1 license used; GPL components disabled

Now we can recompile MLT with all the sweet features that it offer . Probably thats not the clearest path but it works now .

Problems Errors that can cross your path :

pango producer, which is related to GTK and
only working, if gtk2 was compiled into MLT ! No text is rendering on video , probably Pango Composer . missing  GTK+ Libs

OpenSSL ≥ 0.9.8  Errors : SnowLeopard and earlier ship with 0.9.7, so if you’re on one of those old platforms you’ll need to upgrade

Perhaps you should add the directory containing `XYZ’
to the PKG_CONFIG_PATH environment variable

Failed to use the precompiled GTK Framework for X11  .

  1. Download the GTK_2.18.5-X11.pkg package from http://r.research.att.com/ and install it
  2. Add to your .profile file in the home directory

Command to edit your .Profile
touch ~/.bash_profile; open ~/.bash_profile

export PATH=/Library/Frameworks/GTK+.framework/Resources/bin:$PATH

Brew Doctor complains : “Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following “config” scripts:”

Check your installed Moduls

Query MLT : melt -query config

Terminal MLT Errors

After installed the new FFPEG you need to recompile MLT if you get following dylib error

mlt_repository_init: failed to dlopen /usr/lib/mlt/libmltavformat.dylib
  (dlopen(/usr/lib/mlt/libmltavformat.dylib, 2): Library not loaded: /usr/local/opt/ffmpeg/lib/libavcodec.54.92.100.dylib
  Referenced from: /usr/lib/mlt/libmltavformat.dylib

HOMEBREW help

Check homebrew log files cd

~/Library/Logs/Homebrew/

MLT USEFUL COMMANDS

-filter videostab2

Best resources

MLTframeworks

MLT config Script

kdenlive

MediaLibs MLT + flags

GTK OSX Building Gnome

Mac Terminal Command cheat list

How do I specify LDFLAGS and CPPFLAGS for ./configure?

Other Related Open Source Video Software :

Shotdetect :Shotdetect is a free software (LGPL) which detects shots and scenes from a video. The result produced is a simple XML file containing all the informations about the movie generated. How to install  shotdetect

Userfull Terminal Commands for debugging

Add path to pkconfig

$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Check if pkgconfig packets are where they should

$ pkg-config --libs --cflags gtk+-2.0

Portit mollis vitae

Nullam ornare, sem in malesuada sagittis, quam sapien ornare massa, id pulvinar quam augue vel orci. Praesent leo orci, cursus ac malesuada et, sollicitudin eu erat. Pellentesque ornare mi vitae sem consequat ac bibendum neque adipiscing. Donec tellus nunc, tincidunt sed faucibus a, mattis eget purus.

Continue reading

One of my favorite Themes with the Page Builder need a custom extension for a module . Modded it once here i logged the process to remember for future upgrades. These topic will show how to add link parameter to the icon list modul for in Theme  Page Builder. Of course you can customise the same effect with the editor and some html lines but for Clients with no html knowledge its much easier to simply fill the module form and a additional field.

Icon-List

visually high value the Icon List Module the only part i missed is to add a link to the icon .  Its quite simple by extending the json parameter for that module . You have to edit the extend-vc.php file that can be found in your subway theme folder

wp-content/theme/subway/extendvc 

All modules are here defined by va_map arrays to exend our modul we need to add some link parameter to the array definition of the Icon list you can find it around line 777 . METAMODE is only a personal marker for myself to find changed code in a plugin.

//Icon List Item METAMODE
vc_map( array(
"name" => __("Icon List Item"),
"base" => "icon_list_item",
'admin_enqueue_css' => array(get_template_directory_uri().'/css/admin/vc-extend.css'),
"icon" => "icon-wpb-icon_list_item",
"category" => __('by QODE'),
"params" => array(
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon"),
"param_name" => "icon",
"value" => $icons,
"description" => __("")
),
array(

Just add a additional textfield with link parameter inside the icon list array. After adding these part we only need to extend the part that renders the module.

Add input fields your icon-list module

array(
     "type" => "textfield",
     "holder" => "div",
     "class" => "",
     "heading" => __("Link"),
     "param_name" => "link",
      "value" => $link,
     "description" => __("")
),

To keep the Theme free for future update we will test to move the mode in our function or even better in a custom new plugin .

Full Extension for Function or WP Plugin copy & past these part below.

//Icon List Item METAMODE
vc_map( array(
"name" => __("Icon List Item"),
"base" => "icon_list_item",
'admin_enqueue_css' => array(get_template_directory_uri().'/css/admin/vc-extend.css'),
"icon" => "icon-wpb-icon_list_item",
"category" => __('by QODE'),
"params" => 
           array(
                "type" => "textfield",
                 "holder" => "div",
                 "class" => "",
                 "heading" => __("Link"),
                 "param_name" => "link",
                 "value" => $link,
                 "description" => __("")
                ),
)
) );

Now you added the additional Link Form to your module it should look like these in the Editor if you click the Pencil

Icon_List Editor

Still no link on the rendered Front page now we edit the rendering part. To edit the modul template file we need in

subway/inlcude/shortcodes.php

and add the new Link part to the Shortcode for the Icon list Shortcode part to the $html you find that around line 1353 depends on the theme version

Render the new link Icon list Shortcode

Finaly we need to change the icon list shortcode to render the link for the icon list for these we need to edit shortcodes.php

We add the additional html and extract the link attribute in the first line to make it short we only add the href part to the title
change  first function line to

extract(shortcode_atts(array("link"=>"","icon"=>"", "icon_color"=>"", "icon_background_color"=>"", "icon_border_color"=>"", "title"=>"","title_color"=>""), $atts));

and the link hmtl

$html .= '><a href="'.$link.'">'.$title.'</a></p>';

Finaly the new full shortcode for list icon will lock like below

/* Icon List Item shortcode */
/* Metamode */
if (!function_exists('icon_list_item')) {
function icon_list_item($atts, $content = null) {
	extract(shortcode_atts(array("link"=>"","icon"=>"", "icon_color"=>"", "icon_background_color"=>"", "icon_border_color"=>"", "title"=>"","title_color"=>""), $atts));
	$html = '';
	$html .= '<div class="icon_list">';
	$html .= '<!-- testlistshortcode -->';
	$html .= '<i class="'.$icon.' pull-left icon-border" ';
	if($icon_color != "" || $icon_background_color != "" || $icon_border_color != ""){
		$html .= 'style="';
		if($icon_color != ""){
			$html .= 'color:'.$icon_color.';';
		}
		if($icon_background_color != ""){
			$html .= 'background-color:'.$icon_background_color.';';
		}
		if($icon_border_color != ""){
			$html .= 'border-color:'.$icon_border_color.';';
		}
		$html .= '"';
	}
	$html .= '></i>';
	$html .= '<p';
	if($title_color != ""){
		$html .= ' style="color:'.$title_color.';"';
	}
	$html .= '><a href="'.$link.'">'.$title.'</a></p>';
	//$html .= '>'.$title.'</p>';
	$html .= '</div>';
	return $html;
}
}
add_shortcode('icon_list_item', 'icon_list_item');

 

The Orange

[nectar_dropcap color=”#1e83ec”]S [/nectar_dropcap]eparated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way. l using her.Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

[split_line_heading]

But nothing the copy said could convince her

and so it didn’t take long until a few insidious

Copy Writers ambushed her

[/split_line_heading]

The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek, then she continued her way. On her way she met a copy.

[divider line_type=”No Line” custom_height=”300″]
[divider line_type=”No Line” custom_height=”300″]
[divider line_type=”No Line” custom_height=”300″]
[divider line_type=”No Line” custom_height=”300″]

Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way. l using her.Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.