Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • AForge.Video.FFMPEG XamlParseException

    10 février 2017, par tobloef

    I'm trying to set up a simple C# application where I want to record multiple USB webcams and save their feeds to some files. I'm using AForge.NET since this seems to be the most popular option for this sort of application. I can record video fine using the AForge.Video.VFW AVIWriter but due to a number of reasons I need to use the AForge.Video.FFMPEG VideoFileWriter. Whenever I try to use this class however, I get a System.Windows.Markup.XamlParseException with no additional information or inner exceptions apart from a little additional information which is quite useless.

    I have a simple code example to trigger the exception:

    using AForge.Video.FFMPEG;
    
    namespace CameraPrototype {
        public partial class MainWindow {
            public MainWindow() {
                InitializeComponent();
    
                VideoFileWriter videoFileWriter = new VideoFileWriter();
            }
        }
    }
    

    I've also googled a bit around and tried some suggestion mentioned elsewhere:

    • Checking all the boxes in Exceptions Settings, enabling breaks on all types of exceptions. I had hoped this would give me some more info when the exception was thrown, unfortunately it doesn't change anything.
    • Copying the FFMPEG DLLs (swscale-2.dll, postproc-52.dll, etc) into the same folder as the application's built executable (../bin/Debug/). I 'm pretty sure the exception has something to do with ffmpeg, but this particular solution isn't working. Perhaps I'm doing something wrong here or I'm missing something for ffmpeg to work?

    If anyone have any idea what I might be doing wrong or how I can get more information about the exception, I would really appreciate any help. Let me know if I need to post any other information. Thanks!

    Edit: Though it doesn't really answer the question, I'm also open to suggestions for alternatives to AForge.NET, as long as it lets me record and save video from multiple USB webcams.

  • How to fallback the media data of file while writing by FFMPEG ?

    10 février 2017, par Jerikc XIONG

    How to delete part of the media content end of the file while writing by FFMPEG ?

    • The file is being writing by write_packet
    • The media data is end of the file
    • Using FFMPEG 2.8

    Writing packet at this moment like this:

    // the fd doesn't close
    1 2 3 4 5 6 7 8 9 
                    |
                    fd
    

    I need to delete 7 8 9 and the fd pointing 6 and ready to write the next one.

    // ready to write the next one
    1 2 3 4 5 6
              |
              fd
    

    Any suggestion is prefered, thanks.

  • Loop recursively for specific extension and subfolders

    10 février 2017, par kuruvi

    I have been trying to convert flac to m4a, I have the below script that does the job but it is not recursive:

    for f in *.flac; do
        ffmpeg -i "$f"  -vf "crop=((in_w/2)*2):((in_h/2)*2)" -c:a alac "${f%.flac}.m4a"
    done
    

    For recursive, I did try several ways but none worked, here is what I tried (space on file name is the problem here)

    for f in `find . $PWD -iname *.flac`; do
        ffmpeg -i "$f"  -vf "crop=((in_w/2)*2):((in_h/2)*2)" -c:a alac "${f%.flac}.m4a"
    done
    

    and this

    find . -type f -iname "*.flac" -print0 |
        while IFS= read -r -d $'\0' line; do
            echo "$line"
            ffmpeg -i "$line"  -vf "crop=((in_w/2)*2):((in_h/2)*2)" -c:a alac "${f%.flac}.m4a"; done   
        done
    

    None of them work.

  • Sample accurate audio slicing in ffmpeg ?

    10 février 2017, par Chris Coniglio

    I need to slice an audio file in .wav format into 10 second chunks. These chunks need to be exactly 10 seconds, not 10.04799988232 seconds.

    the current code I am using is

    ffmpeg -i test.wav -ss 0 -to 10 -c:a libfdk_aac -b:a 80k aac/test.aac
    
    ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
      built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
      configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --disable-lzma --enable-nonfree --enable-vda
      libavutil      55. 34.100 / 55. 34.100
      libavcodec     57. 64.101 / 57. 64.101
      libavformat    57. 56.100 / 57. 56.100
      libavdevice    57.  1.100 / 57.  1.100
      libavfilter     6. 65.100 /  6. 65.100
      libavresample   3.  1.  0 /  3.  1.  0
      libswscale      4.  2.100 /  4.  2.100
      libswresample   2.  3.100 /  2.  3.100
      libpostproc    54.  1.100 / 54.  1.100
    Guessed Channel Layout for Input Stream #0.0 : stereo
    Input #0, wav, from '/Users/chris/Repos/mithc/client/assets/audio/wav/test.wav':
      Duration: 00:04:37.62, bitrate: 2307 kb/s
        Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s
    Output #0, adts, to '/Users/chris/Repos/mithc/client/assets/audio/aac/test.aac':
      Metadata:
        encoder         : Lavf57.56.100
        Stream #0:0: Audio: aac (libfdk_aac), 48000 Hz, stereo, s16, 80 kb/s
        Metadata:
          encoder         : Lavc57.64.101 libfdk_aac
    Stream mapping:
      Stream #0:0 -> #0:0 (pcm_s24le (native) -> aac (libfdk_aac))
    Press [q] to stop, [?] for help
    size=     148kB time=00:00:15.01 bitrate=  80.6kbits/s speed=40.9x    
    video:0kB audio:148kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
    

    This code does not produce exact slices, any ideas how can this be accomplished?

  • How can I convert SWF(with parameter) to mp4 in server ?

    10 février 2017, par abby kim

    I want to make a personal video to a user.

    So each user will different parameter for SWF.

    I want to convert to mp4 and save it in a server.

    And show mp4 video.

    But I found a way from swf to mp4 using ffmpeg.

    But couldn't find a way with a parameter.

    Please help me.