Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • can ffmpeg change the codec param when codec running

    24 octobre 2014, par williamzhang

    I use ffmpeg 2.3.3 version to decode the TS stream. When I used avcodec_open2 to open the video codec, I will set the skip_loop_filter/skip_idct/skip_frame para. But this will decrease the video quality when I get the decode speed. It work well in HD stream, but in SD stream, the CPU is strong enough to decode all the frame, so I want to skip nothing.

    But the skip para is setting when open the codec, can these parameters changed when codec worked?

  • ffmpeg convert any user video file to run on mobiles h264 mp4

    24 octobre 2014, par tobros91

    So, i have kind of accepted this task on work but im really not sure if its possible.

    We are going to build a website where users can upload videos from their computers and mobile phone browsers. The video files can be a large range of aspect ratios, width, height, codex and file formats.

    I will have access to ffmpeg from php exec command on a web server.

    Is it possible to use this to convert the user files to one file format that works on computers, android and iphone.

    The requirements is that we can set a max width, to witch the video will be scaled, dynamically to match height.

    Does anyone know is this can be done, and be done in a reasonable amount of time. Will do project on 2 days. And if so some pointers in the right direction would be nice.

  • FFServer streaming H.264 from Logitech C920

    23 octobre 2014, par Ricardo Frederico Leote Mota

    I'm having some trouble trying to implement a web live stream from my Logitech C920 webcam w/ H.264 encoding using ffmpeg/ffserver.

    Here is the configuration file I'm using for the ffserver:

    # Port on which the server is listening. You must select a different
    # port from your standard HTTP web server if it is running on the same
    # computer.
    Port 8090
    
    # Address on which the server is bound. Only useful if you have
    # several network interfaces.
    BindAddress 0.0.0.0
    
    # Number of simultaneous HTTP connections that can be handled. It has
    # to be defined *before* the MaxClients parameter, since it defines the
    # MaxClients maximum limit.
    MaxHTTPConnections 2000
    
    # Number of simultaneous requests that can be handled. Since FFServer
    # is very fast, it is more likely that you will want to leave this high
    # and use MaxBandwidth, below.
    MaxClients 1000
    
    # This the maximum amount of kbit/sec that you are prepared to
    # consume when streaming to clients.
    MaxBandwidth 1000
    
    # Access log file (uses standard Apache log file format)
    # '-' is the standard output.
    CustomLog -
    
    ##################################################################
    # Definition of the live feeds. Each live feed contains one video
    # and/or audio sequence coming from an ffmpeg encoder or another
    # ffserver. This sequence may be encoded simultaneously with several
    # codecs at several resolutions.
    
    
    
    # You must use 'ffmpeg' to send a live feed to ffserver. In this
    # example, you can type:
    #
    
    File /tmp/feed.ffm
    FileMaxSize 100M
    
    # You could specify
    # ReadOnlyFile /saved/specialvideo.ffm
    # This marks the file as readonly and it will not be deleted or updated.
    
    # Only allow connections from localhost to the feed.
    ACL allow 127.0.0.1
    
    
    
    
    ##################################################################
    # Now you can define each stream which will be generated from the
    # original audio and video stream. Each format has a filename (here
    # 'test1.mpg'). FFServer will send this stream when answering a
    # request containing this filename.
    
    
    
    Feed feed.ffm
    Format mp4
    
    # Audio settings
    NoAudio
    
    # Video Settings
    #VideoSize 1280x720                      # Video resolution
    #VideoFrameRate 30                      # Video FPS
    #AVOptionVideo flags +global_header          # Parameters passed to encoder
    #AVOptionVideo cpu-used 0
    #AVOptionVideo qmin 10
    #AVOptionVideo qmax 42
    #AVOptionVideo quality good
    PreRoll 0
    StartSendOnKey
    #VideoBitRate 400                      # Video bitrate
    
    
    
    # Server status
    
    
    Format status
    
    # Only allow local people to get the status
    ACL allow localhost
    ACL allow 192.168.0.0 192.168.255.255
    
    
    
    
    # Redirect index.html to the appropriate site
    

    And here is the command I'm issuing through the command line and the respective output:

    ffmpeg -s 1280x720 -f video4linux2 -r 30 -vcodec h264 -re -i /dev/video0 -copyinkf -codec copy h**p://localhost:8090/feed.ffm
    ffmpeg version N-67036-g04a4fb8 Copyright (c) 2000-2014 the FFmpeg developers
      built on Oct 20 2014 17:39:50 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
      configuration: --enable-gpl --enable-libx264
      libavutil      54. 10.100 / 54. 10.100
      libavcodec     56.  8.102 / 56.  8.102
      libavformat    56.  9.101 / 56.  9.101
      libavdevice    56.  1.100 / 56.  1.100
      libavfilter     5.  2.100 /  5.  2.100
      libswscale      3.  1.101 /  3.  1.101
      libswresample   1.  1.100 /  1.  1.100
      libpostproc    53.  3.100 / 53.  3.100
    Input #0, video4linux2,v4l2, from '/dev/video0':
      Duration: N/A, start: 12614.859199, bitrate: N/A
        Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p(pc), 1280x720 [SAR 1:1 DAR 16:9], -5 kb/s, 30 fps, 30 tbr, 1000k tbn, 60 tbc
    Output #0, ffm, to 'h**p://localhost:8090/feed.ffm':
      Metadata:
        creation_time   : now
        encoder         : Lavf56.9.101
        Stream #0:0: Video: h264, yuvj420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, -5 kb/s, 30 fps, 1000k tbn, 30 tbc
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 0, current: -166263; changing to 1. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 1, current: -134365; changing to 2. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 2, current: -102381; changing to 3. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 3, current: -66434; changing to 4. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 4, current: -34548; changing to 5. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 5, current: -2645; changing to 6. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 232857, current: 138514; changing to 232858. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 232858, current: 167942; changing to 232859. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 232859, current: 197415; changing to 232860. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 232860, current: 227037; changing to 232861. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 997959, current: 938599; changing to 997960. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 997960, current: 995052; changing to 997961. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 1240745, current: 1232841; changing to 1240746. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 1293561, current: 1282157; changing to 1293562. This may result in incorrect timestamps in the output file.
    frame=   69 fps= 34 q=-1.0 Lsize=     912kB time=00:00:02.01 bitrate=3702.1kbits/s
    

    When I try to play the stream with VLC for example - vlc h**p://localhost:8090/stream.mp4 - i get the following error:

    [00007f5234003948] core stream error: cannot pre fill buffer

    And I can't watch the stream on the web browser side also.

    Could someone give me an hint on this?

    Many thanks and your help is much appreciated! ;)

  • ffplay and ffmpeg subtitles/ass filters errors/crash

    23 octobre 2014, par Mr Almighty

    I'm trying to use ffplay with subtitle and embed/burn a subtitle in a video. I tried to load a .mkv file with a subtitle burned/embed in ffplay and nothing, tried using the -sst option, and nothing. Then I tried subtitles filter with a .mp4 file and a .srt file.:

    ffplay video.mp4 -vf subtitles="video.srt"

    ...and I got this error:

    [Parsed_subtitles_0 @ 00000000064956e0] No usable fontconfig configuration file found, using fallback.

    Fontconfig error: Cannot load default config file

    I realized that MPlayer generates a font folder with the config file on it, then I copied that folder, placed in the same folder that ffplay is located, and... errors:

    Fontconfig warning: FcPattern object size does not accept value 0

    And then it crashes.

    I tried the same with ffmpeg:

    ffmpeg -i video.mp4 -vf subtitles="video.srt" output.mp4

    And the same errors and crash.

    What am I doing wrong? And how can I fix this?

  • Does the "live=1" on ffmpeg rtmp urls mean that the stream is live and you cannot rewind or pause it ?

    23 octobre 2014, par user306517

    Or does it have some other meaning? I have searched all over the internet, and the documentation is very thin on it... If someone could point me to something that explains exactly what it is, I would appreciate it.

    I am talking about this:

    ffmpeg "rtmp://...... live=1" .....

    tia.