0

My company transcodes videos sent in by users (recorder by our own screenrecording software)

I use FFMpeg to do the work using this command:

 /ffmpeg/ffmpeg -i in.mov -vcodec libx264 -fpre /ffmpeg/ffpresets/libx264-slower.ffpreset   -y out.flv

The purpose is to prepare the video for viewing in browser.

The problem is that the first 10, or so, seconds the quality is really poor.

What can cause this? and how can i fix it?

Preset settings:

coder=1
flags=+loop
cmp=+chroma
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
me_method=umh
subq=8
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=2
qcomp=0.6
qmin=0
qmax=69
qdiff=4
bf=3
refs=5
directpred=3
trellis=1
flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
wpredp=2
rc_lookahead=50

Exampel of an input video

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '84f42bcb67ac616635ef6f99057bbbc46d418295.mov':
Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2012-03-07 13:45:16
  Duration: 00:15:56.00, start: 0.000000, bitrate: 4108 kb/s
    Stream #0.0(eng): Video: qtrle, rgb24, 1680x945, 3401 kb/s, 13.61 fps, 1k tbr, 1k tbn, 1k tbc
    Metadata:
      creation_time   : 2012-03-07 13:45:16
    Stream #0.1(eng): Audio: pcm_s16be, 44100 Hz, 1 channels, s16, 705 kb/s
    Metadata:
      creation_time   : 2012-03-07 13:45:16
Artog
  • 1,132
  • 1
  • 13
  • 25

2 Answers2

1

It looks like you are using an older version of FFMPEG, try updating and using the presets inside of lbx264 (placebo = highest quality) instead of the FFMPEG presets.

smp
  • 985
  • 5
  • 10
0

You have several issues to consider:

  • Going from rgb24 to yuv420p can introduce quality loss. There is not much you can do about this.

  • Your ffmpeg may be using bad default settings. However you supplied no console output so I can only guess. Older ffmpeg used unoptimal settings. Recent ffmpeg uses sane default settings. Since you did not declare a rate control method the default setting will be used (either -b 200k, or -crf 23 depending on your ffmpeg version).

  • It appears you are manually pointing to a preset. FFmpeg can not magically use any and all random presets. You must use the presets that come with your ffmpeg version, but I'm not sure if this applies to you since you did not provide the complete, uncut console output that appears after you enter your ffmpeg command.

llogan
  • 121,796
  • 28
  • 232
  • 243