Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Convert Video to .ogv

Discussion in 'Scripting' started by _HAL_9000, Apr 22, 2016.

  1. _HAL_9000

    _HAL_9000

    Joined:
    Jun 26, 2015
    Posts:
    48
    Hello everyones !
    I am currently trying to convert video to .ogv to use them as movietexture in runtime. I have looked FFmpeg library and I am trying to use the NReco.videoConverter, I have created a script containing the lines from the NReco tutorial but when I launch the scene I had an error :

    Code (CSharp):
    1. DllNotFoundException: MonoPosixHelper
    2. System.IO.Compression.DeflateStream..ctor (System.IO.Stream compressedStream, CompressionMode mode, Boolean leaveOpen, Boolean gzip)
    3. (wrapper remoting-invoke-with-check) System.IO.Compression.DeflateStream:.ctor (System.IO.Stream,System.IO.Compression.CompressionMode,bool,bool)
    4. System.IO.Compression.GZipStream..ctor (System.IO.Stream compressedStream, CompressionMode mode, Boolean leaveOpen)
    5. (wrapper remoting-invoke-with-check) System.IO.Compression.GZipStream:.ctor (System.IO.Stream,System.IO.Compression.CompressionMode,bool)
    6. NReco.VideoConverter.FFMpegConverter.EnsureFFMpegLibs ()
    7. NReco.VideoConverter.FFMpegConverter.ConvertMedia (NReco.VideoConverter.Media input, NReco.VideoConverter.Media output, NReco.VideoConverter.ConvertSettings settings)
    8. NReco.VideoConverter.FFMpegConverter.ConvertMedia (System.String inputFile, System.String inputFormat, System.String outputFile, System.String outputFormat, NReco.VideoConverter.ConvertSettings settings)
    9. NReco.VideoConverter.FFMpegConverter.ConvertMedia (System.String inputFile, System.String outputFile, System.String outputFormat)
    10. VideoConvert.Start () (at Assets/Scripts/v0.2/VideoConvert.cs:13)

    my code :

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using NReco.VideoConverter;
    4.  
    5.  
    6. public class VideoConvert : MonoBehaviour {
    7.  
    8.     public string VideoPath;
    9.  
    10.     void Start () {
    11.         var ffMpeg = new NReco.VideoConverter.FFMpegConverter();
    12.         ffMpeg.ConvertMedia(VideoPath, "video.ogv", Format.ogg);
    13.     }
    14.  
    15. }
    16.  
    I have downloaded the FFmpeg dlls and put it in the Asset folder, it didn't worked.
    Then I put the NReco.VideoConverter in the Asset/Plugins folder with and without the FFmpeg dlls but it didn't work either.

    I have read on others topic that I will have to code an interface for the FFmpeg but since it is writen in C I really don't know how to make it. Furthermore I don't know why I would have to do that because nothing is said about that is the NReco.VideoConverter page.
    I am using Unity 5.3.4f1 Personnal edition.
     
  2. Janicich

    Janicich

    Joined:
    Apr 29, 2016
    Posts:
    1
    Try something like Digiber converter, a standalone tool that converts formats from one to another. http://www.digiber.com
     
    krisu likes this.
  3. Nateply

    Nateply

    Joined:
    May 20, 2014
    Posts:
    46
    krisu likes this.
  4. nreco

    nreco

    Joined:
    Aug 5, 2016
    Posts:
    1
    I understand that it is a bit late... but better late than never.

    I'm the author of NReco.VideoConverter; by default it embeds x86 version of ffmpeg and cannot be used with Unity.
    To support more platforms, I've introduced NReco.VideoConverter.LT build without embedded ffmpeg; it targets .NET 2.0, and can be referenced from Mono/Unity projects. LT build can be used with various ffmpeg builds, including Linux and OS-X.

    I've tested it with simple empty Unity project, and it seems it works fine. If someone wants to test LT build real-life Unity project, I'll send it upon request.
     
  5. infinite360VR

    infinite360VR

    Joined:
    Apr 19, 2016
    Posts:
    23
    @nreco I was about to bang my head with the wall but read your comment. I have to get thumbnail from mp4 video file. Can you provide the solution for this?
     
  6. unity839

    unity839

    Joined:
    Mar 28, 2014
    Posts:
    9
    @nreco I'd like the opportunity to try the LT build to experiment in Unity, I'm trying to create a small video from an array of images. May you please help? Thank you
     
  7. yujun411522

    yujun411522

    Joined:
    Feb 21, 2017
    Posts:
    1
    @nreco I'd like the opportunity to try the LT build to experiment in Unity, I'm trying to
    FFMpegConverter.GetVideoThumbnail(). May you please help? Thank you!!!
     
  8. rachelgreenhappy

    rachelgreenhappy

    Joined:
    Nov 28, 2018
    Posts:
    1
    As far as I know, iDealshare VideoGo works to convert video to OGV
    It also helps to convert OGV to other video formats
     
  9. Filestech

    Filestech

    Joined:
    Feb 28, 2020
    Posts:
    1
    string GetVideoFilePath
    string GetAudioFilePath
    var videoConverter = new NReco.VideoConverter.FFMpegConverter();
    videoConverter.ConvertMedia(GetVideoFilePath, GetAudioFilePath, "mp3");

    When I run the above code the error in picture occurs. Anyone who can come up with a solution please?
     

    Attached Files:

  10. blesshealth

    blesshealth

    Joined:
    Mar 2, 2020
    Posts:
    1
    I use Avdshare Video Converter to convert various video files to OGV. It also helps to convert OGV to MP4, AVI, MOV, MPG, MKV, 3GP etc.
    It has both Mac and Windows version