Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFmpeg + ffplay bad codec ?

    26 avril 2014, par Tomas Lysek

    i am creating video player by using ffmpeg.

    But when i install ffmpeg and use ffplay to any video (for instance clock.avi) i had this result:

    Image with bad video

    Input #0, avi, from 'video.avi':
      Duration: 00:00:12.00, start: 0.000000, bitrate: 55 kb/s
        Stream #0:0: Video: msrle ([1][0][0][0] / 0x0001), pal8, 321x321, 1 fps, 1 tbr, 1 tbn, 1 tbc
      Metadata:
          title           : CLOCK.avi Video #1
    Stream #0:1: Audio: truespeech ([34][0][0][0] / 0x0022), 8000 Hz, mono, s16, 8 kb/s
    Metadata:
      title           : Microsoft Waveform: 12TONEt2.WAV
    

    I am using latest ffmpeg and ubuntu 12.04. I tried install ubuntu-restricted-extras, but it doesn't help.

    Any thoughts ? Thanks !

  • ffmpeg - recode to lower bitrate + remove audio + watermark

    26 avril 2014, par Ove Sundberg

    I'm a complete noob to ffmpeg and I'm trying to do a couple of things in the same call:

    1) recode a video to a lower bitrate

    2) remove audio

    3) add a watermark center bottom

    4) save output as .webm

    With a bit of RTFM and scouring for examples I have managed to achieve of 1, 2 and 4 with:

    ffmpeg -i hires.mp4 -c:v libvpx -crf 10 -b:v 128k -r 24 -an -c:a libvorbis output-file.webm
    

    This call adds a watermark center bottom:

    ffmpeg -i hires.mp4 -i watermark.png -filter_complex "overlay=main_w/2-overlay_w/2:main_h-overlay_h-10" output-file.webm
    

    Now I struggle to combine the two. The second -i option is the watermark. Therefore I would have thought that

    ffmpeg -i hires.mp4 -c:v libvpx -crf 10 -b:v 128k -r 24 -an -c:a libvorbis -i watermark.png -filter_complex "overlay=main_w/2-overlay_w/2:main_h-overlay_h-10"  output-file.webm
    

    would do the trick. It does not off course, the error I get is

    Option b:v (video bitrate (please use -b:v)) cannot be applied to input file watermark.png -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to. Error parsing options for input file watermark.png. Error opening input files: Error number -22 occurred
    

    So I have the options all messed up. I've tried moving the options around but with no luck. I'd really appreciate some help here.

  • FFMPEG "Error setting GOP size" when converting from mp4 to ogg

    25 avril 2014, par gCardinal

    I built a little internal website to upload and convert videos using Symfony2, PHP-FFMPEG (via this bundle: https://github.com/pulse00/ffmpeg-bundle). It worked fine on my dev machine, a PC, but it refuses to work on my prod machine, a ubuntu server, outputting "[libtheora @ 0x17f7380] Error setting GOP size" whenever I run the command.

    Here is said command:

    ffmpeg -y -i url/to/input.mp4 -vcodec libtheora -acodec libvorbis -b:v 1000k -refs 6 -coder 1 -sc_threshold 40 -g 30 -flags +loop -me_range 16 -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -trellis 1 -b:a 128k url/to/output.ogg
    

    This is generated by PHP-FFMPEG so I don't really have any control over it.

    I'll admit that I don't really understand ffmpeg, so my knowledge is limited, but I don't see any -g parameter where it could be trying to set the GOP size and anyways, I'm guessing, if it worked on my dev, it should also work on the prod machine, right?

    I figured I should maybe include an output of both ffmpeg versions: http://i.imgur.com/ec4MnKl.png

    I don't feel like this is the source of the problem, but like I said, I know little about ffmpeg so it could be!

    Thanks a lot to anyone reading this and even more to those taking the time to answer :)

    Edit: I tried running the most basic command I could

    ffmpeg -i foo.mp4 foo.ogg
    

    And it outputs the same error. Again, with my limited knowledge, I'm starting to think my install of ffmpeg just can't handle the ogg format. I'll keep digging.

  • How to use hardware accelearation with ffmpeg

    25 avril 2014, par ixSci

    I need to have ffmpeg decode my video(e.g. h264) using hardware acceleration. I'm using the usual way of decoding frames: read packet -> decode frame. And I'd like to have ffmpeg speed up decoding. So I've built it with --enable-vaapi and --enable-hwaccel=h264. But I don't really know what should I do next. I've tried to use avcodec_find_decoder_by_name("h264_vaapi") but it returns nullptr. Anyway, I might want to use others API and not just VA API. How one is supposed to speed up ffmpeg decoding?

    P.S. I didn't find any examples on Internet which uses ffmpeg with hwaccel.

  • How to identify the packet which belongs the first video frame in ffmpeg ?

    25 avril 2014, par Vinay

    I am fetching the PTS values as soon as I start reading the frame usingav_read_frame () and the PTS values do not exactly correspond with the time stamp in the video. After googling for a while I understood the when we make a call to avcodec_decode_video2 () it calls back get_buffer2 () if the packet is beginning of a frame. So if I save the PTS now that will serve my purpose. My question is how do I know when I send a packet to avcodec_decode_video2 () is calling this get_buffer2 () function.