Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • opencv2 can't load video on mac

    28 novembre 2016, par bogun

    I can't use cv2.VideoCapture('test.avi') to load my local video. I had installed ffmpeg using brew install ffmpeg When i try to run the code cv2.VideoCapture(test.avi), the python process will crash, here is the error log:

    '2016-11-28 18:18:47.768 Python[20241:277423] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array
    

    *** First throw call stack: ( 0 CoreFoundation 0x00007fffa44b148b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x00007fffb8c13cad objc_exception_throw + 48 2 CoreFoundation 0x00007fffa43cad8c -[__NSArrayM objectAtIndex:] + 204 3 libopencv_highgui.2.4.dylib 0x0000000109be9270 _ZN13CvCaptureFileC2EPKc + 350 4 libopencv_highgui.2.4.dylib 0x0000000109be7ce2 _Z32cvCreateFileCapture_AVFoundationPKc + 34 5 libopencv_highgui.2.4.dylib 0x0000000109bdb7de cvCreateFileCapture + 14 6 libopencv_highgui.2.4.dylib 0x0000000109bdba8e _ZN2cv12VideoCapture4openERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 64 7 libopencv_highgui.2.4.dylib 0x0000000109bdb8ee _ZN2cv12VideoCaptureC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 42 8 cv2.so 0x0000000109387bce _ZL34pyopencv_VideoCapture_VideoCaptureP7_objectS0_S0_ + 275 9 Python 0x0000000109052534 PyEval_EvalFrameEx + 14624 10 Python 0x000000010904ea1e PyEval_EvalCodeEx + 1617 11 Python 0x000000010904e3c7 PyEval_EvalCode + 48 12 Python 0x000000010906e63d PyParser_ASTFromFile + 297 13 Python 0x000000010906e46b PyRun_InteractiveOneFlags + 377 14 Python 0x000000010906df5f PyRun_InteractiveLoopFlags + 192 15 Python 0x000000010906de09 PyRun_AnyFileExFlags + 60 16 Python 0x000000010907fbca Py_Main + 3094 17 libdyld.dylib 0x00007fffb94f2255 start + 1 18 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException Abort trap: 6

    I guess the video's codec could be wrong, but i don't know how to fix it.

  • Grab vtt subtitles from m3u8 stream

    28 novembre 2016, par Ekonoval

    I have a video stream http://content.uplynk.com/ext/6790c94a453741799d3f3fb3bc9023a4/2493079.m3u8 which can be perfectly grabbed by ffmpeg command

    ffmpeg -i "http://content.uplynk.com/ext/6790c94a453741799d3f3fb3bc9023a4/2493079.m3u8" -c copy CMA.ts

    In this m3u8 list there is a subtitles stream http://content-aeui1.uplynk.com/395e08dcb0b54a3781d34d0b840df075/sub3.m3u8 , which has several vtt parts.

    Is there a way to grab those vtt parts into single vtt file and then convert to some common format like srt ?

    Or maybe there is a way to grab video with subtitles embedded?

  • How to clip video and resize without lost frames using ffmpeg

    28 novembre 2016, par Mryoun

    I want clip my video time from some seconds to other seconds with crop it. so i tried command like this:

    ffmpeg -y -ss 0.648 -i girl.mp4 -t 20.0 -acodec copy -filter:v crop=262:ih:252:0 girl_den.mp4 
    

    but compare the result with the playing command:

    ffplay -ss 0.648 girl.mp4 -t 20.0 -vf "crop=262:ih:252:0" 
    

    it's seems some frame that in front was lost. need help

  • FFmpeg open codec error when using "MobileVLCKit-prod" pod Swift

    28 novembre 2016, par OuSS

    I want to use VLCMediaPlayer into my project to live stream

    I'm using pod 'MobileVLCKit-prod'

    and this is my code

    class CameraViewController: UIViewController,VLCMediaPlayerDelegate{
    
      var mediaPlayer = VLCMediaPlayer()
    
      override func viewDidLoad() {
          super.viewDidLoad()
    
          mediaPlayer.delegate = self
          mediaPlayer.drawable = playerView
          let url = NSURL(string: "URL HERE")
          mediaPlayer.media = VLCMedia(URL: url!)
          mediaPlayer.play()
      }
    }
    

    When i run my app i got ffmpeg open codec error : Screenshot of Codec Error

  • FFMPEG on Linux (Mono)

    28 novembre 2016, par Paulo Anjos

    I'm creating a Discord Bot and I'm using Dot.Net. So I downloaded the necessary libs (ffmpeg and opus [for Discord]) and I'm running the .exe with Mono.

    I'm downloading a video file (mp4) and using FFMPEG to adjust the audio (16-bit, 48000Hz, PCM, 2 channels) and send it to the Discord Channel.

    It works fine on Windows but it refuses to on Linux (Ubuntu 14.04). It justs hangs and doesn't do anything else like this image shows.

    Same .exe but in Windows now (to compare if needed): image link

    I thought it was something with my Virtual Private Server but the same problem occured with my local Ubuntu 14.04 virtual machine.

    Code to send the song to Discord (Dot.Net):

    async public void playAudio(Music m)
    {
        string path = "mp4" + Path.DirectorySeparatorChar + m.videoid + ".mp4";
        Process mProcess = Process.Start(new ProcessStartInfo
        {
            FileName = "ffmpeg",
            Arguments = //"-loglevel quiet " +
            "-i " + (char)34 + path + (char)34 + " " +
            "-f s16le -ar 48000 -ac 2 pipe:1",
            UseShellExecute = false,
            CreateNoWindow = false,
            RedirectStandardOutput = true, //stdout of the process
            RedirectStandardError = false,
            Verb = "runas"
        });
        while (!Utils.isRunning(mProcess)) { await Task.Delay(500); }
    
        while (true)
        {
            int blockSize = 3840;
            byte[] buffer = new byte[blockSize];
            int byteCount;
            byteCount = mProcess.StandardOutput.BaseStream.Read(buffer, 0, blockSize);
            if (byteCount == 0)
                break;
            if (stop_music)
                break;
            bot_audio.Send(buffer, 0, byteCount); //Send to Discord
        }
        ...
    }
    

    I find a little odd the libavresample 3. 1. 0 / 3. 1. 0 at the image (missing lib maybe?).

    Any thoughts?