ffmpeg - Linux

Valerie avatar
By Valerie
at 2014-06-18T22:30

Table of Contents

※ [本文轉錄自 Soft_Job 看板 #1JeOq3Pd ]

作者: gn00618777 (非常念舊) 看板: Soft_Job
標題: 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 過 ,目前還沒有一個解決方案...






--
Tags: Linux

All Comments

Carol avatar
By Carol
at 2014-06-19T12:43
補上我的環境, AM335X(ubuntu filesystem)
Gilbert avatar
By Gilbert
at 2014-06-21T09:37
安裝的 ffmpeg 方式直接用 apt-get install ffmpeg
Erin avatar
By Erin
at 2014-06-23T06:04
fmpeg version 0.8.12-4:0.8.12-0ubuntu0.12.04.1

請問系統設成sudo -s root還在嗎?

Mary avatar
By Mary
at 2014-06-17T11:56
前任學長畢業後交接電腦時 說我的帳號有sudo 權限 我想問的是 那root帳號會在嗎? 因為他說系統是沒有root帳號的 只有sudo -s 但因為我的帳號密碼現在試不出來 而且我之前比較熟悉有root帳號的管理方式 想請問可以切換成root帳號為主要管理方式的原始設定嗎? 萬分 ...

請問版上有沒有人用Fedora 20 開機卡Xwin

Daph Bay avatar
By Daph Bay
at 2014-06-17T11:09
我的電腦在公司一次斷電下 X window就登不進去了 用ctrl+alt+F2 去文字介面是正常的 但圖形頁面會卡在fedora的Mark,但沒有出現登入帳號選項 此時滑鼠可以動 但悲劇的是沒東西可它點選 按esc 進去看停在[OK] started Accounts Service. 請問有什麼方式 ...

HackingThursday 固定聚會 (2014-06-19)

Anthony avatar
By Anthony
at 2014-06-16T12:07
通告網址: [http://www.hackingthursday.org/][1] * * * * 時間: 每週四晚上 19:30 至 22:00 ( 熱食供應至 20:00 ) * 地點: 伯朗咖啡 ( 建國店 ) * 地址: 台北市大安區建國南路一段 166 號 2 樓 * 鄰 ...

ubuntu清Cached memory

Faithe avatar
By Faithe
at 2014-06-16T03:46
先承認我自己手賤... 明明知道這種東西不需要清理 還很無聊的下了這個指令... 網路上很多教學都是 echo 1 andgt; /proc/sys/vm/drop_caches (清理cache) echo 0 andgt; /proc/sys/vm/drop_caches (恢復使用cache) ...

r8169 realtek gbe網卡裝在lmde201403上

Eden avatar
By Eden
at 2014-06-15T23:35
簡單來說 到了lmde 201403 realtek gbe網卡的auto-negotiation功能還是有問題 之所以這麼說是因為2008年的這一篇文章解決了隨機斷線現象 http://adam.rosi-kessel.org/weblog/2008/06/21 /a-much-simpler-fi ...