I am generating HLS segments using FFMPEG. Here is the command that I am using :
ffmpeg -i "rtmp://localhost/oflaDemo/33/hlsopt3 live=1" -y -c:v libx264 -b:v 1000k -vprofile baseline -preset medium -x264opts level=41 -threads 4 -s 480x360 -map 0:v -c:a libfaac -b:a 160000 -ac 1 -hls_time 3 -hls_list_size 3 -hls_wrap 10 -start_number 1 hlsopt3.m3u8
I am working on Ubuntu 12.04 and using RED5 1.0.2 as my streaming server and I want to stream videos on android and ios devices. But the playback on devices is very jerky, they do not play video smoothly. Also my server's CPU utilization goes to more than 100%.
After so much research I have found that the CPU utilization is due to the H264/mpeg-4 aac conversion, But without doing conversion it wont play on Ios and android devices.
So please suggest me any solution. How I can play it smoothly on mobile devices and also save the CPU utilization.
Please help me I have almost waisted 10 days on this.
Any help would be really appreciated.
I have found the reason why the FFMPEG used 100% of CPU and why jerky video displayed on devices. It is because I did not mentioned the frame rate.
-r 24
ffmpeg -i "rtmp://localhost/oflaDemo/33/hlsopt6 live=1" -y -c:v libx264 \
-b:v 1000k -r 24 -vprofile baseline -preset medium -x264opts level=41 \
-threads 4 -s 480x360 -map 0:v -c:a libfaac -b:a 160000 -ac 1 -hls_time 3 \
-hls_list_size 2 -hls_wrap 10 -start_number 1 hlsopt6.m3u8
Now it is playback smoothly on all devices and also FFMPEG take less CPU.