Welcome to janforman.com you can find here infos about downtime of my servers and other stuff.

H264 Video Streaming to mobile phone

This sample is tested on Real Player from Real Networks that can be found on latest mobile phones.
(Stream is compatible with Symbian OS, IPhone, Windows Mobile)
VLC configuration sample:

:sout=#transcode{soverlay,ab=32,samplerate=22050,
channels=1,acodec=mp4a,vcodec=h264,
width=320,height=240,fps=15,vb=192,
venc=x264{vbv-bufsize=500,me=umh,
partitions=all,level=12,subme=7,threads=4,
no-cabac,ref=2,mixed-refs=1,bframes=0,
min-keyint=1,keyint=30,trellis=2,direct=auto,
qcomp=0.1,qpmax=51}}:
gather:rtp{mp4a-latm,sdp=rtsp://{IP}:554/tv.mp4}
(RTSP streaming compatible with Real Player)


- or change last line to
gather:standard{access=http,mux=mp4,dst={IP}:80/tv.mp4}
(HTTP is not compatible with Real Player)
- or to
gather:standard{access=mmsh,mux=mp4,dst={IP}:80/tv.mp4}
(MMS over HTTP is not compatible with Real Player)

Remember!: Not all sizes and framerates are supported,
place your IP to {IP}.
For example: Nokia 5800 accept only 320x240x15fps up to 256kbit/s
Wikipedia about Real Time Streaming Protocol
Used ports are
RTSP (TCP: 554 + UDP)
HTTP (TCP: 80)
MMSH (TCP: 80, true 1755 MMS not supported)

H.264 video encoding finetune

x264 Features:
* CAVLC/CABAC * Multi-references * Intra: all macroblock types * Inter P: all partitions * Inter B: partitions from 16×16 down to 8×8 * Ratecontrol: constant quantizer, single or multipass ABR, optional VBV * Scene cut detection * Adaptive B-frame placement * B-frames as references / arbitrary frame order * 8×8 and 4×4 adaptive spatial transform * Lossless mode * Custom quantization matrices * Parallel encoding on multiple CPUs * Interlacing

Here is my recommended values for x264 (H.264 – MPEG4 AVC) encoder


-vcodec libx264 -b 700k -flags +loop -cmp +chroma -flags2 +bpyramid+wpred+mixed_refs+8x8dct+brdo -me umh -subq 7 -trellis 2 -bidir_refine 1 -bf 3 -b_strategy 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4


btw 2 pass encoding is used

For better visual quality and improved compression ratio I’m using
MSU Graphics & Media Lab Denoiser

MainConcept MJPEG (Motion JPEG) have great quality on 90%
(600MHz CPU is enough for 720×576, also this is good for HD)

HuffYUV for lossless compression :-) ehmm yes this produce big file.

MSU H264 codec comparison 2007