Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Extracting audio from video per video frame (C++) [on hold]

    5 septembre 2015, par PaulZyCZ

    Several days ago I had written an interface (in C) to simple DLL library which processes video in OpenCV using Qt5 framework. There is a function which takes frame ID and returns the raw picture data of the frame (so it can be played in Unity using C#). There is however no function to extract corresponding audio. So I am looking for a way to write such a function.

    I am thinking of a way to extract audio from video file (say MP4 with MPEG-4), with length of the corresponding video frame. But so far I have found only tutorials about extracting whole track (via FFMPEG) either to save or play the sound.

    Is there a way to extract only a "frame" (1/fps seconds of audio)? Or would it be better to create indexes and extract whole track?

    Thank you for answers.

    PS: Usual questions deal with whole track, not one frame-length sample specified by video frame ID. I have little knowledge of the FFMPEG and it has been several months since I used it last in uni project.

    I have frame, it's ID, but no sound to it.

  • Fluent-ffmpeg "not a suitable output format"

    5 septembre 2015, par J4G

    I'm using the fluent-ffmpeg module for Node.js to convert audio files. I have a .mp3 file that I'd like to convert to .wma

    Here's what that looks like:

    var proc = new ffmpeg({
       source: 'file.mp3',
       nolog: false
    }).toFormat('wma')                                                
      .saveToFile('file.wma', function(stdout, stderr)
    {                                                 
        console.log(stderr);
    });
    

    Unfortunately, I get the error:

    Requested output format 'wma' is not a suitable output format
    

    This is the entire error log:

    ffmpeg version 0.8.9-4:0.8.9-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers
      built on Nov  9 2013 19:25:10 with gcc 4.6.3
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    Input #0, mp3, from 'song_downloads/You Suffer.mp3':
      Metadata:
        title           : You Suffer
        artist          : Napalm Death
        album           : Scum
        genre           : Death Metal
        track           : 12
        date            : 1987
      Duration: 00:00:04.98, start: 0.000000, bitrate: 381 kb/s
        Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 193 kb/s
    Requested output format 'wma' is not a suitable output format
    

    I know this isn't an ffmpeg issue because

    ffmpeg -i file.mp3 file.wma
    

    Works fine. Any ideas?

  • How to generate submanifests based on offset and duration

    5 septembre 2015, par ayniam

    I am using hls-segment-reader for generating sub-manifests from a master manifest file.

    I want to provide an offset and duration to generate sub-manifest file. however, i am not able to find how can I pass them

    Any help in this regard is greatly appreciated.

    Thanks in Advance.

  • How to pass Ruby's STDIN to an external program called by Open3.popen3 ?

    4 septembre 2015, par Konstantin

    I would like to call ffmpeg from a Ruby script, lets call "vpipe", and I want this Ruby script to act as a filter like command: take its input from a pipe. Its only purpose is to select the first audio stream and delete chapters data if exists:

    #!/usr/bin/ruby
    require "open3"
    
    output_file=ARGV[0]
    
    cmd=%Q{ffmpeg -y -i - -map 0:v -map 0:a -c:v copy -c:a:0 copy -map_chapters -1 #{output_file}}
    
    Open3.popen3(cmd,:stdin_data=>STDIN)
    

    Then I would like to call my program as follows:

    curl http://www.example.com/video.wmv | vpipe processed.wmv
    

    Unfortunately doesn't work, because there is no such an option for popen3 as :stdin_data. I also tried Open3.capture3 which can take this argument, but then I got en error message from curl: "Failed writing body".

  • webm dash encoding... What are the correct ffmpeg parameters ?

    4 septembre 2015, par DeanL

    I'm stumped with encoding videos into a dash compliant format. I'm going from .mp4 to .webm

    Firstly, I am running OS X and ffmpeg 2.5.4.

    Here's the encoding commands I am using in my test (I got these from here):

    ffmpeg -i IMG_0113.mp4 -c:v libvpx-vp9 -s 160x90 -b:v 25k -g 1 -tile-columns 4 -frame-parallel 1 -an -f webm -dash 1 video_160x90_25k.webm
    
    ffmpeg -i IMG_0113.mp4 -c:v libvpx-vp9 -s 160x90 -b:v 50k -g 1 -tile-columns 4 -frame-parallel 1 -an -f webm -dash 1 video_160x90_50k.webm
    
    ffmpeg -i IMG_0113.mp4 -vn -acodec libvorbis -ab 128k  -dash 1 audio_128k.webm
    
    ffmpeg -f webm_dash_manifest -i video_160x90_25k.webm -f webm_dash_manifest -i video_160x90_50k.webm -f webm_dash_manifest -i audio_128k.webm -c copy -map 0 -map 1 -map 2 -f webm_dash_manifest -adaptation_sets "id=0,streams=0,1 id=1,streams=2" manifest.mpd
    

    Secondly, the problem is not with my server, as I have downloaded the samples from here, and they work 100% on the dash.js player when served from my local server.

    Please could someone out there point me in the right direction? Or provide a sample of the ffmpeg commands used to get the output format correct.

    Thanks, Dean.