[x264-devel] Strange frames dimension results obtained encoding with h.264

Alessandro Ferrari alessandroferrari87 at gmail.com
Wed Sep 2 17:13:28 CEST 2009


Hi dear community,
                               I want to ask your opinion about strange
results that i've obtained in frame transcoding and if is possible to find
any solutions. I implement a cascade transcoder (fully decode the frame, i
scale it in spatial resolution and then re-encode in h264 with x264) for
frame that are receveid over ip network, I transcode it with low latency and
i re-send it newly over network.
In x264 encoding process i've set this parameters:

    x264_param_default( &param );

    //Set video resolution
    param.i_width = scale_width;
    param.i_height = scale_height;

    //We don't need bframe
    param.i_bframe = 0;
    param.i_bframe_adaptive = 0;

    //Maximum dimension of the gop
    param.i_keyint_max = 20;

    //Frame delay wait that the encoder have encoded more frame for return
in
    //output that.
    //With b-adapt = 0 or 1:
    //frame_delay = MAX( param.rc.i_lookahead, param.i_bframes ) + threads -
1
    //We remove lookahead and multiple thread for avoid frame delay.
    param.rc.i_lookahead = 0;
    param.i_threads = 1;

    //Gop Size maximum 20
    param.i_keyint_max = 20;

    //Setting variable bitrate
    param.rc.i_rc_method = X264_RC_CRF;
    //Specify quality of encoding
    param.rc.f_rf_constant = 30;

I scaled from 720x576 resolution to 352x288.
The results that i obtain are a bit strange:
- if the frame that i receive is low quality, the scaled re-encoded frame
have greater size (for mpeg4.3 intra frame of 15 kB, the re-encoded obtained
frame is 67kB);
- if  i decode and scale a frame of high quality in mpeg4.3 and then
re-encode in h264, i reduce the frame size by a factor of two, but the real
strange fact is that i re-encode the not-resized picture i obtain a frame of
the same size or less. The picture is correctly resized because i can
display that after the scaling operation and the picture buffer is
effectively of the correct dimension. Finally, if i transcode reducing
spatial resolution an h264 high quality frame i achieve these results: from
33kB(720x576) frame to 28kB(352x288).

Anyone have any idea? Many thanks.

Best Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20090902/c4082104/attachment.htm>


More information about the x264-devel mailing list