GithubHelp home page GithubHelp logo

iizukanao / picam Goto Github PK

View Code? Open in Web Editor NEW
486.0 486.0 78.0 4.17 MB

Audio/video recorder for Raspberry Pi with language agnostic API

License: GNU Lesser General Public License v2.1

Shell 1.50% C 25.88% CMake 2.83% C++ 69.78%

picam's People

Contributors

benpurdy avatar francescovannini avatar frodox avatar iizukanao avatar karoisuzvards avatar linkaan avatar marler8997 avatar nalajcie avatar technologyclassroom avatar wasalm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

picam's Issues

Displaying multiple text overlays simultaneously

Hi Nao,

I have switched over to a RPi 2 because the text overlay was unfortunately too CPU intensive for an RPI A+. This feature is very useful to me and I think it could be further improved by having the option to display multiple text overlays simultaneously. I'd like to be able to write a subtitle hook in this manner:

{
text=●REC
font_name=FreeSans
pt=40
layout_align=top,right
horizontal_margin=30
vertical_margin=30
color=000000
stroke_width=0
duration=0
}
{
text=OUTSIDE 25'C\\nCPU 30'C
font_name=FreeMono:style=Bold
pt=20
layout_align=top,left
text_align=left
horizontal_margin=30
vertical_margin=30
duration=0
}

Or even to have a directory subtitle to which you can write multiple subtitle hooks dynamically.
I understand this might be hard to implement and there are workarounds I could do to overcome this but if it is possible to implement I think it would be a good improvement!

Another improvement I'd love to see which could be very useful is to have an option, like show_in_video=true|false, to display the text overlay in the recorded video or only on the livestream. This I understand might be extremely difficult to implement and it is not really necessary. I think it is somehow possible to add overlays in ffmpeg dynamically anyway?

Motion detection?

Hi there,

first of all fantastic work, really excited to have discovered this project. I was wondering if you had any plans to support motion detection. I realize this might be out of scope, but thought I'd ask since it's something I'm looking into. Also I thought I'd mention this project, which is doing something similar and has motion implemented (uses openmax too):

https://github.com/dickontoo/omxmotion/blob/master/motion.c

best,

Spike

latency issues

Hi,

I've downloaded pre installed version and after a little bit of struggle, it's up and running via nginx.
That's a great work thank you.

When I stream via nginx (not the m3u8) (I use VLC on mac) there is a up to 10 seconds latency despite it's working on the local network. Sometimes the sound and the video both freezes and then continues.

I think "Create symbolic links (optional, but strongly recommended)" may create a observable difference. But as I'm a newbie on linux platforms, I don't know what to do exactly.

If you don't mind about to write this steps, I would gladly test the situation.

I've tested a series of resolutions 640x480, via cable lan, overclocking the raspberry but no hope.
I've been using raspi 2 btw.

thank you
best.
Ali

Recording "raspistill" like preview jpeg image while recording TS?

Trying to combine picam and linphone on rpi, and only way to do it is to connect linphone video to static picture source instead of camera (camera can not be shared btw picam and linphone), so I'm missing "raspistill" feature on picam - i.e. when hook "start_record" is executed to enable in addition constant generation of always the same image that will hold latest camera preview (i.e. "preview.jpg").

Other approach would be to introduce hooks "start_preview" and "stop_preview" to enable streaming to jpeg file (that should be possible to work concurrently with start_record and stop_record hooks).

Not-optimal approach would be to introduce hook "get_preview_image".

Is there possibility to introduce this feature?

API?

First of all, thank you for this great application. I'm using the recordbuf to pre-record segments of video that I can then record to disk if an event worth recording happened in the previous X seconds.

Some of the things I could use an API for:
-While hooks seem to work for manual execution, it would be great to have start and end record happen through an API (allowing the file name and directory to be set at start and some elements of standard meta data returned from the file at end capture)
-Changing the amount of delayed video captured from the recordbuf would be nice too, but that would probably be hard to implement (e.g. record with 10 seconds pre-video vs 5 seconds).

Thanks,
Steve

record bitrate and stream bitrate

Hi,
First thank you for your tool. I successfully install Picam and node-rtsp-rtmp-server. I'm using --rtspout flag to enable output for node-rtsp-rtmp-server in picam and it is working well. I receive video stream in VLC by opening a network stream with this adress rtsp://PI_HOST:80/live/picam

I want to know if it possible to have one bitrate used by picam to record on pi disk and an other bitrate for streaming ? In my case streaming is only for a preview use so a low bitrate, (even low resolution) for low latency stream is prefered. But i want to keep the best quality for the the video recording on pi.
Is node-rtsp-rtmp-server reencoding video ? Do I have to change some parameters in coffee.config ?

thank you !

build from source error

Hi,

I have started playing with Raspberry Pi and camera module. I am trying to record with picam and wanted to build the picam on my Raspberry Pi that already have ffmpeg.

This is the output of ffmpeg is shown below and I am getting the following error and not sure how to fix it and wondering if you can see some silly mistakes in my setup.

Thanks,

pi@raspberrypi ~/picam $ ffmpeg
ffmpeg version git-2014-12-10-0fadbd3 Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 15 2014 14:27:50 with gcc 4.6 (Debian 4.6.3-14+rpi1)
configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libaacplus --enable-librtmp --enable-libmp3lame --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex --enable-librtmp --enable-libtheora --enable-libvorbis --enable-nonfree --enable-version3
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 14.100 / 56. 14.100
libavformat 56. 15.103 / 56. 15.103
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 2.103 / 5. 2.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

cc stream.o hooks.o mpegts.o httplivestreaming.o state.o log.o -o picam -g -Wl,--whole-archive -lilclient -L/opt/vc/lib/ -L/usr/local/lib -lGLESv2 -lEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -L/opt/vc/src/hello_pi/libs/ilclient -Wl,--no-whole-archive -rdynamic -lavformat -lavcodec -ldl -lasound -lavutil -lm -lfdk-aac -lcrypto -lswresample -lz -pipe
/usr/local/lib/libavcodec.a(libaacplus.o): In function aacPlus_encode_frame': /home/pi/src/ffmpeg/libavcodec/libaacplus.c:103: undefined reference toaacplusEncEncode'
/usr/local/lib/libavcodec.a(libaacplus.o): In function aacPlus_encode_close': /home/pi/src/ffmpeg/libavcodec/libaacplus.c:115: undefined reference toaacplusEncClose'
/usr/local/lib/libavcodec.a(libaacplus.o): In function aacPlus_encode_init': /home/pi/src/ffmpeg/libavcodec/libaacplus.c:54: undefined reference toaacplusEncOpen'
/home/pi/src/ffmpeg/libavcodec/libaacplus.c:62: undefined reference to aacplusEncGetCurrentConfiguration' /home/pi/src/ffmpeg/libavcodec/libaacplus.c:68: undefined reference toaacplusEncSetConfiguration'
/home/pi/src/ffmpeg/libavcodec/libaacplus.c:82: undefined reference to aacplusEncGetDecoderSpecificInfo' /usr/local/lib/libavcodec.a(libmp3lame.o): In functionmp3lame_encode_frame':
/home/pi/src/ffmpeg/libavcodec/libmp3lame.c:211: undefined reference to lame_encode_buffer_float' /home/pi/src/ffmpeg/libavcodec/libmp3lame.c:195: undefined reference tolame_encode_buffer'
/home/pi/src/ffmpeg/libavcodec/libmp3lame.c:198: undefined reference to lame_encode_buffer_int' /home/pi/src/ffmpeg/libavcodec/libmp3lame.c:219: undefined reference tolame_encode_flush'
/usr/local/lib/libavcodec.a(libmp3lame.o): In function mp3lame_encode_close': /home/pi/src/ffmpeg/libavcodec/libmp3lame.c:86: undefined reference tolame_close'
/usr/local/lib/libavcodec.a(libmp3lame.o): In function mp3lame_encode_init': /home/pi/src/ffmpeg/libavcodec/libmp3lame.c:98: undefined reference tolame_init'
/home/pi/src/ffmpeg/libavcodec/libmp3lame.c:102: undefined reference to lame_set_num_channels' /home/pi/src/ffmpeg/libavcodec/libmp3lame.c:103: undefined reference tolame_set_mode'
/home/pi/src/ffmpeg/libavcodec/libmp3lame.c:106: undefined reference to lame_set_in_samplerate' /home/pi/src/ffmpeg/libavcodec/libmp3lame.c:107: undefined reference tolame_set_out_samplerate'
/home/pi/src/ffmpeg/libavcodec/libmp3lame.c:111: undefined reference to lame_set_quality' /home/pi/src/ffmpeg/libavcodec/libmp3lame.c:115: undefined reference tolame_set_VBR'
/home/pi/src/ffmpeg/libavcodec/libmp3lame.c:116: undefined reference to lame_set_VBR_quality' /home/pi/src/ffmpeg/libavcodec/libmp3lame.c:120: undefined reference tolame_set_VBR'
/home/pi/src/ffmpeg/libavcodec/libmp3lame.c:121: undefined reference to lame_set_VBR_mean_bitrate_kbps' /home/pi/src/ffmpeg/libavcodec/libmp3lame.c:123: undefined reference tolame_set_brate'
/home/pi/src/ffmpeg/libavcodec/libmp3lame.c:128: undefined reference to lame_set_bWriteVbrTag' /home/pi/src/ffmpeg/libavcodec/libmp3lame.c:131: undefined reference tolame_set_disable_reservoir'
/home/pi/src/ffmpeg/libavcodec/libmp3lame.c:134: undefined reference to lame_init_params' /home/pi/src/ffmpeg/libavcodec/libmp3lame.c:140: undefined reference tolame_get_encoder_delay'
/home/pi/src/ffmpeg/libavcodec/libmp3lame.c:143: undefined reference to lame_get_framesize' /usr/local/lib/libavcodec.a(libopencore-amr.o): In functionamr_wb_decode_close':
/home/pi/src/ffmpeg/libavcodec/libopencore-amr.c:362: undefined reference to D_IF_exit' /usr/local/lib/libavcodec.a(libopencore-amr.o): In functionamr_nb_encode_frame':
/home/pi/src/ffmpeg/libavcodec/libopencore-amr.c:266: undefined reference to Encoder_Interface_Encode' /usr/local/lib/libavcodec.a(libopencore-amr.o): In functionamr_nb_decode_frame':
/home/pi/src/ffmpeg/libavcodec/libopencore-amr.c:122: undefined reference to Decoder_Interface_Decode' /usr/local/lib/libavcodec.a(libopencore-amr.o): In functionamr_wb_decode_frame':
/home/pi/src/ffmpeg/libavcodec/libopencore-amr.c:351: undefined reference to D_IF_decode' /usr/local/lib/libavcodec.a(libopencore-amr.o): In functionamr_wb_decode_init':
/home/pi/src/ffmpeg/libavcodec/libopencore-amr.c:317: undefined reference to D_IF_init' /usr/local/lib/libavcodec.a(libopencore-amr.o): In functionamr_nb_encode_close':
/home/pi/src/ffmpeg/libavcodec/libopencore-amr.c:221: undefined reference to Encoder_Interface_exit' /usr/local/lib/libavcodec.a(libopencore-amr.o): In functionamr_nb_encode_init':
/home/pi/src/ffmpeg/libavcodec/libopencore-amr.c:205: undefined reference to Encoder_Interface_init' /usr/local/lib/libavcodec.a(libopencore-amr.o): In functionamr_nb_decode_close':
/home/pi/src/ffmpeg/libavcodec/libopencore-amr.c:86: undefined reference to Decoder_Interface_exit' /usr/local/lib/libavcodec.a(libopencore-amr.o): In functionamr_nb_decode_init':
/home/pi/src/ffmpeg/libavcodec/libopencore-amr.c:73: undefined reference to Decoder_Interface_init' /usr/local/lib/libavcodec.a(libspeexdec.o): In functionlibspeex_decode_frame':
/home/pi/src/ffmpeg/libavcodec/libspeexdec.c:146: undefined reference to speex_bits_remaining' /home/pi/src/ffmpeg/libavcodec/libspeexdec.c:156: undefined reference tospeex_bits_read_from'
/home/pi/src/ffmpeg/libavcodec/libspeexdec.c:161: undefined reference to speex_decode_int' /home/pi/src/ffmpeg/libavcodec/libspeexdec.c:147: undefined reference tospeex_bits_peek_unsigned'
/home/pi/src/ffmpeg/libavcodec/libspeexdec.c:172: undefined reference to speex_decoder_ctl' /home/pi/src/ffmpeg/libavcodec/libspeexdec.c:167: undefined reference tospeex_decode_stereo_int'
/usr/local/lib/libavcodec.a(libspeexdec.o): In function libspeex_decode_flush': /home/pi/src/ffmpeg/libavcodec/libspeexdec.c:189: undefined reference tospeex_bits_reset'
/usr/local/lib/libavcodec.a(libspeexdec.o): In function libspeex_decode_close': /home/pi/src/ffmpeg/libavcodec/libspeexdec.c:180: undefined reference tospeex_bits_destroy'
/home/pi/src/ffmpeg/libavcodec/libspeexdec.c:181: undefined reference to speex_decoder_destroy' /usr/local/lib/libavcodec.a(libspeexdec.o): In functionlibspeex_decode_init':
/home/pi/src/ffmpeg/libavcodec/libspeexdec.c:48: undefined reference to speex_packet_to_header' /home/pi/src/ffmpeg/libavcodec/libspeexdec.c:73: undefined reference tospeex_header_free'
/home/pi/src/ffmpeg/libavcodec/libspeexdec.c:88: undefined reference to speex_lib_get_mode' /home/pi/src/ffmpeg/libavcodec/libspeexdec.c:106: undefined reference tospeex_bits_init'
/home/pi/src/ffmpeg/libavcodec/libspeexdec.c:107: undefined reference to speex_decoder_init' /home/pi/src/ffmpeg/libavcodec/libspeexdec.c:119: undefined reference tospeex_decoder_ctl'
/home/pi/src/ffmpeg/libavcodec/libspeexdec.c:44: undefined reference to speex_std_stereo_request_handler' /home/pi/src/ffmpeg/libavcodec/libspeexdec.c:44: undefined reference tospeex_nb_mode'
/usr/local/lib/libavcodec.a(libspeexenc.o): In function encode_frame': /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:279: undefined reference tospeex_encode_int'
/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:297: undefined reference to speex_bits_nbytes' /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:299: undefined reference tospeex_bits_write'
/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:300: undefined reference to speex_bits_reset' /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:289: undefined reference tospeex_bits_pack'
/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:278: undefined reference to speex_encode_stereo_int' /usr/local/lib/libavcodec.a(libspeexenc.o): In functionencode_close':
/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:317: undefined reference to speex_bits_destroy' /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:318: undefined reference tospeex_encoder_destroy'
/usr/local/lib/libavcodec.a(libspeexenc.o): In function encode_init': /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:172: undefined reference tospeex_encoder_init'
/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:177: undefined reference to speex_init_header' /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:184: undefined reference tospeex_encoder_ctl'
/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:187: undefined reference to speex_encoder_ctl' /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:193: undefined reference tospeex_encoder_ctl'
/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:195: undefined reference to speex_encoder_ctl' /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:198: undefined reference tospeex_encoder_ctl'
/usr/local/lib/libavcodec.a(libspeexenc.o):/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:200: more undefined references to speex_encoder_ctl' follow /usr/local/lib/libavcodec.a(libspeexenc.o): In functionencode_init':
/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:245: undefined reference to speex_header_to_packet' /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:250: undefined reference tospeex_header_free'
/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:251: undefined reference to speex_encoder_destroy' /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:259: undefined reference tospeex_header_free'
/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:262: undefined reference to speex_bits_init' /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:266: undefined reference tospeex_uwb_mode'
/home/pi/src/ffmpeg/libavcodec/libspeexenc.c:266: undefined reference to speex_nb_mode' /home/pi/src/ffmpeg/libavcodec/libspeexenc.c:266: undefined reference tospeex_wb_mode'
/usr/local/lib/libavcodec.a(libtheoraenc.o): In function submit_stats': /home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:137: undefined reference toth_encode_ctl'
/usr/local/lib/libavcodec.a(libtheoraenc.o): In function get_stats': /home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:96: undefined reference toth_encode_ctl'
/usr/local/lib/libavcodec.a(libtheoraenc.o): In function encode_frame': /home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:297: undefined reference toth_encode_ycbcr_in'
/home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:320: undefined reference to th_encode_packetout' /home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:277: undefined reference toth_encode_packetout'
/usr/local/lib/libavcodec.a(libtheoraenc.o): In function encode_close': /home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:353: undefined reference toth_encode_free'
/usr/local/lib/libavcodec.a(libtheoraenc.o): In function encode_init': /home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:166: undefined reference toth_info_init'
/home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:218: undefined reference to th_encode_alloc' /home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:226: undefined reference toth_info_clear'
/home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:228: undefined reference to th_encode_ctl' /home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:253: undefined reference toth_comment_init'
/home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:255: undefined reference to th_encode_flushheader' /home/pi/src/ffmpeg/libavcodec/libtheoraenc.c:259: undefined reference toth_comment_clear'
/usr/local/lib/libavcodec.a(libvorbisenc.o): In function libvorbis_encode_frame': /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:287: undefined reference tovorbis_analysis_buffer'
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:294: undefined reference to vorbis_analysis_wrote' /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:310: undefined reference tovorbis_analysis_blockout'
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:311: undefined reference to vorbis_analysis' /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:313: undefined reference tovorbis_bitrate_addblock'
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:317: undefined reference to vorbis_bitrate_flushpacket' /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:294: undefined reference tovorbis_analysis_wrote'
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:302: undefined reference to vorbis_analysis_wrote' /usr/local/lib/libavcodec.a(libvorbisenc.o): In functionlibvorbis_encode_close':
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:180: undefined reference to vorbis_analysis_wrote' /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:182: undefined reference tovorbis_block_clear'
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:183: undefined reference to vorbis_dsp_clear' /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:184: undefined reference tovorbis_info_clear'
/usr/local/lib/libavcodec.a(libvorbisenc.o): In function libvorbis_encode_init': /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:203: undefined reference tovorbis_info_init'
/usr/local/lib/libavcodec.a(libvorbisenc.o): In function libvorbis_setup': /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:98: undefined reference tovorbis_encode_setup_vbr'
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:107: undefined reference to vorbis_encode_setup_managed' /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:114: undefined reference tovorbis_encode_ctl'
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:121: undefined reference to vorbis_encode_ctl' /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:127: undefined reference tovorbis_encode_ctl'
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:160: undefined reference to vorbis_encode_setup_init' /usr/local/lib/libavcodec.a(libvorbisenc.o): In functionlibvorbis_encode_init':
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:208: undefined reference to vorbis_analysis_init' /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:214: undefined reference tovorbis_block_init'
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:220: undefined reference to vorbis_comment_init' /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:222: undefined reference tovorbis_comment_add_tag'
/home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:224: undefined reference to vorbis_analysis_headerout' /home/pi/src/ffmpeg/libavcodec/libvorbisenc.c:257: undefined reference tovorbis_comment_clear'
/usr/local/lib/libavcodec.a(libx264.o): In function X264_frame': /home/pi/src/ffmpeg/libavcodec/libx264.c:169: undefined reference tox264_picture_init'
/home/pi/src/ffmpeg/libavcodec/libx264.c:265: undefined reference to x264_encoder_reconfig' /home/pi/src/ffmpeg/libavcodec/libx264.c:270: undefined reference tox264_encoder_encode'
/home/pi/src/ffmpeg/libavcodec/libx264.c:191: undefined reference to x264_encoder_reconfig' /home/pi/src/ffmpeg/libavcodec/libx264.c:197: undefined reference tox264_encoder_reconfig'
/home/pi/src/ffmpeg/libavcodec/libx264.c:204: undefined reference to x264_encoder_reconfig' /home/pi/src/ffmpeg/libavcodec/libx264.c:224: undefined reference tox264_encoder_reconfig'
/home/pi/src/ffmpeg/libavcodec/libx264.c:230: undefined reference to x264_encoder_reconfig' /usr/local/lib/libavcodec.a(libx264.o):/home/pi/src/ffmpeg/libavcodec/libx264.c:210: more undefined references tox264_encoder_reconfig' follow
/usr/local/lib/libavcodec.a(libx264.o): In function X264_frame': /home/pi/src/ffmpeg/libavcodec/libx264.c:276: undefined reference tox264_encoder_delayed_frames'
/home/pi/src/ffmpeg/libavcodec/libx264.c:270: undefined reference to x264_encoder_encode' /home/pi/src/ffmpeg/libavcodec/libx264.c:276: undefined reference tox264_encoder_delayed_frames'
/home/pi/src/ffmpeg/libavcodec/libx264.c:270: undefined reference to x264_encoder_encode' /home/pi/src/ffmpeg/libavcodec/libx264.c:217: undefined reference tox264_encoder_reconfig'
/home/pi/src/ffmpeg/libavcodec/libx264.c:270: undefined reference to x264_encoder_encode' /usr/local/lib/libavcodec.a(libx264.o): In functionencode_nals':
/home/pi/src/ffmpeg/libavcodec/libx264.c:110: undefined reference to x264_bit_depth' /usr/local/lib/libavcodec.a(libx264.o): In functionX264_close':
/home/pi/src/ffmpeg/libavcodec/libx264.c:311: undefined reference to x264_encoder_close' /usr/local/lib/libavcodec.a(libx264.o): In functionX264_init':
/home/pi/src/ffmpeg/libavcodec/libx264.c:374: undefined reference to x264_param_default' /home/pi/src/ffmpeg/libavcodec/libx264.c:379: undefined reference tox264_param_default_preset'
/home/pi/src/ffmpeg/libavcodec/libx264.c:401: undefined reference to x264_param_parse' /home/pi/src/ffmpeg/libavcodec/libx264.c:431: undefined reference tox264_param_parse'
/home/pi/src/ffmpeg/libavcodec/libx264.c:512: undefined reference to x264_param_parse' /home/pi/src/ffmpeg/libavcodec/libx264.c:513: undefined reference tox264_param_parse'
/home/pi/src/ffmpeg/libavcodec/libx264.c:514: undefined reference to x264_param_parse' /usr/local/lib/libavcodec.a(libx264.o):/home/pi/src/ffmpeg/libavcodec/libx264.c:515: more undefined references tox264_param_parse' follow
/usr/local/lib/libavcodec.a(libx264.o): In function X264_init': /home/pi/src/ffmpeg/libavcodec/libx264.c:515: undefined reference tox264_levels'
/home/pi/src/ffmpeg/libavcodec/libx264.c:573: undefined reference to x264_param_apply_fastfirstpass' /home/pi/src/ffmpeg/libavcodec/libx264.c:604: undefined reference tox264_param_apply_profile'
/home/pi/src/ffmpeg/libavcodec/libx264.c:656: undefined reference to x264_param_parse' /home/pi/src/ffmpeg/libavcodec/libx264.c:658: undefined reference tox264_param_parse'
/home/pi/src/ffmpeg/libavcodec/libx264.c:670: undefined reference to x264_param_parse' /home/pi/src/ffmpeg/libavcodec/libx264.c:688: undefined reference tox264_encoder_open_142'
/home/pi/src/ffmpeg/libavcodec/libx264.c:701: undefined reference to x264_encoder_headers' /home/pi/src/ffmpeg/libavformat/librtmp.c:109: undefined reference toRTMP_LogS
etCallback'
/home/pi/src/ffmpeg/libavformat/librtmp.c:219: undefined reference to RTMP_Init ' /home/pi/src/ffmpeg/libavformat/librtmp.c:220: undefined reference toRTMP_Setu
pURL'
/home/pi/src/ffmpeg/libavformat/librtmp.c:228: undefined reference to RTMP_Conn ect' /home/pi/src/ffmpeg/libavformat/librtmp.c:228: undefined reference toRTMP_Conn
ectStream'
/home/pi/src/ffmpeg/libavformat/librtmp.c:238: undefined reference to RTMP_Clos e' /home/pi/src/ffmpeg/libavformat/librtmp.c:226: undefined reference toRTMP_Enab
leWrite'
/usr/local/lib/libavcodec.a(libvorbisdec.o): In function oggvorbis_decode_close ': /home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:190: undefined reference tovorbi
s_info_clear'
/home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:191: undefined reference to vorbi s_comment_clear' /usr/local/lib/libavcodec.a(libvorbisdec.o): In functionoggvorbis_decode_frame
':
/home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:168: undefined reference to vorbi s_synthesis' /home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:174: undefined reference tovorbi
s_synthesis_pcmout'
/home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:178: undefined reference to vorbi s_synthesis_read' /home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:174: undefined reference tovorbi
s_synthesis_pcmout'
/home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:169: undefined reference to vorbi s_synthesis_blockin' /usr/local/lib/libavcodec.a(libvorbisdec.o): In functionoggvorbis_decode_init'
:
/home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:46: undefined reference to vorbis _info_init' /home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:47: undefined reference tovorbis
_comment_init'
/home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:95: undefined reference to vorbis _synthesis_headerin' /home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:95: undefined reference tovorbis
_synthesis_headerin'
/home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:95: undefined reference to vorbis _synthesis_headerin' /home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:107: undefined reference tovorbi
s_synthesis_init'
/home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:108: undefined reference to vorbi s_block_init' /home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:113: undefined reference tovorbi
s_info_clear'
/home/pi/src/ffmpeg/libavcodec/libvorbisdec.c:114: undefined reference to `vorbi
s_comment_clear'
collect2: ld returned 1 exit status
Makefile:13: recipe for target 'picam' failed

Arch Linux "Sample format" errors

I'm trying to get picam to work on a raspberry pi running Arch Linux Arm.

The precompiled version doesn't work since the binary is linked against an older version of libpng:

$ picam-1.4.1-binary/picam --help
picam-1.4.1-binary/picam: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
$ ls -l /usr/lib/libpng*
lrwxrwxrwx 1 root root     11 Jan 24 17:34 /usr/lib/libpng.so -> libpng16.so
lrwxrwxrwx 1 root root     19 Jan 24 17:34 /usr/lib/libpng16.so -> libpng16.so.16.21.0
lrwxrwxrwx 1 root root     19 Jan 24 17:34 /usr/lib/libpng16.so.16 -> libpng16.so.16.21.0
-rwxr-xr-x 1 root root 174108 Jan 24 17:34 /usr/lib/libpng16.so.16.21.0

So I built it from source. Unfortunately, there are still issues when trying to capture video:

$ ./picam --noaudio
configuring devices
Sample format s16 is not supported

(I don't have an audio device.) So I'm not really sure where the issue may lie - I can provide additional information if needed.

Thanks for the help!

Memory leak with --time

When recording on a Raspberry Pi 2 (Raspbian with 4.4.16-v7+) with the v2 camera using the binary 1.4.2 release, I noticed that picam starts using more and more memory over time up to the point that there is no memory left and it is killed. The size of that recorded video is 3.0G and 2h58m long.

To reproduce:
./picam-alsadev hw:1,0 --samplerate 32000 --channels 2 --audiobitrate 96000 --width 1920 --height 1080 --videobitrate 4000000 --fps 30 --minfps 30 --avcprofile high --avclevel 4.1 --iso 400 --time
touch hooks/start_record

Omitting the --time flag here solves the issue.

edit: the memory leak also occurs when running just ./picam --time without even starting to record.

Arch Linux support

Hi,

Project looks promising. I'm trying it out on Arch Linux on a Pi. Seems to compile fine, but when running I get the error

failed to set camera to idle state (perhaps you need to reboot the machine)

Could this be a problem with libilclient that I compiled. Anything that would generally stopping this from working on Arch Linux?

Thanks,
G

Force set exposure mode to night?

hi,
can i set exposure mode force to "night"? Like a raspivid -ex night
If i using -autoex, fps is very low.. I want to use night mode with --minfps 25, 720p, but night mode can be activated only with --autoex?

// added previews - difference betweeen day and night modes.

autoex
default

help with picam, node-rtsp-rtmp-server

First. Thank you for your contributions.

Hello - i am having a little trouble understanding how to view the picam. I installed it successfully and have used "picam --tcpout URL" with "ffplay -i tcp://192.168.1.117:8181?listen" and could view the stream. Now I am attempting to serve the sstream via node-rtsp-rtmp-server.

This is on an RPi B.

I ran server like this, using the default settings.
% sudo coffee server.coffee

I verify that the server is running by visiting http://192.168.1.81 and I see the "Hello World"

Now, I start Picam like this:
% picam --rtspout

But I am unable to figure out how to view the stream. I want to try something like
% ffplay -i rtsp://192.168.1.81/live

where that URL is my RPi. Do you have any suggestion? How should I be able to view the stream?

Best regards.
Tom

Timestamps in video and sometimes video repeats itself

Hi Nao!
I've been using picam for a while and I've always appreciated the ease of use. There is only one thing that would make picam for me so much better, timestamps. Yes, I'd love it if one could choose to put a timestamp in the corner of the video because that would be really useful for me (and probably many others) considering I'm using a PIR sensor to trigger the camera, and I could perhaps use ffmpeg to add the filename in post-processing, but it would be ideal if you could add timestamps to picam natively! Speaking of PIR sensors, I've noticed that sometimes when stopping and starting to record, picam will sort of overflow the last segment into the next video, it seems as it writes a buffered segment into the next video making the effect when I merge together all videos that the video repeats itself. I don't know if this is because picam doesn't register the stop_record file or maybe it is beacuse I'm using an old version of picam. Anyhow I'd like to thank you for putting all the astonishing amount of effort into picam.

/Sincerely Linus

"Time base not set"

When I try to record under Arch Linux I get:

[jakob@raspi recordings]$ picam --alsadev hw:1,0 &
[1] 496
[jakob@raspi recordings]$ configuring devices
capturing started

[jakob@raspi recordings]$ touch hooks/start_record
disk_usage=6% [jakob@raspi recordings]$ [mpegts @ 0xb1e940f0] time base not set
avformat_write_header failed

[1]+ Exit 1 picam --alsadev hw:1,0
[jakob@raspi recordings]$

I have used the packages from here: http://ftp.tuebingen.mpg.de/pub/kyb/towolf/raspberry-camera-streaming/resources/

Subtitle not showing in preview on touchscreen

Hi,

thank you for this great project!

I'm using a Raspberry Pi 3 with the official 7" touchscreen.
When i'm trying to insert a subtitle like this

text=this is a test
in_video=1
in_preview=1

then i can see the text in the output file, but it does not appear in the preview on the touchscreen.

What am i doing wrong?

Sample rate problem

I have followed the instructions in the install and readme files to get picam built and working with nginx-rtmp, but when I run picam --tcpout 127.0.0.1:8181 I get:

[libfdk_aac @ 0x1cd51c0] Specified sample rate 0 is not supported
avcodec_open failed

This problem exists both when picam is install manually on Arch Linux and on the provided Raspbian image (which is much appreciated).

Also, I would be very interested in support for 1920x1080. Currently the program fails when you start recording with that resolution.

MPEG-DASH Support

I have troubles to get HLS running on Android/Chrome (I get it to work in Windows|Ubuuntu/Chrome using hls.js).

It seems that the upcoming standard wil be MPEG-DASH. Do you see a way to support MPEG-DASH by picam?

newbie question

trying to get this to work with my limited programming skills. i get stuck at the "To start recording, create a file named hooks/start_record while picam command is running." ive created the symlinks however, when i start ./picam i dont get a prompt it just says capturing started and i can only exit it with ctrl c. please help.

o-o-o-o.... output on raspbian jessie lite

I was running the binary 1.4.1 version on raspbian whezzy and then I started a new installation based on jessie lite, after adding a couple of libraries I was able to start picam, but in the output I get o-o-o-o-o-o-o- all the time, why is that?

this is the command I'm running:
./picam --rtspout --alsadev hw:1,0 --volume 2

and the output:

configuring devices
o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-capturing started
o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-

alsa is not in indevs

Hi,

I followed you installation script, which is very detailed. But I stuck on the step with the alsa headerfiles.

My raspberry pi has arch linux installed. So I installed the alsa-lib package and copied the files from /usr/include/alsa/ and /usr/lib/libasound.so* (see ls commands bellow). Now I run the configure command, but alsa is not in the indevs. Also I get a warning:
WARNING: /opt/cross/x-tools/arm-rpi-linux-gnueabi/bin/arm-rpi-linux-gnueabi-pkg-config not found, library detection may fail.

Can you help me out, so I can try your awesome project ;-)

~/pi/usr/lib$ ls -la
insgesamt 2396
drwxrwxr-x 2 ibauer ibauer 4096 Sep 23 19:43 .
drwxrwxr-x 4 ibauer ibauer 4096 Sep 23 19:43 ..
-rwxr-xr-x 1 ibauer ibauer 811688 Sep 23 19:43 libasound.so
-rwxr-xr-x 1 ibauer ibauer 811688 Sep 23 19:43 libasound.so.2
-rwxr-xr-x 1 ibauer ibauer 811688 Sep 23 19:43 libasound.so.2.0.0

~/pi/usr/include/alsa$ ls -la
insgesamt 364
drwxr-xr-x 3 ibauer ibauer 4096 Sep 23 19:37 .
drwxrwxr-x 3 ibauer ibauer 4096 Sep 23 19:37 ..
-rw-r--r-- 1 ibauer ibauer 2204 Sep 23 19:37 alisp.h
-rw-r--r-- 1 ibauer ibauer 18185 Sep 23 19:37 asoundef.h
-rw-r--r-- 1 ibauer ibauer 1851 Sep 23 19:37 asoundlib.h
-rw-r--r-- 1 ibauer ibauer 8107 Sep 23 19:37 conf.h
-rw-r--r-- 1 ibauer ibauer 8787 Sep 23 19:37 control_external.h
-rw-r--r-- 1 ibauer ibauer 27768 Sep 23 19:37 control.h
-rw-r--r-- 1 ibauer ibauer 3236 Sep 23 19:37 error.h
-rw-r--r-- 1 ibauer ibauer 5148 Sep 23 19:37 global.h
-rw-r--r-- 1 ibauer ibauer 6801 Sep 23 19:37 hwdep.h
-rw-r--r-- 1 ibauer ibauer 4575 Sep 23 19:37 iatomic.h
-rw-r--r-- 1 ibauer ibauer 2586 Sep 23 19:37 input.h
-rw-r--r-- 1 ibauer ibauer 4214 Sep 23 19:37 mixer_abst.h
-rw-r--r-- 1 ibauer ibauer 14396 Sep 23 19:37 mixer.h
-rw-r--r-- 1 ibauer ibauer 2754 Sep 23 19:37 output.h
-rw-r--r-- 1 ibauer ibauer 1893 Sep 23 19:37 pcm_external.h
-rw-r--r-- 1 ibauer ibauer 6232 Sep 23 19:37 pcm_extplug.h
-rw-r--r-- 1 ibauer ibauer 56942 Sep 23 19:37 pcm.h
-rw-r--r-- 1 ibauer ibauer 7233 Sep 23 19:37 pcm_ioplug.h
-rw-r--r-- 1 ibauer ibauer 20071 Sep 23 19:37 pcm_old.h
-rw-r--r-- 1 ibauer ibauer 7028 Sep 23 19:37 pcm_plugin.h
-rw-r--r-- 1 ibauer ibauer 4526 Sep 23 19:37 pcm_rate.h
-rw-r--r-- 1 ibauer ibauer 7148 Sep 23 19:37 rawmidi.h
-rw-r--r-- 1 ibauer ibauer 11789 Sep 23 19:37 seq_event.h
-rw-r--r-- 1 ibauer ibauer 32334 Sep 23 19:37 seq.h
-rw-r--r-- 1 ibauer ibauer 14429 Sep 23 19:37 seqmid.h
-rw-r--r-- 1 ibauer ibauer 2384 Sep 23 19:37 seq_midi_event.h
drwxr-xr-x 2 ibauer ibauer 4096 Sep 23 19:37 sound
-rw-r--r-- 1 ibauer ibauer 11338 Sep 23 19:37 timer.h
-rw-r--r-- 1 ibauer ibauer 14373 Sep 23 19:37 use-case.h
-rw-r--r-- 1 ibauer ibauer 499 Sep 23 19:37 version.h

Record Maximum File Size

Hi,

Would it be possible to have a maximum file size for the recorded content (archive), so that when the size is reached a new file (with new timestamp filename) is created?

Oh and thanks for picam, excellent work.

Regards

Daniel

Issue with Microphone after 15-30 mins of use

Ever since I have installed the picam, I am getting about 15 minutes of good audio and visual stream. The system then goes into a mass write over and over suddenly out of the blue, writing to system-journal this, 40 times a second:

Jan 17 05:57:05 raspberrypi picam[595]: microphone error: wait for poll failed
Jan 17 05:57:05 raspberrypi picam[595]: trying to recover from error

SDometimes it continues on like this forawhile and then suddenly starts again. Sometimes it never stops and I have to reboot. Usually it is writing this so much, it throws the load avg to 2 almost, locking up the machine.

Segmentation fault when starting to record

Hi, I have successfully run picam many times before without any errors, but this time when I tried to record from my raspberry pi camera, picam crashed. Maybe it is hardware related? Anyhow here is some debug info retrieved using gdb:

Linux raspberrypi 3.18.6+ #753 PREEMPT Sun Feb 8 14:47:22 GMT 2015 armv6l
(gdb) handle SIGILL nostop
Signal Stop Print Pass to program Description
SIGILL No Yes Yes Illegal instruction
(gdb) r
Starting program: /home/pi/Fagelmatare-SW/PIRDetect/bin/picam
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.

Program received signal SIGILL, Illegal instruction.
[New Thread 0xb6a33470 (LWP 2921)]
configuring devices
[New Thread 0xb6233470 (LWP 2922)]
[New Thread 0xb5a33470 (LWP 2923)]
[New Thread 0xb5233470 (LWP 2924)]
[New Thread 0xb4a33470 (LWP 2925)]
[New Thread 0xb4233470 (LWP 2926)]
[New Thread 0xb3a33470 (LWP 2927)]
disk_usage=76% [New Thread 0xb2f2b470 (LWP 2929)]
start rec to rec/tmp/2015-06-15_22-24-48.ts

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb2f2b470 (LWP 2929)]
0x000a5aa0 in rec_thread_start () at stream.c:754
754 stream.c: No such file or directory.
(gdb) backtrace
#0 0x000a5aa0 in rec_thread_start () at stream.c:754
#1 0xb6f0fc00 in start_thread () from /lib/arm-linux-gnueabihf/libpthread.so.0
#2 0xb6b00348 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
#3 0xb6b00348 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6

Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

NOTE: I cross compiled picam from the github repository 2015-03-05

Picam + FFMpeg + tcpout + --vfr = stalling

I know this could possible be a bit vague and might not even be a picam issue but an issue with ffmpeg, but please bare with me =)

Goal: really, really low-latency streaming from PI to Wowza

Solution: ffmpeg in listening mode + picam. Works like a charm!

Issues: can't go below 1024x768 resolution because ffmpeg stalls and picam throws errors, but only when using variable framerate. 1024x768 does give is quite good results however, even with audio.

Whenever it fails picam spits out "warning: Record buffer is starving. Recorded file may not start from keyframe. Try reducing the value of --gopsize."
More often than not it will not terminate with ctrl-c but needs to be killed.
We're not recording anything, simply sending it to ffmpeg.

Ffmpeg sometimes reports issues reading the video data but correctly reports the metadata. It shows the framerate being extremely low when failing. Sound seems to always go through!

ffmpeg commandline:
ffmpeg -i tcp://127.0.0.1:8181?listen -c:v copy -c:a aac -strict -2 -ar 44100 -ab 64000 -f flv rtmp://ourwowzaserver

picam commandlines:
works:
./picam --alsadev hw:1,0 -c 1 --volume 0.1 -r 44100 -a 64000 --fps 20 -v 1000000 -w 640 -h 480 --hflip --vflip --tcpout tcp://127.0.0.1:8181

won't work:
./picam --alsadev hw:1,0 -c 1 --volume 0.1 -r 44100 -a 64000 --vfr -v 1000000 -w 640 -h 480 --hflip --vflip --tcpout tcp://127.0.0.1:8181

works:
./picam --alsadev hw:1,0 -c 1 --volume 0.1 -r 44100 -a 64000 --vfr --maxfps 30 --minfps 10 --shutter 20000 -v 1000000 -w 1024 -h 768 --hflip --vflip --tcpout tcp://127.0.0.1:8181

won't work:
./picam --alsadev hw:1,0 -c 1 --volume 0.1 -r 44100 -a 64000 --vfr --maxfps 30 --minfps 10 --shutter 20000 -v 1000000 -w 800 -h 600 --hflip --vflip --tcpout tcp://127.0.0.1:8181

The --vfr and --shutter settings seems to be crucial for me to achieve really low latency (mostly from trial 'n' error).

FFMpeg is freshly compiled on the RPI itself:
ffmpeg version N-80344-g6fd4145 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
libavutil 55. 24.100 / 55. 24.100
libavcodec 57. 46.100 / 57. 46.100
libavformat 57. 38.100 / 57. 38.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 46.101 / 6. 46.101
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100

Picam is the 1.4.1 binary, but I think I've had the same issue with 1.3.0

If you have any insights or ideas they would be greatly appreciated! =)

high lag and blocky video

Hi there,

thanks for all the great work you put into picam and for making it avaliable, it's an incredible headstart for a project I'm working on.

I'm using a p2 (not overclocked) and a linux desktop running ubuntu 14.04 with 8GB ram/3GHz CPU. I'm using the latest binary as per you setup guidelines and starting picam like this:

./picam --noaudio --vflip -o /run/shm/hls/

for a quick test I then got apache2 going and put a symlink in /var/www pointing to the hls directory. I opened vlc and played a network stream http://IP_ADDR_PI2/hls/index.m3u8

Playback started immediately but there was a visible gap of several seconds. I put a phone with a timer in front of the camera and observed ~4s delay, which is much higher than your results. On top of that image was really blocky and at the beginning of the playback the first 3/4 rows of the video were garbled.

Just to make sure it's not something odd with my network or camera (it shouldn't, all ethernet going to the same switch) I ran the classic netcat + mplayer test and results were much better: no observable delay and image wasn't blocky.

The blocky/bad video quality is also observable in recorded videos (triggered via the hook stuff as per guidelines).

Am I doing something wrong? with vlc I guess I might be hitting some buffering issues, but I've not had those issues playing other streams. As a side note, I tried to play the stream with my iphone and while it starts fine it stops very quickly as if it wasn't refreshing the playlist but just playing what it originally downloaded.

I will try to go through the manual install to get ffmpeg going so that I can try the rtmp stuff hopefully tomorrow and once I figured out what's wrong and videoplayback is smooth I'll jump back on the motion vector stuff.

thanks again,

Spike

How to get this to start when Raspberry Pi starts

I want the camera to start streaming as soon as its plugged in, so I have tried to add a init script to run at startup. For some reason, I can not get picam to run at startup. The nginx server starts up, and for some reason my picam script will not.

Is there any reason Picam can't start from init.d?

#! /bin/sh
# /etc/init.d/picam

### BEGIN INIT INFO
# Provides: picam
# Required-Start: $remote_fs $syslog $all
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: picam
# Description: picam
### END INIT INFO

case "$1" in
    start)
        echo "Starting picam"
        sudo mkdir /run/shm/hooks
        sudo mkdir /run/shm/state
        sudo mkdir /run/shm/rec
        sudo /usr/src/picam/picam --tcpout tcp://127.0.0.1:8181
    ;;
    stop)
        echo "Stopping picam"
        kill picam
    ;;
    *)
        echo "Usage: /etc/init.d/picam {start|stop}"
        exit 1
    ;;
esac
exit 0

Connection to tcp://127.0.0.01:8181 failed: Connection refused

Hi !

First thank you for picam, it is really good and simple, but, but, but I've an issue when I execute this command : ./picam --tcpout tcp://127.0.0.01:8181 an error occurred :
[tcp @ 0x277f270] Connection to tcp://127.0.0.01:8181 failed: Connection refused
avio_open for tcp://127.0.0.01:8181 failed: Connection refused

Did I miss something ?

(PS : I try the same command with "sudo" but still have the same error).

Embed via JW Player

Hi,

First of all: great application (both picam and node-server). I have a problem viewing the livestream. I am using the JW Player and viewing files from the file directory works great.

the URL I use is: rtmp://192.168.0.21/file/someFile.mp4

But when I try using picam starting the application with:

./picam --alsadev hw:1,0 --rtspout

and using the following URL:

rtmp://192.168.0.21/live/picam

it errors with:

[rtmp:client=9atPYDEo] error: stream not found: live/picam

Subtitle - Not Transparent

Have you ever thought about adding a background color parameter to the text overlay? I use the overlays to display the score of a game. It would be nice to just overlay white text over a black background.

Failed to create camera component: 0xFFFFFFFF

Everything compiled and installed properly. However when I start to run "./picam --alsadev hw:1,0" I get the error message "error: failed to create camera component: 0xffffffff"

Any suggestions?

Hardware issue

Hi,

This is not an issue with your tools (which work very well), but I thought given your advanced use of raspberry pis you would be well placed to comment. Like many, I'm experiencing significant noise on the microphone input which is effectively making my application unusable. Posting over on raspberry pi forum, someone suggested it was ground loop noise but I'm all out of ideas how to resolve (I've read many posts!)

Let me know if you have any good ideas from your experiences and thanks for your awesome work.

Greg

select profile

Hi

I've noticed you are using baseline 3.1 profile for h264 only (I think the comments in the code mentioned that main/high profiles are not working on android)

Would it be possible to add an option to select profile when you need something else than baseline?

Question : Change Input Source

Hi,
your picam looks very nice.

Do you think it would be possible to change easly the input?
Idea is not to use the Camera, using tvheadend would be nice (you can get mpegts direct from tvheadend)

Recode with Rpi hardware and stream via HLS like you do.

Thanks

Latency In receiving video with VLC

HI,
I successfully install Picam and nginx-rtmp-module. I started streaming video as you said:
./picam --tcpout tcp://127.0.0.1:8181
but when I get the video with VLC It has 3 sec latency. How can I remove the latency?

Add option to send to STDOUT

Hi,

Would be really useful if this utility allowed the output to be sent to stdout so that it can be consumed directly by another tool such as ffmpeg in the event that people want to use something other than your node server for streaming. Would this be easy to add?

G

error creating state dir (./state): File exists

I get this error when attempting to start picam for the second time.

I installed picam exactly according to the readme, by creating the make_dirs.sh script, which sets up all the directories and the links. But when running picam subsequent times, it fails to start because state already exists.

So I delete state. Then I try to start picam and get an error that hooks already exists.

So basically, every time I want to start up picam again, I have to delete all the directory links and re-run make_dirs.sh. After that it starts up fine.

Is anyone else having this problem? Is there something I'm missing in the way I have this set up? Love this program btw, it's the only program I've found that will do audio/video together with the camera module.

Running Raspian Jessie (lite) on a Raspberry Pi 3.

Start and stop tcpout via hooks

Hello,

Thanks for the picam project! I have been using some custom scripts calling ffmpeg to stream to ustream for a couple years now and I have never been able to get the audio to sync up with the video. In picam, this just works! Amazing.

Now for my request. Would it be possible to add hooks to start_tcpout and stop_tcpout? These would work similar to start_record and stop_record, except instead of controlling the recording to disk, they would control sending (or stopping) the stream to nginx.

opacity preview?

Hi,

I really like your picam package, as far as I know it works flawless!

I am controlling it with python, and i'm trying to combine it with pygame. So i want to show the screen and also have the preview shown on top.

with the default "raspivid" command you can set the opacity so you could see the pygamescreen at the same time.

I was wondering if you could also add it in your package?

Many thanks in advance!

Yves

secondary low resolution stream?

First of all, thanks for creating and sharing picam, it works really well.

I have used your picam-streamer pre-built image (https://github.com/iizukanao/picam-streamer) to implement a motion detecting stecurity camera, using a PIR sensor connected to a GPIO port and a small Python script that will use the hooks file API to start recording whenever motion is detected by the sensor. It only took me minutes to get this to work the way I wanted, and I'm no real programmer, only a hobbyist.
I use the rtsp live stream to access the camera from my Android units. This works fine while connected via WiFi to the same network as the camera, but I would like to be able to view the live stream remotely from my Andriod phone as well. The default video settings of 1280x720@30fps are a bit high for this to work smoothly. I am aware that I can lower the resolution and frame rate, but that will also impact the recordings.....
I have dabbled a bit with transcoding and re-streaming the rstp stream on another Linux machine using VLC, ffmpeg, gstreamer etc., but I have a hard time finding a reliable solution.

I noticed that the "picamera" Python module is able to provide two simultaneous x264 streams at different resolutions (see. https://picamera.readthedocs.org/en/release-1.10/recipes2.html#recording-at-multiple-resolutions), and my question is if this is something you would like to consider as well? I.e. make picam capable of outputting an optional secondary low resolution stream, suitable for viewing over lower bandwidth connections.

Notify in case of invalid hooks

Hi,

Nice software, thank you!
One small request for the sleepy users:
please notify in the picam output when an invalid filename has been placed in the hooks directory.

I admit, it is quite stupid, but I spent a small hour trying to figuring out why picam didn't work on hooks/record_start while it was working fine yesterday. (it should have been start_record)

Thanks!
Thanks!

Recording is sometimes not started

Hi Nao,

Great to see this project is still under active development. I am still working on my bird feeder and if it wasn't for picam I wouldn't be where I am with the project today. I use a timerfd on my application and if the timer of five seconds runs out and the recording will be stopped. This works great for the most part however on some occasions the timer runs out and the recording is stopped and in a blink of an eye later there is motion pursuant to my pir sensor which will try to start the recording but fails because picam didn't have time to cleanup after the last recording.

stop rec
disk_usage=41% start rec to rec/tmp/2015-11-05_22-04-03.ts
stop rec
recording is already started
disk_usage=41% start rec to rec/tmp/2015-11-05_22-04-33.ts
stop rec
disk_usage=41% start rec to rec/tmp/2015-11-05_22-04-57.ts
stop rec
recording is already started

I looked at the source code and I saw you print out stop rec and then write some buffer to recording_archive_filepath and this doesn't happen in an instant so during that time my program tries to be a hassle and throw a new request to start a recording but because the is_recording flag is still not false picam will exit out early and the recording is never started.

An easy solution on my end would be to have a "cooldown" value whcih will essentialy wait a few seconds after the recording has stopped and only then send a request to picam. Another solution would be for picam to use a timed lock on a common mutex which will block until the recording has stopped or a timeout has passed and only then try to record, but I can see this can be problematic since if somebody blindly tries to start a recording without keeping a local flag and picam is recording already, picam may wait unnecessarily for the recording to "stop".

A more complex approach would be to somehow after the recording has been stopped and a new request to start a recording has been made within x seconds after the recording was stopped, resume recording in the same file and write the buffered data into the file. Does that make sense?

Anyway that's just my frame of mind, please let me know if you have got any ideas!

Picam and Cirrus Logic Raspberry Pi Audio Card

Hi,

Thank you for this project. I am new to Raspberry Pi currently looking to solve the audio and video out of sync with the capture. I hope your project would be really helpful. I am planning to capture the audio using cirrus-logic-audio-card as audio quality of from USB microphone capture is lot desired.

The cirrus-logic-audio-card is at http://in.element14.com/wolfson-microelectronics/cirrus-logic-audio-card/cirrus-logic-audio-card-for-raspberry/dp/2448312 and the raspberry pi B version of the card is at http://www.adafruit.com/product/1761

Is it possible to capture audio from this device with current version of picam without any modifications?

Sorry for using the issue to ask you this question as it is the only way to send message to you.

Other Cameras

Hello,

first of all I want to thanks iizukanao for this nice program!
My only question is:
Can we use picam with other webcams (logitech c270 for example)?
Thanks

Displaying frame number

Hi Nao,

Is it possible to display frame number in the timestamp ? It seems there is no flag for frame in strftime format specification. Do you know a way to do that ?

thank you very much !

(The main goal behind this is to find a way to synchronise pi video with an external SMPTE signal)

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.