Opened 5 years ago

#928 new defect

ffmpeg libdc1394 camera live mpeg streaming stops a specific frame number

Reported by: Zax Owned by:
Priority: minor Component: undetermined
Version: git-master Keywords: libdc1394 ffserver live streaming
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


I was trying to stream live video from a dc1394 camera by using ffmpeg and ffserver. I was successful in streaming the video; however, the stream freezes/stops/hangs after a specific time (00:02:23.06) or frame (2146).

I have tried to debug the problem and noticed that after the 2146th frame "vdelta" in "do_video_out" at "ffmpeg.c" goes negative. Moreover, each frame increment causes it to decrement further. The reason vdelta goes negative is "ost->sync_ist->pts" of input variable "const OutputStream? *ost" in do_video_out changes sign.

So, I have made some modifications in "do_video_out" and "get_sync_ipts" and temporarily solved the negative vdelta problem. You can find the changed functions in the attachment.

Though I have solved my problem, the bug ("ost->sync_ist->pts" goes negative) still exits. I hope my comments are helpful.

Here is my ffmpeg commands and ffserver conf file.

# ffmpeg -loglevel debug -v verbose -f libdc1394 -i hw:0,0 -vcodec mpeg4 -b:v 10000k -bufsize 150000k -r 5
# ffserver -loglevel debug -f ffs.conf
Port 8090 
# bind to all IPs aliased or not 
# max number of simultaneous clients 
MaxClients 4 
# max bandwidth per-client (kb/s) 
MaxBandwidth 10000000 s
# Suppress that if you want to launch ffserver as a daemon. 

<Feed feed1.ffm> 
	File /tmp/feed1.ffm 
	FileMaxSize  2000M
	ACL allow 

# mpeg
<Stream test.mpg> 
	# the source feed 
	Feed feed1.ffm 

	# the output stream format - FLV = FLash Video 
	Format 	mpegts
	VideoCodec mpeg4

	AVOptionVideo 	maxrate 1000000k
	AVOptionVideo	qmin	1
	AVOptionVideo	qmax	31
	AVOptionVideo	bufsize	100000k

	# this must match the ffmpeg -r argument 
	VideoFrameRate 15 
	VideoSize 320x240


	VideoGopSize 20

	Strict -1

	# this sets how many seconds in past to start 
	PreRoll 0 

	# don't have audio 

	ACL allow localhost
	ACL allow

<Stream stat.html>
Format status
ACL allow localhost
ACL allow

Attachments (1)

uglyFix.c (6.8 KB) - added by Zax 5 years ago.

Download all attachments as: .zip

Change History (1)

Changed 5 years ago by Zax

Note: See TracTickets for help on using tickets.