ffserver & ffmpeg problems in live streaming

Tukang Sate blandhongz at yahoo.co.uk
Wed Jun 28 00:05:39 UTC 2006


Hi, I got some problem during using ffmpeg in my
FreeBSD 5.4 RELEASE
I want ask some basic question, but I'm sorry if my
question is too easy (I'm a newbie user)

-This is my CPU specification :

# dmesg | grep CPU
CPU: Mobile Intel(R) Pentium(R) III CPU - M  1200MHz
(1196.02-MHz 686-class CPU)
# uname -a

-I use this version of x264 :
x264-snapshot-20060112-2245.tar.bz2

1. This is my ffmpeg configuration :
	ffmpeg version CVS, build 3277056, Copyright (c)
2000-2004 Fabrice Bellard
  	configuration:  --cc=cc --prefix=/usr/local
--make=gmake --disable-debug --enable-memalign-hack
--enable-shared --disable-v4l   
--source-path=/usr/ports/multimedia/ffmpeg-devel/work/FFMpeg-2005112800
--enable-a52 --enable-dts --enable-gpl
--enable-mp3lame --enable-libogg --enable-pp
--enable-shared-pp --enable-pthreads --disable-ffplay
--enable-theora --enable-vorbis --enable-x264
--enable-xvid
  	built on Jun 23 2006 07:50:51, gcc: 3.4.4 [FreeBSD]
20050518

when I use codec h264 for converting my video, I set
the bitrate on 64kbps (-b 64) but the result show me
that the bitrate is about 500kbps, but in the same
video source, when I convert it into mpeg4 with the
same bitrate (64kbps) I got the bitrate is about
70kbps (almost same with the bitrate I set before). My
question, what happen with my x264? Why x264 can't
encode that video into same bitrate that i set before?
Or maybe it needs minimum CPU requirements?

2. I tried to build a live streaming server (live
stream from feed) and I have edit the ffserver.conf,
start fserver, and do this one : ffmpeg -vd /dev/bktr0
-tvstd pal http://localhost:8090/feed1.ffm, this is my
ffserver configuration file : 

 Port on which the server is listening. You must
select a different
# port from your standard HTTP web server if it is
running on the same
# computer.
Port 8090

# Address on which the server is bound. Only useful if
you have
# several network interfaces.
BindAddress 0.0.0.0

# Number of simultaneous requests that can be handled.
Since FFServer
# is very fast, it is more likely that you will want
to leave this high
# and use MaxBandwidth, below.
MaxClients 1000

# This the maximum amount of kbit/sec that you are
prepared to
# consume when streaming to clients.
MaxBandwidth 10000

# Access log file (uses standard Apache log file
format)
# '-' is the standard output.
CustomLog -

# Suppress that if you want to launch ffserver as a
daemon.
# NoDaemon


##################################################################
# Definition of the live feeds. Each live feed
contains one video
# and/or audio sequence coming from an ffmpeg encoder
or another
# ffserver. This sequence may be encoded
simultaneously with several
# codecs at several resolutions.

<Feed feed1.ffm>

# You must use 'ffmpeg' to send a live feed to
ffserver. In this
# example, you can type:
#
# ffmpeg http://localhost:8090/feed1.ffm

# ffserver can also do time shifting. It means that it
can stream any
# previously recorded live stream. The request should
contain:
#
"http://xxxx?date=[YYYY-MM-DDT][[HH:]MM:]SS[.m...]".You
must specify
# a path where the feed is stored on disk. You also
specify the
# maximum size of the feed, where zero means
unlimited. Default:
# File=/tmp/feed_name.ffm FileMaxSize=5M
File /tmp/feed1.ffm
FileMaxSize 5000K

# You could specify
# ReadOnlyFile /saved/specialvideo.ffm
# This marks the file as readonly and it will not be
deleted or updated.

# Specify launch in order to start ffmpeg
automatically.
# First ffmpeg must be defined with an appropriate
path if needed,
# after that options can follow, but avoid adding the
http:// field
#Launch ffmpeg

# Only allow connections from localhost to the feed.
ACL allow 127.0.0.1

</Feed>

##########################
#### MY CONFIGURATION ####
##########################

# Flash

<Stream test.swf>
Feed feed1.ffm
Format swf
VideoFrameRate 15
VideoBitRate 400
#AudioCodec mp3
#AudioBitrate 64
VideoBufferSize 333
VideoSize 320x240
VideoIntraOnly
NoAudio
</Stream>


# AVI compatible

<Stream test.avi>
Feed feed1.ffm
Format avi
VideoCodec mpeg4
VideoBufferSize 333
VideoFrameRate 24
VideoSize 320x240
VideoBitRate 200
VideoGopSize 30
AudioCodec mp3
AudioChannels 2
AudioBitRate 64
#StartSendOnKey
#NoAudio
</Stream>


# MP3 audio

<Stream test.mp3>
Feed feed1.ffm
Format mp3
AudioCodec mp3
AudioBitRate 64
AudioChannels 1
AudioSampleRate 44100
NoVideo
</Stream>

##################################################################
# Special streams

# Server status

<Stream lol.html>
Format status

# Only allow local people to get the status
#ACL allow localhost
#ACL allow 192.168.0.0 192.168.255.255

#FaviconURL
http://pond1.gladstonefamily.net:8080/favicon.ico
</Stream>


# Redirect index.html to the appropriate site

<Redirect index.html>
URL http://www.ffmpeg.org/
</Redirect>

## EOF ##

I found a stable encoding process from that feed (with
no buffer underflow) but why the client can't get any
video and also its audio? It looks like there are some
network problems there, when I use mplayer to open the
.avi file, there's no buffer and I got my ffserver is
killed (freeze). The mp3 stream show me different
error, when I try to open it with xmms or winamp (in
microsoft windows) I see that the player try to
reconnect and always failed, but in my ffserver I got
this message : 

10.14.200.235 - - [Tue Jun 27 23:15:41 2006] "GET
/test.mp3 HTTP/1.0" 200 1319
10.14.200.235 - - [Tue Jun 27 23:15:42 2006] "GET
/test.mp3 HTTP/1.0" 200 483
10.14.200.235 - - [Tue Jun 27 23:15:45 2006] "GET
/test.mp3 HTTP/1.0" 200 483
10.14.200.235 - - [Tue Jun 27 23:15:46 2006] "GET
/test.mp3 HTTP/1.0" 200 901
10.14.200.235 - - [Tue Jun 27 23:15:48 2006] "GET
/test.mp3 HTTP/1.0" 200 483
10.14.200.235 - - [Tue Jun 27 23:16:25 2006] "GET
/test.mp3 HTTP/1.0" 200 483
10.14.200.235 - - [Tue Jun 27 23:16:27 2006] "GET
/test.mp3 HTTP/1.0" 200 483
10.14.200.235 - - [Tue Jun 27 23:16:29 2006] "GET
/test.mp3 HTTP/1.0" 200 1319
10.14.200.235 - - [Tue Jun 27 23:16:30 2006] "GET
/test.mp3 HTTP/1.0" 200 901


so it means that the connection is allowed..but why
the client can't open any file from the server?

In the other case, the swf streams can work properly
if I open it using browser that supported by flash
player (off course with no audio, based on my ffserver
configuration) but when I open it using a FLV-PLAYER
the sme problem I got there, the player got some
problem in connection... 

My question, is there any wrong configuration in my
ffserver.conf file?

Thanks in any advance =)


		
___________________________________________________________ 
Try the all-new Yahoo! Mail. "The New Version is radically easier to use" – The Wall Street Journal 
http://uk.docs.yahoo.com/nowyoucan.html


More information about the freebsd-multimedia mailing list