Ticket #928 (new defect)
Opened 16 months ago
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 |
Description
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 http://127.0.0.1:8090/feed1.ffm
# ffserver -loglevel debug -f ffs.conf
Port 8090 # bind to all IPs aliased or not BindAddress 0.0.0.0 # 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. NoDaemon <Feed feed1.ffm> File /tmp/feed1.ffm FileMaxSize 2000M ACL allow 127.0.0.1 </Feed> # 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 StartSendOnKey VideoGopSize 20 VideoHighQuality Video4MotionVector Strict -1 # this sets how many seconds in past to start PreRoll 0 # don't have audio Noaudio ACL allow localhost ACL allow 192.168.0.0 192.168.255.255 </Stream> <Stream stat.html> Format status ACL allow localhost ACL allow 192.168.0.0 192.168.255.255 </Stream>



