weixin_39917485
weixin_39917485
2020-11-22 00:22

Video from USB camera

Hi, i'm using baresip 0.5.6 on OpenWRT 15.05.1 and need to use with usb camera, but when call established i get this error:

call: alloc with params laddr=172.30.1.127, af=AF_INET, use_rtp=1 call: use_video=1 answering call from sip:217.tld with 200 call: update media audio: Set audio decoder: PCMA 8000Hz 1ch alsa: reset: srate=8000, ch=1, num_frames=160, pcmfmt=S16_LE alsa: playback started (default) audio: Set audio encoder: PCMA 8000Hz 1ch alsa: reset: srate=8000, ch=1, num_frames=160, pcmfmt=S16_LE alsa: recording started (default) audio tx pipeline: alsa ---> PCMA audio rx pipeline: alsa <--- PCMA Set video encoder: MP4V-ES (100000 bit/s, 10 fps) avcodec: video encoder MP4V-ES: 10 fps, 100000 bit/s, pktsize=1024 video: no video display avformat: stream 0: 320 x 240 time_base=1/1000000 avformat: updating 10 fps from config to native input material fps 30 Set video decoder: MP4V-ES avformat: decode: bad pixel format (1) (yuyv422) avcodec: video decoder MP4V-ES () 809.30.1.203: Call established: sip:217.tld avformat: decode: bad pixel format (1) (yuyv422)

Some useful output commands: root:~/.baresip# v4l2-ctl --list-devices USB 2.0 Camera (usb-101c0000.ehci-1.2): /dev/video0

root:~/.baresip# ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r47196) configuration: --enable-cross-compile --cross-prefix=mipsel-openwrt-linux-uclibc- --arch=mipsel --target-os=linux --prefix=/usr --pkg-config=pkg-config --enable-shared --enable-static --enable-small --enable-pthreads --enable-zlib --disable-runtime-cpudetect --disable-doc --disable-debug --enable-gpl --enable-version3 --disable-altivec --disable-amd3dnow --disable-amd3dnowext --disable-mmx --disable-mmxext --disable-sse --disable-sse2 --disable-sse3 --disable-ssse3 --disable-sse4 --disable-sse42 --disable-avx --disable-xop --disable-fma3 --disable-fma4 --disable-avx2 --disable-vfp --disable-neon --disable-inline-asm --disable-yasm --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --disable-mipsfpu --disable-dxva2 --disable-lzma --disable-vaapi --disable-vda --disable-vdpau --disable-outdevs libavutil 54. 20.100 / 54. 20.100 libavcodec 56. 26.100 / 56. 26.100 libavformat 56. 25.101 / 56. 25.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 11.102 / 5. 11.102 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100 [video4linux2,v4l2 @ 0xa9eee0] Compressed: mjpeg : MJPEG : 352x288 640x480 640x360 320x240 176x144 160x120 800x600 1280x720 [video4linux2,v4l2 @ 0xa9eee0] Raw : yuyv422 : YUV 4:2:2 (YUYV) : 352x288 640x480 640x360 320x240 176x144 160x120 800x600 1280x720

That's my ocnfiguration file:

Core

poll_method epoll # poll, select, epoll ..

SIP

sip_trans_bsize 128 sip_listen 0.0.0.0:5060

sip_certificate cert.pem

Call

call_local_timeout 120 call_max_calls 4

Audio

audio_path /usr/share/baresip

audio_player alsa,plughw:0,0

audio_source alsa,plughw:0,0

audio_player alsa,default audio_source alsa,default audio_alert alsa,default audio_srate 8000-48000 audio_channels 1-2

ausrc_srate 48000

auplay_srate 48000

ausrc_channels 0

auplay_channels 0

audio_level no

Video

video_source avformat,/dev/video0

video_display x11,nil

video_size 352x288 video_bitrate 100000 video_fps 10 video_fullscreen no

AVT - Audio/Video Transport

rtp_tos 184

rtp_ports 10000-20000

rtp_bandwidth 512-1024 # [kbit/s]

rtcp_enable yes rtcp_mux no jitter_buffer_delay 5-10 # frames rtp_stats no

rtp_timeout 60

Network

dns_server 10.0.0.1:53

net_interface br-lan

BFCP

bfcp_proto udp

------------------------------------------------------------------------------

Modules

module_path /usr/lib/baresip/modules

UI Modules

module stdio.so module cons.so

module evdev.so

module httpd.so

Audio codec Modules (in order)

module opus.so

module silk.so

module amr.so

module g7221.so

module g722.so

module g726.so

module g711.so

module gsm.so

module l16.so

module speex.so

module bv32.so

module mpa.so

module codec2.so

module ilbc.so

module isac.so

Audio filter Modules (in encoding order)

module vumeter.so

module sndfile.so

module speex_aec.so

module speex_pp.so

module plc.so

Audio driver Modules

module alsa.so

module pulse.so

module jack.so

module portaudio.so

module aubridge.so

module aufile.so

Video codec Modules (in order)

module avcodec.so

module v4l2_codec.so

module vp8.so

module vp9.so

module h265.so

Video filter Modules (in encoding order)

module selfview.so

module snapshot.so

module swscale.so

module vidinfo.so

Video source modules

module avformat.so

module v4l2.so

module v4l.so

module x11grab.so

module cairo.so

module vidbridge.so

Video display modules

module directfb.so

module x11.so

module sdl2.so

module fakevideo.so

Audio/Video source modules

module rst.so

module gst1.so

module gst_video1.so

Media NAT modules

module stun.so

module turn.so

module ice.so

module natpmp.so

Media encryption modules

module srtp.so

module dtls_srtp.so

module zrtp.so

------------------------------------------------------------------------------

Temporary Modules (loaded then unloaded)

module_tmp uuid.so

module_tmp account.so

------------------------------------------------------------------------------

Application Modules

module_app auloop.so module_app contact.so

module_app debug_cmd.so

module_app dtmfio.so

module_app echo.so

module_app gtk.so

module_app menu.so

module_app mwi.so

module_app natbd.so

module_app presence.so

module_app syslog.so

module_app vidloop.so

------------------------------------------------------------------------------

Module parameters

cons_listen 0.0.0.0:5555

http_listen 0.0.0.0:8000

evdev_device /dev/input/event0

Speex codec parameters

speex_quality 7 # 0-10 speex_complexity 7 # 0-10 speex_enhancement 0 # 0-1 speex_mode_nb 3 # 1-6 speex_mode_wb 6 # 1-6 speex_vbr 0 # Variable Bit Rate 0-1 speex_vad 0 # Voice Activity Detection 0-1 speex_agc_level 8000

Opus codec parameters

opus_bitrate 28000 # 6000-510000

Selfview

video_selfview window # {window,pip}

selfview_size 64x64

ICE

ice_turn no ice_debug no ice_nomination regular # {regular,aggressive} ice_mode full # {full,lite}

Menu

redial_attempts 3 # Num or

redial_delay 5 # Delay in seconds

Any ideas?

Thanks in advance

Giordano

该提问来源于开源项目:baresip/baresip

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

10条回答

  • weixin_40001275 weixin_40001275 5月前

    can you please try to upgrade to the latest version, either GIT HEAD or v0.6.4 and then apply this patch:

    patch
    diff --git a/modules/avformat/avformat.c b/modules/avformat/avformat.c
    index c2d7eb5..10fcf20 100644
    --- a/modules/avformat/avformat.c
    +++ b/modules/avformat/avformat.c
    @@ -70,6 +70,7 @@ static enum vidfmt avpixfmt_to_vidfmt(enum AVPixelFormat pix_fmt)
            switch (pix_fmt) {
    
            case AV_PIX_FMT_YUV420P:  return VID_FMT_YUV420P;
    +       case AV_PIX_FMT_YUYV422:  return VID_FMT_YUYV422;
            case AV_PIX_FMT_YUVJ420P: return VID_FMT_YUV420P;
            case AV_PIX_FMT_YUV444P:  return VID_FMT_YUV444P;
            case AV_PIX_FMT_NV12:     return VID_FMT_NV12;
    
    点赞 评论 复制链接分享
  • weixin_40001275 weixin_40001275 5月前

    BTW, it is probably better to use the v4l2.so module instead:

    
    video_source v4l2,/dev/video0
    
    点赞 评论 复制链接分享
  • weixin_39917485 weixin_39917485 5月前

    Hi Alfred,

    thanks for your feedback. Using v4l2 as video source, i get this error:

    root:~/.baresip# baresip -vv

    baresip v0.5.6 Copyright (C) 2010 - 2017 Alfred E. Heggestad et al.

    Binding to interface 'br-lan'

    Local network address: IPv4=br-lan:172.30.1.127 IPv6=br-lan:fd52:5094:3908::1

    ui: stdio

    cons: UI console listening on 0.0.0.0:5555

    ui: cons

    aucodec: PCMU/8000/1

    aucodec: PCMA/8000/1

    ausrc: alsa

    auplay: alsa

    v4l2_codec inited

    vidcodec: H264

    vidsrc: v4l2_codec

    vidsrc: v4l2

    Populated 1 account

    module: loading app auloop.so

    module: loading app contact.so

    Populated 3 contacts

    module: loading app menu.so

    Populated 2 audio codecs

    Populated 0 audio filters

    Populated 1 video codec

    Populated 0 video filters

    baresip is ready.

    809.30.1.203: {0/UDP/v4} 200 OK (ViVo VoIP PBX) [1 binding]

    All 1 useragent registered successfully! (8 ms)

    call: alloc with params laddr=172.30.1.127, af=AF_INET, use_rtp=1

    call: use_video=1

    answering call from sip:615.tld with 200

    call: update media

    audio: Set audio decoder: PCMA 8000Hz 1ch

    alsa: reset: srate=8000, ch=1, num_frames=160, pcmfmt=S16_LE

    alsa: playback started (default)

    audio: Set audio encoder: PCMA 8000Hz 1ch

    alsa: reset: srate=8000, ch=1, num_frames=160, pcmfmt=S16_LE

    alsa: recording started (default)

    audio tx pipeline: alsa ---> PCMA

    audio rx pipeline: alsa <--- PCMA

    Set video encoder: H264 packetization-mode=0 (1000 bit/s, 10 fps)

    v4l2_codec: video encoder H264: 10 fps, 1000 bit/s, pktsize=1024

    video: no video display

    v4l2: /dev/video0: found valid V4L2 device (352 x 288) pixfmt=YUYV

    v4l2: Current input: "Camera 1"

    video: vidcodec 'H264' has no decoder

    video: could not find decoder (H264)

    call: video stream error: No such file or directory

    809.30.1.203: Call established: sip:615.tld

    call: terminate call '295f7d600d19541139d10be672ad7c7c.tld' with sip:615.tld

    alsa: stopping recording thread (default)

    alsa: stopping playback thread (default)

    video: stopping video source ..

    sip:809-0xbf8528.30.1.127:5060: Call with sip:615.tld terminated (duration: 12 secs)

    video: stopping video source ..

    It seems that there is no H264 decoder.

    Thanks again for your support

    Da: Alfred E. Heggestad [mailto:notifications.com] Inviato: sabato 12 ottobre 2019 16:10 A: alfredh/baresip Cc: ggrandis ; Author Oggetto: Re: [alfredh/baresip] Video from USB camera (#811)

    BTW, it is probably better to use the v4l2.so module instead:

    video_source v4l2,/dev/video0

    — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alfredh/baresip/issues/811?email_source=notifications&email_token=AJDSC3BVNIBLKT33KKGJGXLQOHLCNA5CNFSM4I5FV6K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCAHXI#issuecomment-541328349 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJDSC3DQ2NN47TJZC2DMHD3QOHLCNANCNFSM4I5FV6KQ .

    点赞 评论 复制链接分享
  • weixin_40001275 weixin_40001275 5月前

    v4l2.so and v4l2_codec.so is two different modules.

    v4l2_codec.so should only be used if you know that your camera has a build-in H264 encoder.

    you need to use avcodec.so instead

    点赞 评论 复制链接分享
  • weixin_39917485 weixin_39917485 5月前

    Ok, but i’’m not so good with cross compile, i need to apply the patch and then compile for openwrt.

    Will try next week

    tnx

    Da: Alfred E. Heggestad [mailto:notifications.com] Inviato: sabato 12 ottobre 2019 16:08 A: alfredh/baresip Cc: ggrandis ; Author Oggetto: Re: [alfredh/baresip] Video from USB camera (#811)

    can you please try to upgrade to the latest version, either GIT HEAD or v0.6.4 and then apply this patch:

    diff --git a/modules/avformat/avformat.c b/modules/avformat/avformat.c index c2d7eb5..10fcf20 100644 --- a/modules/avformat/avformat.c +++ b/modules/avformat/avformat.c @@ -70,6 +70,7 @@ static enum vidfmt avpixfmt_to_vidfmt(enum AVPixelFormat pix_fmt) switch (pix_fmt) {

        case AV_PIX_FMT_YUV420P:  return VID_FMT_YUV420P;
    
    • case AV_PIX_FMT_YUYV422: return VID_FMT_YUYV422; case AV_PIX_FMT_YUVJ420P: return VID_FMT_YUV420P; case AV_PIX_FMT_YUV444P: return VID_FMT_YUV444P; case AV_PIX_FMT_NV12: return VID_FMT_NV12;

    — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alfredh/baresip/issues/811?email_source=notifications&email_token=AJDSC3DUECB4IUJONC5F6XTQOHK4XA5CNFSM4I5FV6K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCAG3Y#issuecomment-541328239 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJDSC3EOUV2TD4YJ2IWG7KTQOHK4XANCNFSM4I5FV6KQ .

    点赞 评论 复制链接分享
  • weixin_39917485 weixin_39917485 5月前

    Sorry…that’s new verbose

    root:~/.baresip# baresip -vv

    baresip v0.5.6 Copyright (C) 2010 - 2017 Alfred E. Heggestad et al.

    Binding to interface 'br-lan'

    Local network address: IPv4=br-lan:172.30.1.127 IPv6=br-lan:fd52:5094:3908::1

    ui: stdio

    cons: UI console listening on 0.0.0.0:5555

    ui: cons

    aucodec: PCMU/8000/1

    aucodec: PCMA/8000/1

    ausrc: alsa

    auplay: alsa

    avcodec: using libavcodec H.264 encoder

    vidcodec: H264

    vidcodec: H263

    vidcodec: MP4V-ES

    vidsrc: v4l2

    Populated 1 account

    module: loading app auloop.so

    module: loading app contact.so

    Populated 3 contacts

    module: loading app menu.so

    Populated 2 audio codecs

    Populated 0 audio filters

    Populated 3 video codecs

    Populated 0 video filters

    baresip is ready.

    809.30.1.203: {0/UDP/v4} 200 OK (ViVo VoIP PBX) [1 binding]

    All 1 useragent registered successfully! (24 ms)

    call: alloc with params laddr=172.30.1.127, af=AF_INET, use_rtp=1

    call: use_video=1

    answering call from sip:615.tld with 200

    call: update media

    audio: Set audio decoder: PCMA 8000Hz 1ch

    alsa: reset: srate=8000, ch=1, num_frames=160, pcmfmt=S16_LE

    alsa: playback started (default)

    audio: Set audio encoder: PCMA 8000Hz 1ch

    alsa: reset: srate=8000, ch=1, num_frames=160, pcmfmt=S16_LE

    alsa: recording started (default)

    audio tx pipeline: alsa ---> PCMA

    audio rx pipeline: alsa <--- PCMA

    Set video encoder: H264 packetization-mode=0 (1000 bit/s, 10 fps)

    avcodec: H264: could not init encoder

    video: encoder alloc: No such file or directory

    call: video stream error: No such file or directory

    sip:615.tld: session closed: Connection reset by peer

    alsa: stopping recording thread (default)

    alsa: stopping playback thread (default)

    video: stopping video source ..

    video: stopping video source ..

    Da: Alfred E. Heggestad [mailto:notifications.com] Inviato: sabato 12 ottobre 2019 16:31 A: alfredh/baresip Cc: ggrandis ; Author Oggetto: Re: [alfredh/baresip] Video from USB camera (#811)

    v4l2.so and v4l2_codec.so is two different modules.

    v4l2_codec.so should only be used if you know that your camera has a build-in H264 encoder.

    you need to use avcodec.so instead

    — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alfredh/baresip/issues/811?email_source=notifications&email_token=AJDSC3FOYMLGF2JA4RPFKFTQOHNR3A5CNFSM4I5FV6K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCAUZI#issuecomment-541330021 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJDSC3FYEBJZGTR2LDUEPLLQOHNR3ANCNFSM4I5FV6KQ . https://github.com/notifications/beacon/AJDSC3BZ56WTSB6YZ6ZZU7TQOHNR3A5CNFSM4I5FV6K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCAUZI.gif

    点赞 评论 复制链接分享
  • weixin_40001275 weixin_40001275 5月前

    which video-codecs does the remove peer supports ?

    if you want to use H.264 codec then make sure libavcodec.so package is compiled with x264 support (for the encoder).

    otherwise you can try H.263, MPEG4 or even VP8 (in vp8.so).

    点赞 评论 复制链接分享
  • weixin_40001275 weixin_40001275 5月前

    https://github.com/openwrt/telephony/issues/474

    点赞 评论 复制链接分享
  • weixin_39917485 weixin_39917485 5月前

    Thanks, very appreciate

    Da: Alfred E. Heggestad [mailto:notifications.com] Inviato: sabato 12 ottobre 2019 17:11 A: alfredh/baresip Cc: ggrandis ; Author Oggetto: Re: [alfredh/baresip] Video from USB camera (#811)

    openwrt/telephony#474 https://github.com/openwrt/telephony/issues/474

    — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alfredh/baresip/issues/811?email_source=notifications&email_token=AJDSC3BN4Y6DNOIM7NLXJTTQOHSGNA5CNFSM4I5FV6K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCBPIA#issuecomment-541333408 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJDSC3GS2BW6VJZ4JS2Z2TDQOHSGNANCNFSM4I5FV6KQ . https://github.com/notifications/beacon/AJDSC3FGOJ4JANIQ44YURT3QOHSGNA5CNFSM4I5FV6K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCBPIA.gif

    点赞 评论 复制链接分享
  • weixin_40001275 weixin_40001275 5月前

    please re-open when you have cross compiled and tested again.

    点赞 评论 复制链接分享

相关推荐