Opened 13 years ago

Closed 13 years ago

#1390 closed enhancement (fixed)

Reenable H264 with the lattest ffmpeg

Reported by: nanang Owned by: nanang
Priority: normal Milestone: release-2.0-beta
Component: pjmedia Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:


Previously, we have problem to configure libx264, the ffmpeg h264 encoder backend, for realtime streaming, some libx264 settings are not really configurable from ffmpeg, e.g: h264 profile, NAL unit max size.

With the latest ffmpeg (from git/development, not released yet), app can configure all libx264 settings almost natively (same option names and raw libx264 option).

Change History (10)

comment:1 Changed 13 years ago by nanang

(In [3819]) Reenable ffmpeg H264 (re #1390):

  • Review H264 codec settings such as profile, level, NAL unit size, bitrate, quality, latency.
  • Added new format PJMEDIA_FORMAT_GBRP, 24 bits planar RGB, one of the formats outputted by the latest ffmpeg H264 decoder.
  • Fixed format change detection bug in ffmpeg wrapper, decoder didn't update its internal state with the new format so format change event was generated in every decoding operation.
  • Added compile time configurations for enabling/disabling ffmpeg codec H263+ & H264.
  • Updated pjsua app to adjust window size to original video size. With H264, default window size will be too big as it is init'd with default H264 video size, e.g: 720x480 for profile level 30.

comment:2 Changed 13 years ago by nanang

(In [3823]) Re #1390: Fixed possible compile error in ffmpeg_util.c, the new ffmpeg format PIX_FMT_GBR24P is only available in libavutil 51.20.1 onward.

comment:3 Changed 13 years ago by bennylp

(In [3824]) Compile error with older ffmpeg due to H.264 modification (re #1390)

comment:4 Changed 13 years ago by bennylp

(In [3825]) Fixed compilation error in pjsua_app introduced by r3819 if video is not enabled (re #1390)

comment:5 Changed 13 years ago by bennylp

(In [3827]) Added libz in aconfigure as this is needed by newer ffmpeg (re #1390)

comment:6 Changed 13 years ago by nanang

(In [3833]) Re #1390: Fixed ffmpeg codecs to update size & fps in AVCodecContext after applying SDP fmtp to codec param.

comment:7 Changed 13 years ago by nanang

(In [3853]) Re #1390: disable H264 encoder source format RGB24 as x264 doesn't support 4:4:4 for baseline profile.

comment:8 Changed 13 years ago by bennylp

(In [3859]) More H.264 (re #1390): added x264 in aconfigure

comment:9 Changed 13 years ago by nanang

(In [3861]) Re #1390: Updated h264 settings: bitrate from 128k to 512k, size from 352x288 to 720x480, x264 preset from 'veryslow' to 'veryfast'.

comment:10 Changed 13 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.