Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Settings required to set to emulate the FFMPEG '-sameq' flag when using libavcodec
14 novembre 2013, par Jonathan WebsdaleCurrently attempting to use libavcodec to transcode MP4 (MPEG4 and H264) and MPG (MPEG2) video files into .MP4, .MPG and .AVI files. Have done this previously using FFMpeg.exe with use of the '-sameq' flag to retain the same/similar quality output file to that of the input file.
Now using av_open_input_file, av_read_frame and avcodec_decode_video2 to open, read and decode the input file, then assigning a AVCodecContext and encoding the data using avcodec_encode_video. However the output file video quality is pretty poor.
These are the AVCodecContext settings I'm using?:-
codecContextOutput->width = SAME AS INPUT FILE; codecContextOutput->height = SAME AS INPUT FILE; codecContextOutput->pix_fmt = SAME AS INPUT FILE; /* frames per second */ AVRational ar; ar.num = 1; ar.den = 25; codecContextOutput->time_base = ar; codecContextOutput->gop_size = 10; /* emit one intra frame every ten frames */ codecContextOutput->max_b_frames=1; codecContextOutput->bit_rate = 480000;
Does anybody know the additional settings needed to emulate the '-sameq' setting or what additional settings are needed in the AVCodecContext to improve the output quality?
-
how to improve quality with ffmpeg flv [closed]
14 novembre 2013, par user692601i'm haveing problem when converting movies to FLV, i get a lot of small squares in the picture. maybe someone know why? and how i can remove those squares and make picture better? my code is:
ffmpeg -i movie.mp4 -f mpegts -acodec libmp3lame -ar 48000 -ab 128k -s 320.240 -vcodec libx264 -b 320k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 7 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 10M -bufsize 10M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -g 30 -async 2 out.flv
thanks!
-
Ffmpeg & PHP - Small Clip with Good Quality
14 novembre 2013, par FakeHealwhat are the best options to keep video in nearly good quality while converting it to flv and shrinking its size?
I use the followin code now:
exec("ffmpeg -i $faila -sameq -s 600x450 -ar 44100 $file_final");
-
ffmpeg setting for HD and normal quality
14 novembre 2013, par gabo84Hello i need to have two versions of the same file stored on my server, medium and HD quality, the thing is that don't really know ffmpeg that well so im just trying this is code at random, i'm using the code belo but I end up with a much larger file, however it works,it plays.
ffmpeg -i inputfile.wmv -vcodec libx264 -ar 44100 -b 200 -ab 56 -crf 22 -s 360x288 -vpre medium -f flv tmp.flv
Just need the two commands to create the 2 different files
-
Do FFMPEG H264 compression presets affect the video quality ? [closed]
14 novembre 2013, par angainorI am definitely not an FFMPEG expert, but according to this document:
A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). General usage is to use the slowest preset that you have patience for. Current presets in descending order of speed are: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo.
So as I understand it, the
ffmpeg
presets should not affect the quality of the output video, but should only determine the compression ratio / output file size. Consequently, assuming the same quality setting (I will use-crf 24
), the files should be larger for e.g.,faster
preset than for theslower
preset. That would be the only reason to use a slower preset - to get a smaller file size.This turns out not to be the case. I encode a HD stream from a handycam using different presets, everything else is the same:
ffmpeg -y -i "$fname" -vf yadif=1,scale=-1:720 -acodec aac -ab 128k -ac 2 -strict experimental -vcodec libx264 -vpre slow -threads 2 -crf 24 "$outp"
Surprisingly, I get the smallest file size for
veryfast
preset! For example:slower
: output bitrate 3500kbps, encoding speed 17 fps, file size 29MBveryfast
: output bitrate 3050kbps, encoding speed 34 fps, file size 25MB
Which I think is not as it should be. Now I wonder, is that due to a worse encoding quality for the
veryfast
preset? Or in my case usingslower
does simply not make sense for some reason?