Announcement

Collapse
No announcement yet.

Question: Creating Videos from UltraNetCam Snapshots using FFmpeg on Linux.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question: Creating Videos from UltraNetCam Snapshots using FFmpeg on Linux.

    Greetings,

    I have noticed several threads that mention trouble using FFmpeg on Linux to convert event snapshots into videos. I too, am having some difficulty with this, but hope we can get it all sorted out.

    First, versions:
    Operating System - Linux: OpenSuSE 42.1 x86-64, Kernel 4.1.27
    HomeSeer Version - HS3 Standard 3.0.0.293
    FFmpeg Version - 2.8.6-16.1

    In (1) it is mentioned that UltraNetCam seems to have trouble finding FFmpeg installations. In (2) it says that UltraNetCam needs to see FFmpeg in the HomeSeer root directory. Linux package managers will generally install FFmpeg somewhere else - I have it in: /usr/bin/ffmpeg. Simply copying this file to the HomeSeer directory doesn't quite solve the installation problem. UltraNetCam still won't see it as installed. Rather it needs to be renamed ffmpeg.exe. I used a symbolic link so that I didn't have to worry when updating my system:

    In the HomeSeer root directory execute:
    Code:
    # ln -s /usr/bin/ffmpeg ffmpeg.exe
    This should cause UltraNetCam to recognize that FFmpeg is installed.

    With regards to (3), I don't own a Zee, but I believe it is based on the Raspberry Pi and as such there might be precompiled FFmpeg versions for it. Possibly (4) & (5) will help.

    However, even though UltraNetCam recognizes that FFmpeg is installed, it still won't produce videos from snapshots. I can create videos by hand. By extracting all the snapshots I want in the video into a directory, the following command will create a video. Which I can then view on a separate computer with Kaffine.

    Code:
    # ffmpeg -f image2 -pattern_type glob -i "*.jpg" -r 24 test_video.mkv
    I was hoping someone might have insight on how UltraNetCam calls FFmpeg. Does it uses special options or codecs not installed by default with FFmpeg? It might be possible to create a shell script to interface between UltraNetCam and the Linux installation of FFmpeg.

    Thanks for reading,
    -Alex

    (1) Problems. Linux version?
    http://board.homeseer.com/showthread.php?t=182148

    (2) FFMPEG file location for plugin?
    http://board.homeseer.com/showthread.php?t=182458

    (3) MP4 attachment not working
    http://board.homeseer.com/showthread.php?p=1246447

    (4) https://wiki.debian.org/ffmpeg
    (5) https://www.raspberrypi.org/forums/v...c.php?t=125367

  • #2
    @ARA, Thanks, this thread has lead me on the right path to get it to work :-). This is the workaround:

    Not only needs the ffmpeg.exe to exist in the homeseer directory, the actual trick is to create a 'homeseerfoldername\ffmpeg.exe' in its parent directory.
    It looks like HSPI_ULTRANETCAM3 uses a hardcoded backslash as directory separator instead of using Path.DirectorySeparatorChar
    I came to this conclusion when seeing a 'xxxx\hspi_ultranetcam3_debug.log' in the homeseer parents directory.

    In my setup, this is how it is structured:

    parent folder contains:
    hs3_linux_3_0_0_297 (homeseer home directory)
    hs3_linux_3_0_0_297\ffmpeg.exe (file)
    hs3_linux_3_0_0_297\hspi_ultranetcam3_debug.log (created by ultranetcam3)
    Within the homeseer home directory [hs3_linux_3_0_0_297] (among others):
    ffmpeg.exe
    @Ultrajones, now I guess you can easily fix this, so we no longer have to work-around it :-).
    Last edited by ihomeautomate; February 13th, 2017, 12:46 AM.

    Comment


    • #3
      This is very good news! I've tested your method and it works for me as well.

      I should note (for my future self) that you must run a version of ffmpeg that supports mp4 (mpeg4) file creation. My stock version didn't and needed an upgrade from the PackMan repos (http://packman.links2linux.org/). Also, I'm using symbolic links for both ffmpeg.exe locations and it works fine.

      Thank you for your excellent work on this @ihomeautomate.

      -Alex

      Comment

      Working...
      X