Giter VIP home page Giter VIP logo

Comments (10)

alfredh avatar alfredh commented on May 21, 2024

if you are using /dev/video0 maybe it is better to use V4L2 module.

how does your $HOME/.baresip/config look like ?

from baresip.

lecheel avatar lecheel commented on May 21, 2024

it's not the big deal for config
the benfit is baresip support gstreamer I want try logitech c920 (which is H.264 encode camera support gstreamer) for the video stream without need decode to raw and compress in H.264 which directly go through RTP if possible

# Video
video_source            v4l2,/dev/video0
#video_source            gst_video,vidcodec
#video_display          x11,nil
#video_source            avformat,/tmp/foo.mp4
video_size              640x480
video_bitrate           500000
video_fps               25

# 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

# Network
#dns_server             10.0.0.1:53
#net_interface          eth0

# BFCP
#bfcp_proto             udp

#------------------------------------------------------------------------------
# Modules

module_path             /usr/local/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

# Audio filter Modules (in encoding order)
module                  vumeter.so
#module                 sndfile.so
#module                 speex_aec.so
#module                 speex_pp.so
#module                  webrtc_aec.so
#module                 plc.so

# Audio driver Modules
module                  alsa.so
#module                 portaudio.so

# Video codec Modules (in order)
module                  avcodec.so
module                  avformat.so
module                  fakevideo.so
#module                 vpx.so

# Video filter Modules (in encoding order)
#module                 selfview.so

from baresip.

alfredh avatar alfredh commented on May 21, 2024

I also have a C920 camera here, would like to try to implement a V4L2
driver for and extract H.264 packets ..

from baresip.

lecheel avatar lecheel commented on May 21, 2024

try this gst-launch-1.0 -v -e uvch264src device=/dev/video1 name=src auto-start=true src.vfsrc ! queue ! video/x-raw,format=(string)YUY2,width=320,height=240,framerate=10/1 ! xvimagesink sync=false src.vidsrc ! queue ! video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse ! avdec_h264 ! xvimagesink sync=false

from baresip.

czarkoff avatar czarkoff commented on May 21, 2024

FWIW it would be nice to use both streams from the device: h264 stream for sending video data and uncompressed stream for selfview. It's a pity I don't have any hardware with similar capabilities.

from baresip.

alfredh avatar alfredh commented on May 21, 2024

0f25118

I have created a new module called "v4l2_codec"

this module uses the V4L2-api on Linux to read H.264-encoded frames from /dev/video0
and packetize them via H.264. It has been tested on Debian Linux and with
the Logitech C920 camera.

Please check the README for how to use it.

from baresip.

lecheel avatar lecheel commented on May 21, 2024

wow awesome!!!!

from baresip.

tjim avatar tjim commented on May 21, 2024

Thanks for v4l2_codec, I've tried it and it works.
One thing to be careful about is order of "module" lines.
For example, I use module avcodec for decoding, but avcodec can both encode and decode.
So if you put "module avcodec.so" before "module v4l2_codec" in your config, then you won't get the hardware encoding, you will get the avcodec software decoding.
Latency over wifi is not great, 5-6 seconds? but not sure whether to blame encoding.

from baresip.

tjim avatar tjim commented on May 21, 2024

BTW I would also like to use v4l2_codec with the camera module of a raspberry pi. It has hardware encoding AND decoding of h264. However v4l2_codec is not presently working for the camera module, even though the v4l2 driver for the camera module supports the hardware encoding.

(Also, my testing with the C920 was on the raspberry pi.)

from baresip.

alfredh avatar alfredh commented on May 21, 2024

thanks for the feedback, closing this issue for now.

If you want to contribute, you are welcome to write a small HOWTO on the Baresip WIKI-page
(or another place).

from baresip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.