Changeset 4353


Ignore:
Timestamp:
May 2, 2014, 10:15:12 AM (11 years ago)
Author:
ldelgass
Message:

Use avconv instead of ffmpeg if found (Debian uses the libav fork and ffmpeg
is removed in e.g. Ubuntu 14.04).

Location:
trunk/packages/vizservers/nanovis
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/FlowCmd.cpp

    r4106 r4353  
    969969}
    970970
    971 #ifdef HAVE_FFMPEG
     971#if defined(HAVE_FFMPEG) || defined(HAVE_AVCONV)
    972972
    973973/**
     
    11121112          FlowVideoSwitches *switchesPtr)
    11131113{
     1114    char cmd[BUFSIZ];
     1115#ifdef HAVE_AVCONV
     1116    /* Generate the movie from the frame images by exec-ing avconv */
     1117    /* The avconv command is
     1118     *   avconv -f image2 -i /var/tmp/xxxxx/image%d.ppm                 \
     1119     *      -f outformat -b bitrate -r framerate /var/tmp/xxxxx/movie.mpeg
     1120     */
     1121#ifndef AVCONV
     1122#  define AVCONV "/usr/bin/avconv"
     1123#endif
     1124    sprintf(cmd, "%s -f image2 -i %s/image%%d.ppm -f %s -b %d -r %f -",
     1125            AVCONV, tmpFileName, Tcl_GetString(switchesPtr->formatObjPtr),
     1126            switchesPtr->bitRate, switchesPtr->frameRate);
     1127#else
     1128    /* Generate the movie from the frame images by exec-ing ffmpeg */
     1129    /* The ffmpeg command is
     1130     *   ffmpeg -f image2 -i /var/tmp/xxxxx/image%d.ppm                 \
     1131     *      -f outformat -b bitrate -r framerate /var/tmp/xxxxx/movie.mpeg
     1132     */
    11141133#ifndef FFMPEG
    11151134#  define FFMPEG "/usr/bin/ffmpeg"
    11161135#endif
    1117     /* Generate the movie from the frame images by exec-ing ffmpeg */
    1118     /* The ffmpeg command is
    1119      *   ffmpeg -f image2 -i /var/tmp/xxxxx/image%d.ppm                 \
    1120      *      -b bitrate -f framerate /var/tmp/xxxxx/movie.mpeg
    1121      */
    1122     char cmd[BUFSIZ];
    11231136    sprintf(cmd, "%s -f image2 -i %s/image%%d.ppm -f %s -b %d -r %f -",
    11241137            FFMPEG, tmpFileName, Tcl_GetString(switchesPtr->formatObjPtr),
    11251138            switchesPtr->bitRate, switchesPtr->frameRate);
     1139#endif
    11261140    TRACE("Enter: %s", cmd);
    11271141    FILE *f;
  • trunk/packages/vizservers/nanovis/configure

    r4158 r4353  
    638638CG_INC_SPEC
    639639FFMPEG
     640AVCONV
    640641EGREP
    641642GREP
     
    705706with_vtk
    706707with_ffmpeg
     708with_avconv
    707709with_statsdir
    708710'
     
    13361338  --with-vtk=VERSION      Version of VTK required [default=6.1]
    13371339  --with-ffmpeg=DIR       location of ffmpeg [default=yes]
     1340  --with-avconv=DIR       location of avconv [default=yes]
    13381341  --with-statsdir=DIR     Write statistics in DIR
    13391342
     
    22962299
    22972300
     2301# Check whether --with-avconv was given.
     2302if test "${with_avconv+set}" = set; then :
     2303  withval=$with_avconv;
     2304else
     2305  with_avconv=yes
     2306fi
     2307
     2308
     2309
    22982310# Check whether --with-statsdir was given.
    22992311if test "${with_statsdir+set}" = set; then :
     
    48004812
    48014813#--------------------------------------------------------------------
     4814# search for avconv executable
     4815#--------------------------------------------------------------------
     4816if test "${with_avconv}" != "no" ; then
     4817  if test "${with_avconv}" = "yes" ; then
     4818    # Extract the first word of "avconv", so it can be a program name with args.
     4819set dummy avconv; ac_word=$2
     4820{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
     4821$as_echo_n "checking for $ac_word... " >&6; }
     4822if ${ac_cv_path_AVCONV+:} false; then :
     4823  $as_echo_n "(cached) " >&6
     4824else
     4825  case $AVCONV in
     4826  [\\/]* | ?:[\\/]*)
     4827  ac_cv_path_AVCONV="$AVCONV" # Let the user override the test with a path.
     4828  ;;
     4829  *)
     4830  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     4831for as_dir in $PATH
     4832do
     4833  IFS=$as_save_IFS
     4834  test -z "$as_dir" && as_dir=.
     4835    for ac_exec_ext in '' $ac_executable_extensions; do
     4836  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     4837    ac_cv_path_AVCONV="$as_dir/$ac_word$ac_exec_ext"
     4838    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     4839    break 2
     4840  fi
     4841done
     4842  done
     4843IFS=$as_save_IFS
     4844
     4845  ;;
     4846esac
     4847fi
     4848AVCONV=$ac_cv_path_AVCONV
     4849if test -n "$AVCONV"; then
     4850  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AVCONV" >&5
     4851$as_echo "$AVCONV" >&6; }
     4852else
     4853  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
     4854$as_echo "no" >&6; }
     4855fi
     4856
     4857
     4858  else
     4859    # Extract the first word of "avconv", so it can be a program name with args.
     4860set dummy avconv; ac_word=$2
     4861{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
     4862$as_echo_n "checking for $ac_word... " >&6; }
     4863if ${ac_cv_path_AVCONV+:} false; then :
     4864  $as_echo_n "(cached) " >&6
     4865else
     4866  case $AVCONV in
     4867  [\\/]* | ?:[\\/]*)
     4868  ac_cv_path_AVCONV="$AVCONV" # Let the user override the test with a path.
     4869  ;;
     4870  *)
     4871  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     4872as_dummy="${with_avconv}/bin:${with_avconv}"
     4873for as_dir in $as_dummy
     4874do
     4875  IFS=$as_save_IFS
     4876  test -z "$as_dir" && as_dir=.
     4877    for ac_exec_ext in '' $ac_executable_extensions; do
     4878  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     4879    ac_cv_path_AVCONV="$as_dir/$ac_word$ac_exec_ext"
     4880    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     4881    break 2
     4882  fi
     4883done
     4884  done
     4885IFS=$as_save_IFS
     4886
     4887  ;;
     4888esac
     4889fi
     4890AVCONV=$ac_cv_path_AVCONV
     4891if test -n "$AVCONV"; then
     4892  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AVCONV" >&5
     4893$as_echo "$AVCONV" >&6; }
     4894else
     4895  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
     4896$as_echo "no" >&6; }
     4897fi
     4898
     4899
     4900  fi
     4901  if test "${AVCONV}x" != "x" ; then
     4902
     4903$as_echo "#define HAVE_AVCONV 1" >>confdefs.h
     4904
     4905  fi
     4906fi
     4907
     4908#--------------------------------------------------------------------
    48024909# search for ffmpeg executable
    48034910#--------------------------------------------------------------------
     
    49545061  LD_RPATH="$loader_run_path:${CG_LIB_DIR}"
    49555062fi
     5063
    49565064
    49575065
  • trunk/packages/vizservers/nanovis/configure.in

    r4158 r4353  
    4545    [],
    4646    [with_ffmpeg=yes])
     47
     48AC_ARG_WITH(
     49    [avconv],
     50    [AS_HELP_STRING([--with-avconv[=DIR]],
     51      [location of avconv @<:@default=yes@:>@])],
     52    [],
     53    [with_avconv=yes])
    4754
    4855AC_ARG_WITH(
     
    198205
    199206#--------------------------------------------------------------------
     207# search for avconv executable
     208#--------------------------------------------------------------------
     209if test "${with_avconv}" != "no" ; then
     210  if test "${with_avconv}" = "yes" ; then
     211    AC_PATH_PROG(AVCONV, avconv)
     212  else
     213    AC_PATH_PROG(AVCONV, avconv, [], [${with_avconv}/bin:${with_avconv}])
     214  fi
     215  if test "${AVCONV}x" != "x" ; then
     216    AC_DEFINE(HAVE_AVCONV, 1, [nanovis can use avconv to create videos.])
     217  fi
     218fi
     219
     220#--------------------------------------------------------------------
    200221# search for ffmpeg executable
    201222#--------------------------------------------------------------------
     
    258279AC_SUBST(CG_INC_SPEC)
    259280AC_SUBST(CG_LIB_SPEC)
     281AC_SUBST(AVCONV)
    260282AC_SUBST(FFMPEG)
    261283AC_SUBST(LD_RPATH)
  • trunk/packages/vizservers/nanovis/nvconf.h.in

    r4060 r4353  
    99/* Define to 1 if you have the <arpa/inet.h> header file. */
    1010#undef HAVE_ARPA_INET_H
     11
     12/* nanovis can use avconv to create videos. */
     13#undef HAVE_AVCONV
    1114
    1215/* Define to 1 if you have the <Cg/cgGL.h> header file. */
Note: See TracChangeset for help on using the changeset viewer.