Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Is it possible to dynamically change video encoder parameters ?

    27 mars 2017, par Andi Domi

    I would like to know if I can dynamically change video encoder parameters for a given video? For example I would like to start encoding a raw video in H.264/H.265 for the first 10s in 30fps and then, while the encoder is still working, change the fps to 20 for the rest of it. Thanks in advance for your help.

  • Im getting error "deprecated pixel format used, make sure you did set range correctly using ffmpeg".. can someone check my code below ?

    27 mars 2017, par Mavs Mavs

    This is my code using ffmpeg i want to have video thumbnail but im not familiar in ffmpeg can someone know the error i got.

    [swscaler @ 0x7ff8da028c00] deprecated pixel format used, make sure you did set range correctly
    Output #0, mjpeg, to 'image.jpg':
    Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf56.36.100
    Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 320x240 [SAR 4:3 DAR 16:9], q=2-31, 200 kb/s, 1 fps, 1 tbn, 1 tbc (default)
    Metadata:
      creation_time   : 2016-11-06 09:40:22
      handler_name    : ISO Media file produced by Google Inc.
      encoder         : Lavc56.41.100 mjpeg
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
    Press [q] to stop, [?] for help
    frame=    1 fps=0.0 q=4.8 Lsize=      16kB time=00:00:01.00 bitrate= 129.5kbits/s    
    video:16kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
    

    Also This is my code:

    $video_url ='https://URL/upload/4b8acab123563649f19e07450d810df6.mp4';
    
    
     $ffmpeg = '/opt/local/bin/ffmpeg';
     $image = 'image.jpg';
     $interval = 5;
     $size = '320x240';
     shell_exec($tmp = "$ffmpeg -i $video_url -deinterlace -an -ss $interval -f mjpeg -t 1 -r 1 -y -s $size $image 2>&1");  
    
  • ffmpeg & watermark issue on convert movie

    27 mars 2017, par Sebastian Schweinste

    after update of WinFF i get error:

    "C:\Program Files (x86)\WinFF\ffmpeg.exe" -t 0:00:25 -y -i "c:\Videos\temp\input.mpg" -f mp4  -r 14 -vcodec libx264 -coder 1 -flags +loop+cgop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method hex -subq 7 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 0 -qmax 69 -qdiff 4 -bf 3 -refs 3 -direct-pred 1 -trellis 1 -wpredp 2 -vf scale=240:180 -aspect 4:3 -maxrate 800k -bufsize 80k -b:v 400k -ar 44100 -b:a 80k -ac 2 -b 650k  -vf "movie="c:\Videos\watermarklogo.png" [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" "c:\Videos\new\output.mpg"
    

    error: Filtergraph 'scale=240:180' was specified through the -vf/-af/-filter option for output stream 0:0, which is fed from a complex filtergraph. -vf/-af/-filter and -filter_complex cannot be used together for the same stream.

    i downt know how to fix

  • Ffmpeg to convert gif to webm with reverse function

    27 mars 2017, par user3306104

    I'm trying to convert a gif file to webm file using the below which works fine however I’m wondering is it also possible to reverse it as well using ffmpeg or would I need to reverse it using imagemagick first then cover it using ffmpeg

    ffmpeg -i your_gif.gif -c:v libvpx -crf 12 -b:v 500K output.webm
    

    Any help is appreciated

  • MediaPlayer miscalculates audio duration. getCurrentPosition() goes back when audio reaches the end

    26 mars 2017, par Kacy

    I'm streaming .ogg files from my server. The MediaPlayer plays the song to completion, but when it reaches the end of the song, getCurrentPosition() returns a time less than the actual duration of the song. For 1 song it's only off by a second, but for another song it's off by 13 seconds.

    I have a SeekBar that's updated every second by calling getCurrentPosition(), and once the bar reaches the end, it actually jumps back a few seconds. And I can no longer use seekTo() into the segment of the song that's past the miscalculated duration because I receive the error: Attempt to seek to past end of file.

    Chrome's html video element simply displays the songs with the incorrect durations.

    Other tools like ffmpeg or this app on Windows 10 called PowerMediaPlayer both calculate the songs' durations perfectly.

    I believe this problem is related to this answer, but the solution assumes ffmpeg also miscalculates the duration, which is not the case here. Using the -vn flag when converting audio files to ogg didn't change anything.

    What are my options? Is there a way to get the MediaPlayer to calculate the correct duration?

    Update:

    Converting to mp3 has no issues (although I used audioBitrate('96k')instead of audioQuality(2), but I require a solution to get ogg files working. Below is how I'm using ffmpeg to perform the conversion. Another thing worth noting is that when I used 'vorbis' instead of 'libvorbis' for the codec the durations were off by less than a second, if at all. However, I must use 'libvorbis' because 'vorbis' is experimental and results in significanlty inconsistent bitrates across different files given the same audio quality parameter. (And it ignores audioBitrate() entirely.)

    ffmpeg( filepath )
        .toFormat( 'ogg' )
        .audioCodec( 'libvorbis' )
        .audioQuality( 2 )
        .output( destination )
        .run();