顯示廣告
隱藏 ✕
※ 本文為 dinos 轉寄自 ptt.cc 更新時間: 2014-06-18 21:27:12
看板 Soft_Job
作者 gn00618777 (非常念舊)
標題 Re: [請益]  ffmpeg
時間 Wed Jun 18 20:58:40 2014


※ 引述《gn00618777 (非常念舊)》之銘言:
: 我的目的是在自己的板子安裝 camera,利用 ffmpeg 將抓到的影像傳到ffserver,然後
: 在另一台電腦接收影像。
: 目前可以在板子上錄製影像然後在板子上播放,藉以下指令
: # ffserver -f /etc/ffserver --- 啟動 avserver
: #  ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 cam1.asf
: #ffplay cam1.asf
: 現在要傳送到 avserver
: #ffserver -f /etc/ffserver.conf
: # ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 http://127.0.0.1:8090/cam1.ffm
: 出現以下訊息(我省略了一些)
:    Stream mapping:
:   Stream #0.0 -> #0.0
: Error while opening encoder for output stream #0.0 - maybe incorrect
: parameters such as bit_rate, rate, width or height
: Sat Jan  1 03:58:39 2000 127.0.0.1 - - [POST] "/cam1.ffm HTTP/1.1" 200 0
: *** glibc detected *** ffmpeg: free(): invalid pointer: 0x0002d2a0 ***
: Aborted
: 上網爬文了,我認為非常有可能是 ffmpeg 參數沒設定完全。。也不清楚320x240這解析
: 度是否合法,我該如何用完整的參數搭配?謝謝。 若問題po在這不合適會自刪。

我的 ffserver.conf
=======================================

Port 8090
BindAddress 0.0.0.0
MaxHTTPConnections 30
MaxClients 20
MaxBandwidth 2000
CustomLog -

<Feed cam1.ffm>
File /tmp/cam1.ffm
FileMaxSize 10000K
ACL allow 127.0.0.1
</Feed>

#-----
# Windows Media Player
#-----
<Stream cam1.asf>
Feed cam1.ffm
Format asf
VideoCodec msmpeg4v2
VideoFrameRate 15
VideoSize 320x240
VideoBitRate 256
VideoBufferSize 40
VideoGopSize 15
NoAudio StartSendOnKey
</Stream>

<Stream stat.html>
Format status
ACL allow 172.16.51.26 localhost
</Stream>
=============================================

回上一篇K大,output 跟 config 設的一樣。

且最後我針對上一篇以下錯誤訊息修改指令
Error while opening encoder for output stream #0.0 - maybe
incorrect parameters such as bit_rate, rate, width or height

改成
ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 -b 100k h ttp://127.0.0.1:8090/cam1.ffm

上一篇的錯誤訊息消失,變成

Input #0, video4linux2, from '/dev/video0': Duration: N/A, start:
24300.069612, bitrate: 36864 kb/s Stream #0.0: Video: rawvideo, yuyv422,
320x240, 36864 kb/s, 30 tbr, 1000k tbn, 30 tbc Sat Jan 1 07:09:07
2000 127.0.0.1 - - [GET] "/cam1.ffm HTTP/1.1" 200 4149 [buffer @ 0x2f1a0]
w:320 h:240 pixfmt:yuyv422 [avsink @ 0x2f7e0] auto-inserting filter
'auto-inserted scaler 0' between the filter 'src' and the
filter 'out' [scale @ 0x2ea60] w:320 h:240 fmt:yuyv422 -> w:320 h:240
fmt:yuv420p flags:0x4 Sat Jan 1
07:09:07 2000 127.0.0.1 - - [POST] "/cam1.ffm HTTP/1.1" 200 0
Segmentation fault


"Segmentation fault" google 過 ,目前還沒有一個解決方案...






--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.136.159.42
※ 文章網址: http://www.ptt.cc/bbs/Soft_Job/M.1403096323.A.667.html
※ 編輯: gn00618777 (220.136.159.42), 06/18/2014 21:02:03

--
※ 看板: dinos 文章推薦值: 0 目前人氣: 0 累積人氣: 159 
分享網址: 複製 已複製
guest
x)推文 r)回覆 e)編輯 d)刪除 M)收藏 ^x)轉錄 同主題: =)首篇 [)上篇 ])下篇