Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Can't decode HEVC video with DXVA2 and ffmpeg

    10 mai 2018, par Igor

    I can't use DXVA2 hardware acceleration for decoding of HEVC video with ffmpeg. DXVA2 for H.264 works fine.

    I compiled an official example hw_decode.c from ffmpeg sources:

    https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/hw_decode.c

    When I call av_send_packet() it performs a callback assigned in AVCodecContext->get_format and returns only AV_PIX_FMT_YUV420P for HEVC video instead of AV_PIX_FMT_DXVA2_VLD for all H.264 videos. So HW decoding doesn't work.

    Software decoding of HEVC works without problems.

    MPC-HC plays fine HEVC video with DXVA2 (CPU loading is low and Task Manager shows work of Video decoder in GPU details). My video card is Geforce 1060.

  • segment time in ffmpeg c code

    10 mai 2018, par TraXxX

    I'm using remuxing.c

    I'm trying to add segment option to code like this:

    AVDictionary* headerOptions = NULL;
    av_dict_set(&headerOptions, "segment_time", "10", 0);
    avformat_write_header(&ofmt_ctx, &headerOptions);
    

    it's not working

  • segmnet time in ffmpeg c code

    10 mai 2018, par TraXxX

    I'm using remuxing.c

    I'm trying to add segment option to code like this:

    AVDictionary* headerOptions = NULL;
    av_dict_set(&headerOptions, "segment_time", "10", 0);
    avformat_write_header(&ofmt_ctx, &headerOptions);
    

    it's not working

  • How to get -vf to ffmpeg from powershell commandline without parsing

    10 mai 2018, par Tupsi

    I made a powershell function to recode video with some extra parameters. It basically makes a get-childitem in the directory and feeds every occurrence it finds to a foreach loop. This worked well as long as I have default values inside my function which gets fed to the ffmpeg string in the loop in case I do not provide anything on the commandline (like number of passes, audio quality etc.). Now I wanted to integrate the option to use the -vf ffmpeg filter option. My problem there is, that I usualy dont need that, so there is no sane default option I could use, so I can not have something like -vf $filteroption in my command line. So I am trying to figure out how to get that "-vf" inside the variable without powershell or ffmpeg screwing me over, because atm I get either the error of a missing - in what ffmpeg sees (I guess powershell parses this away) and when I \ escape the - I see it now in the ffmpeg line, but ffmpeg does not recognize it as single parameter.

    examples which work:

    &$encoder -hide_banner -i $i -c:v libvpx-vp9 -b:v 0 -crf $quality -tile-columns 6 -tile-rows 2 -threads 8 -speed 2 -frame-parallel 0 -row-mt 1 -c:a libopus -b:a $bitrate -af aformat=channel_layouts=$audio -c:s copy -auto-alt-ref 1 -lag-in-frames 25 -y $outfile;
    

    here I provide $quality, $audio etc. with powershell parameters to the function like -quality 31 -audio stereo and it all works.

    But now I need to get something like "-vf scale=1920:-1" or "" inside that line and that does not work with something like just this:

    &$encoder -hide_banner -i $i -c:v libvpx-vp9 -b:v 0 -crf $quality -tile-columns 6 -tile-rows 2 -threads 8 -speed 2 -frame-parallel 0 -row-mt 1 -c:a libopus -b:a $bitrate -af aformat=channel_layouts=$audio -c:s copy -auto-alt-ref 1 -lag-in-frames 25 -y $extra $outfile;
    

    when I call the function with: "RecodeVP9 -extra -vf scale=1920:-1" powershell takes away the -, if I try it with escaping the - with - ffmpeg whines about it saying that "Unable to find a suitable output format for '-vf'". I also tried "" and "-" with similiar results. So it seems that either powershell screws me over or ffmpeg.

    So to sum it up: I need a way to get extra ffmpeg arguments WITH the parameter name itself from the powershell command line into my powershell function (like -vf scale=1920:-1).

  • bash : syntax error near unexpected token `(' using ffmpeg

    10 mai 2018, par jameshwart lopez

    Im using ffmpeg to segment video. and use the following cammand

    ffmpeg -i "data/raw_data/000000005.avi" -vf fps=X -f segment -segment_time 0.0333333333333333 -force_key_frames expr:gte(t,n_forced*0.0333333333333333) -reset_timestamps 1 -segment_time_delta 1.0 -c:a copy "test_break_up/audios/%d.wav"
    

    The command above works on windows but when i run that command on ubuntu its throwing bash: syntax error near unexpected token('`

    Can anyone give me guidance on what to do. Thanks