Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFMPEG says file does not exist, but, it exists

    11 décembre 2013, par cmw

    I'm using FFMPEG via the streamio-FFMPEG Rails gem – https://github.com/streamio/streamio-ffmpeg

    For some reason, when trying to transcode a video file (that does really exist), FFMPEG says the file does not exist.

    Here's some output from the Rails console, demonstrating my headache:

    1.9.3p125 :001 > File.exist?("/Applications/MAMP/htdocs/video-app/public/uploads/tmp/20131208-1416-1234-0984/videotest.mp4")
     => true 
    
    1.9.3p125 :002 > FFMPEG::Movie.new("/Applications/MAMP/htdocs/video-app/public/uploads/tmp/20131208-1416-1234-0984/videotest.mp4")
    Errno::ENOENT: No such file or directory - ffmpeg -i /Applications/MAMP/htdocs/video-app/public/uploads/tmp/20131208-1416-1234-0984/videotest.mp4
      from /Users/my-comp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/open3.rb:202:in `spawn'
      from /Users/my-comp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/open3.rb:202:in `popen_run'
      from /Users/my-comp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/open3.rb:90:in `popen3'
      from /Users/my-comp/.rvm/gems/ruby-1.9.3-p125@video-app/gems/streamio-ffmpeg-1.0.0/lib/ffmpeg/movie.rb:17:in `initialize'
      from (irb):2:in `new'
      from (irb):2
      from /Users/my-comp/.rvm/gems/ruby-1.9.3-p125@video-app/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
      from /Users/my-comp/.rvm/gems/ruby-1.9.3-p125@video-app/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
      from /Users/my-comp/.rvm/gems/ruby-1.9.3-p125@video-app/gems/railties-3.2.8/lib/rails/commands.rb:41:in `    '
      from script/rails:6:in `require'
      from script/rails:6:in `
    ' 1.9.3p125 :003 >

    Any help would be appreciated.

  • Xuggle IMediaWriter error

    10 décembre 2013, par prinsen

    Im testing xuggle and ran into a strange error. I have looked at the example in the documentation, and the xuggle-related code is identical. (http://www.xuggle.com/public/documentation/java/api/com/xuggle/mediatool/IMediaWriter.html)

    public class StorageServer {
    
    private final static String storage = "storage.mp4";
    private final static IMediaWriter writer = ToolFactory.makeWriter(storage);
    
    private final static Dimension dimension = new Dimension(320, 240);
    protected final static Logger logger = LoggerFactory.getLogger(StorageServer.class);
    
    public static void main(String[] args) {
    
        writer.addVideoStream(0, 0, ICodec.ID.CODEC_ID_MPEG4,
                320, 240);
        //setup the connection
        StreamServerAgent serverAgent = new StreamServerAgent(new StreamFrameListenerIMPL(), dimension);
        serverAgent.start(new InetSocketAddress("localhost", 1337));
    }
    
    
    protected static class StreamFrameListenerIMPL implements StreamFrameListener {
        private volatile long count = 0;
    
        @Override
        public void onFrameReceived(IVideoPicture image) {
            logger.info("frame received :{}", count++);
            if (count < 100) {
                logger.info("Writing frame");
                writer.encodeVideo(0, image);
            } else if (count > 220) {
                // writer.flush(); // doesn't matter
                writer.close();
            }
        }
    
    }
    

    When writer.close is called I get a runtime exception:

    Error: cannot write packet to read only container
    

    Which seems really strange..

  • suggestions for using protocol to stream images

    10 décembre 2013, par Abdul Ali

    The target is that a user sends a stream of images to a server. The server should forward those to a media server for showing as a live continuous video to clients.

    following are the thought for implementing, kindly tell if they are ok.

    Use a lightweight rtmp server to accept stream of images from a user (please suggest if this is even possible via rtmp and if it cab be easiy and efficiently done otherwise)

    use ffmpeg to use the rtmp (or other) url as input and send those images to ffserver for streaming. (am also confused here, if ffserver is fed with images continuosly, can it show those images as video as long as the images are coming)

  • Stream ffmpeg output to flash player in node.js

    10 décembre 2013, par dave

    I'm using ffmpeg to take a video source and live stream it to the browser in flash.

    Here's the code (using expressjs):

    app.get('/stream', function(req, res) {
    
        var command = spawn('ffmpeg', ['-re','-i','video.avi','-c:v','libx264','-c:a','libfaac','-ar',44100,'-f','flv','-']);
    
        res.setHeader("Accept-Ranges", "bytes");
        res.setHeader("Content-Type", "video/x-flv");        
        command.stdout.pipe(res);
    
    });
    

    EDIT: The command this uses is:

    ffmpeg -re -i video.avi -c:v libx264 -c:a libfaac -ar 44100 -f flv -

    If I load this URL in the browser directly, it downloads the flv file and I can play it back in VLC player. However, when I use this in a player like JWPlayer or even try to simply embed, it doesn't show or anything.

    Any idea what I could be missing here?

    Thank you!

    EDIT: Here's the output from ffmpeg, after this it's just the bytes that continue on as it encodes.

    ffmpeg version N-52420-gfc69033 Copyright (c) 2000-2013 the FFmpeg developers
      built on Apr 25 2013 17:10:30 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
      configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libaacplus --enable-libass --enable-libcelt --enable-libfaac --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-openssl --enable-libopus --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --prefix=/usr/local
      libavutil      52. 27.100 / 52. 27.100
      libavcodec     55.  6.100 / 55.  6.100
      libavformat    55.  3.100 / 55.  3.100
      libavdevice    55.  0.100 / 55.  0.100
      libavfilter     3. 60.101 /  3. 60.101
      libswscale      2.  2.100 /  2.  2.100
      libswresample   0. 17.102 /  0. 17.102
      libpostproc    52.  3.100 / 52.  3.100
    [avi @ 0x7ffb12004800] non-interleaved AVI
    Input #0, avi, from 'video.avi':
      Metadata:
        encoder         : AVI-Mux GUI 1.17.8.3, Feb 16 201019:42:50
        JUNK            : 
      Duration: 01:58:39.79, start: 0.000000, bitrate: 1710 kb/s
        Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x304 [SAR 1:1 DAR 45:19], 29.97 tbr, 29.97 tbn, 29.98 tbc
        Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 192 kb/s
        Metadata:
          title           : videotest
    [libx264 @ 0x7ffb12022000] using SAR=1/1
    [libx264 @ 0x7ffb12022000] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
    [libx264 @ 0x7ffb12022000] profile High, level 3.0
    [libx264 @ 0x7ffb12022000] 264 - core 125 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, flv, to 'pipe:':
      Metadata:
        JUNK            : 
        encoder         : Lavf55.3.100
        Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 720x304 [SAR 1:1 DAR 45:19], q=-1--1, 1k tbn, 29.97 tbc
        Stream #0:1: Audio: aac ([10][0][0][0] / 0x000A), 44100 Hz, 5.1, s16, 128 kb/s
        Metadata:
          title           : videotest
    Stream mapping:
      Stream #0:0 -> #0:0 (mpeg4 -> libx264)
      Stream #0:1 -> #0:1 (ac3 -> libfaac)
    Press [q] to stop, [?] for help
    FLVme=  -43 fps= 28 q=0.0 size=       0kB time=00:00:01.48 bitrate=   2.2kbits/s    
    videodatarateionframerate@=?Q??s
    audiodatarate@_@audiosamplerate@刀audiosamplesize@0stereo
                                                             audiocodecid@$JUNKencoder
                                                                                      Lavf55.3.10filesize   8   -d??gd??@?'?c1--?h???"??0   ?B?????E???H??,? ?#??x264 - core 125 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00?Re??g?$?<<
    
  • Threads creating process in infinite loop

    10 décembre 2013, par bhupinder

    In my application a thread runs while(1){} in it so thread terminates when my app is terminated by user.

    Is it safe to do like this? I am using while(1){} because my app continuously monitors devices on system.

    After some time I am getting "(R6016) not enough space for thread data" on ffmpeg.

    I read this but did not get solution of my problem:

    http://support.microsoft.com/kb/126709

    Thread description: Thread uses ffmpeg and handle utility (http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx). within while(1){} loop.

    ffmpeg and handle is running through QProcess which I am deleting after process ends.

    while(1){} loop waits for 5 seconds using msleep(5000).