您的位置:首页 > 移动开发 > Android开发

把ffserver push进android文件系统并测试下

2013-08-23 18:18 375 查看
这个ffserver不是我编译的,貌似用arm-linux工具链可以直接编译,下回来试试,能不能再android上跑呢?

https://code.google.com/p/rxwen-blog-stuff/downloads/detail?name=ffserver&can=2&q= 人家的

http://rxwen.blogspot.com/ 人家博客

https://code.google.com/p/rmdmakefiles/source/browse/ 人家还有编译系统

G:\>adb push ffserver 192.168.1.108:5555/zhangbin/

error: more than one device and emulator

G:\>adb push ffserver 192.168.1.108:5555

error: more than one device and emulator

G:\>adb push ffserver /zhangbin/

error: more than one device and emulator

G:\>adb push ffserver /sdcard

error: more than one device and emulator

G:\>adb push ffserver 192.168.1.108:5555

error: more than one device and emulator

G:\>adb push ffserver 192.168.1.108:5555/

error: more than one device and emulator

G:\>adb devices

List of devices attached

0146A07E02014015 device

192.168.1.108:5555 device


G:\>adb push ffserver 192.168.1.108:5555

error: more than one device and emulator

G:\>adb devices

List of devices attached

192.168.1.108:5555 device

到底应该怎么指定设备名呢????

G:\>adb push ffserver /zhangbin/

2482 KB/s (9414756 bytes in 3.704s)

G:\>

root@android:/ # cd zhangbin

root@android:/zhangbin #

root@android:/zhangbin #

root@android:/zhangbin # ls

ffserver

root@android:/zhangbin # ls -al

-rw-rw-rw- root root 9414756 2013-08-23 17:42 ffserver

root@android:/zhangbin # chmod 777 *

root@android:/zhangbin # ls

ffserver

还真可以跑ffserver

root@android:/zhangbin # ./ffserver

ffserver version 0.8, Copyright (c) 2000-2011 the FFmpeg developers

built on Jun 23 2011 09:52:28 with gcc 4.5.2

这是编译参数

configuration: --arch=arm --cross-prefix=arm-none-linux-gnueabi- --extra-ldflags=-static --target-os=linux

libavutil 51. 9. 1 / 51. 9. 1

libavcodec 53. 7. 0 / 53. 7. 0

libavformat 53. 4. 0 / 53. 4. 0

libavdevice 53. 1. 1 / 53. 1. 1

libavfilter 2. 23. 0 / 2. 23. 0

libswscale 2. 0. 0 / 2. 0. 0

/etc/ffserver.conf: No such file or directory 配置文件要指定,跑跑才行吧。 要不还是不确定ffserver到底是不是能在android上真的跑起来啊。

Incorrect config file - exiting.

1|root@android:/zhangbin #

root@android:/zhangbin # ./ffserver

ffserver version 0.8, Copyright (c) 2000-2011 the FFmpeg developers

built on Jun 23 2011 09:52:28 with gcc 4.5.2

configuration: --arch=arm --cross-prefix=arm-none-linux-gnueabi- --extra-ldflags=-static --target-os=linux

libavutil 51. 9. 1 / 51. 9. 1

libavcodec 53. 7. 0 / 53. 7. 0

libavformat 53. 4. 0 / 53. 4. 0

libavdevice 53. 1. 1 / 53. 1. 1

libavfilter 2. 23. 0 / 2. 23. 0

libswscale 2. 0. 0 / 2. 0. 0

/etc/ffserver.conf: No such file or directory

Incorrect config file - exiting.

1|root@android:/zhangbin # ls

ffserver

ffserver.conf

root@android:/zhangbin # ./ffserver -f ffserver.conf

ffserver version 0.8, Copyright (c) 2000-2011 the FFmpeg developers

built on Jun 23 2011 09:52:28 with gcc 4.5.2

configuration: --arch=arm --cross-prefix=arm-none-linux-gnueabi- --extra-ldflags=-static --target-os=linux

libavutil 51. 9. 1 / 51. 9. 1

libavcodec 53. 7. 0 / 53. 7. 0

libavformat 53. 4. 0 / 53. 4. 0

libavdevice 53. 1. 1 / 53. 1. 1

libavfilter 2. 23. 0 / 2. 23. 0

libswscale 2. 0. 0 / 2. 0. 0

Fri Aug 23 10:50:51 2013 Opening file '/data/1.mp4'

Fri Aug 23 10:50:51 2013 Opening file '/data/1.mp3'

Fri Aug 23 10:50:51 2013 [mp3 @ 0x25face0]max_analyze_duration 5000000 reached at 5015510

bind(port 8090): Address family not supported by protocol

Fri Aug 23 10:50:51 2013 Could not start server

1|root@android:/zhangbin #

http://stackoverflow.com/questions/8906904/ffserver-bindport-8090-address-family-not-supported-by-protocol

http://stackoverflow.com/questions/14860648/bind-address-family-not-supported-by-protocol

这个错误 bind(port 8090): Address family not supported by protocol

The address family should be AF_INET in case IPv4 or AF_INET6 in case IPv6. It seems that the sin_family member of the address struct
is not assigned a valid value. Please check it.

up
vote1down
voteaccepted
Use
AF_INET
instead
of
htons(AF_INET)
to
initialize
sin_family
.

这是ffserver的bug么????

http://ro-lookandfeel.blogspot.co.uk/2012/10/bind-address-family-not-supported-by.html

EDNESDAY, OCTOBER 31, 2012


bind: Address family not supported by protocol

Trying to get ROLF running on a Raspberry Pi, I installed Debian Wheezy, but then found that my vnc server version of ROLF doesn't start up.

I've boiled the problem down to a minimal program that works fine on 2.6.32.6, but not on "Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux" or "Linux Microknoppix 3.4.9 #34 SMP PREEMPT Fri Aug 17 06:30:04 CEST 2012 i686
GNU/Linux", so presumably there's a change in a major version. All I have to do is find out what it is...

Update: It seems someone turned on the "check for idiot programmers" flag in the kernel; fix: addr.sin_family = AF_INET;

#include <sys/types.h>
#include <sys socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>

int main()
{
    int vnc_server;
    int port = 2008;

    struct sockaddr_in addr = { 0 };
    addr.sin_family = htons( AF_INET );
    addr.sin_port = htons( port );
    
    if (-1 == (vnc_server = socket( AF_INET, SOCK_STREAM, 0 )))
        perror( "socket" );

    if (0 != bind( vnc_server, (struct sockaddr*) &addr, sizeof( addr ) ))
        perror( "bind" );

    return 0;
}


POSTED BY SIMON AT 2:34
PM
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: