Wowza Community

h264 to lower bitrate h264

Just wanted to start off saying that the forum is great, and I found a lot of my answers but for this one, I haven’t been able to find a solution.

My source is multicast multiple program transport stream. I am able to use VLC to transcode mpeg2 from the stream and send it to wowza very easily. But when I try to use h264 source, I get very unstable output. I tried to match the settings as close as I could to the source settings, excluding the bitrate. My goal is to lower the bitrate of the incoming source to 1M from 3M. I can sometimes get one of the h264 streams to work, but if I set up another instance, the output is not watchable.

I have even tried to setup the wowza transcoder, and the output from there was unstable also. This could be due to the fact that I didn’t really tune it, but wanted to use it to see if I was doing something wrong.

Is there another way to “reduce” the bitrate of the h264 source? Maybe not a transcode, but something else?

Any input would be great. Some additional info, I can do about 5 mpeg2 streams now with that machine, so I’m sure I can do at least 2 h264 streams with the same machine, Im almost 100% sure that its not a CPU issue. Would FFmpeg be a better solution? I’m a bit stuck here…

Thanks in advance.

Hi djsashaz,

Welcome to the forums. So, I think you’re on the right track reducing the bitrate by transcoding.

It’s hard to suggest a fix for the “output not watchable” problem, without knowing everything about your setup. e.g. your encoding command line, resolutions, CPU/RAM/OS, your CPU load, etc…

One tip though, is that scaling the video will greatly reduce the CPU usage. For example you could use the scale=.05 command in the VLC Examples, or the equivalent in your other transcoders. Also, using -vcodec copy -acodec copy, in ffmpeg for example, instead of transcoding will greatly reduce CPU load.

You will almost always want to lower the resolution when lowering the bitrate, for several reasons.

Take a look at this encoding article:

https://www.wowza.com/docs/how-to-encode-video-on-demand-content

Richard

Do you want Constant Bitrate? The command looks like it’s encoding to Variable Bitrate.

You’ve set the keyframe interval, but not the frame rate… If your framerate is not a multiple or divisor of the keyframe interval, playback might be choppy.

“Is there another way to “reduce” the bitrate of the h264 source?”

Close to CBR is recommended for live streaming.

To decrease bitrate: lower the framerate, increase keyframe interval.

Hi djsashaz,

Welcome to the forums. So, I think you’re on the right track reducing the bitrate by transcoding.

It’s hard to suggest a fix for the “output not watchable” problem, without knowing everything about your setup. e.g. your encoding command line, resolutions, CPU/RAM/OS, your CPU load, etc…

One tip though, is that scaling the video will greatly reduce the CPU usage. For example you could use the scale=.05 command in the VLC Examples, or the equivalent in your other transcoders. Also, using -vcodec copy -acodec copy, in ffmpeg for example, instead of transcoding will greatly reduce CPU load.

You will almost always want to lower the resolution when lowering the bitrate, for several reasons.

Randal, Thanks for getting back to me. Right now Im just using vlc. My MPTS has both Mpeg2 and h.264. I can demux and work with them without problem. My issues come down to h264, and reducing the rate. I can do mpeg2 VBR as a source, and get h.264 CBR, but the VBR H.264 source is still giving me VBR h.264 output. I think my issue is coming down to VBR vs CBR.

/usr/local/bin/vlc udp://@127.0.0.1:10030 --play-and-exit --sout-keep -I dummy -vvv --sout '#transcode{threads=2,vb=1000,vcodec=x264,venc=x264{level=4,profile=main,hrd=cbr,qcomp=0,keyint=12,bframes=0,vbv-maxrate=1000,vbv bufsize=10000,partitions=fast,8x8dct=1,me=dia,ref=1,subme=1,trellis=0,mbtree=0},acodec=mp4a,ab=128,samplerate=44100,audio sync}:std{access=udp,mux=ts,dst=192.168.20.100:10030}}' --file-caching=15000 --udp-caching=15000 --sout-mux-caching=15000

Heres my VLC encoding. Can you see where Im going wrong?

Do you want Constant Bitrate? The command looks like it’s encoding to Variable Bitrate.

You’ve set the keyframe interval, but not the frame rate… If your framerate is not a multiple or divisor of the keyframe interval, playback might be choppy.

“Is there another way to “reduce” the bitrate of the h264 source?”

Close to CBR is recommended for live streaming.

To decrease bitrate: lower the framerate, increase keyframe interval.

we are trying to encode 180kbps profile(H264 baseline and aac) - please can tell us suitable fps, keyframe interval … etc

if possible please share command line

we are using suse linux os

Thanks