Commit Graph

368 Commits

Author SHA1 Message Date
Saxon 1df0d214c9 revid/revid.go: fixed merge conflicts 2019-05-27 15:00:41 +09:30
Saxon 809d904878 revid/revid.go: commented startRTSPCamera 2019-05-23 14:10:09 +09:30
Trek H dd66c58f40 revid: concurrency and testing
fixed a situation where a deadlock can occur and also found and fixed some issues while testing different initialisations on AudioDevice.
2019-05-23 00:19:44 +09:30
Saxon 722ddc6ccb codec/h264/lex_test.go: added test for RTPLexer.Lex(...) and also fixed some build errors 2019-05-22 14:49:25 +09:30
Saxon d29141cf05 container/mts: changed consts H264, H265 and Audio to EncodeH264, EncodeH265 and EncodeAudio 2019-05-21 16:57:17 +09:30
Saxon eeaf806c6e protocol/rtcp/client.go & revid/revid.go: removed rtcp.Client.Done() and now blocking on rtcp.Client.Err() in revid.
It seems unnecessary to have the rtcp.Client.Done() func, considering that we could use
the rtcp.Client.err channel itself to determine if the RTCP client has been stopped.
We simple wait on a chan receive in revid in the error handling routine, and we check the
'ok' return - if it is false, then the err chan has been closed and we can get out of the
error handling loop. This should also reduce CPU usage significantly.
2019-05-21 13:23:04 +09:30
Trek H c58c573cd7 revid: changed writeRates and recPeriods to floats 2019-05-21 12:39:10 +09:30
Saxon 88ffdf08b5 revid: changed the input enum for RTSP input from RTSPCamera to RTSP 2019-05-21 12:18:52 +09:30
Saxon 91d2697a55 revid: general clean up 2019-05-21 01:48:29 +09:30
Trek H 7ba9d023a3 revid: made start and stop change audio device state 2019-05-21 00:45:54 +09:30
Saxon 3ff726e439 revid & cmd/revid-cli: removed need for command line flags to specify addresses for RTP and RTCP.
Removed the command line flags that were used to specifiy local and remote addresses for RTP and RTCP. These are now
derived from the initial RTSP connection and also from the RTSP SETUP method reply.
2019-05-20 19:45:59 +09:30
Saxon bc6a0ae55e revid: using RTCP client to maintain RTP stream from RTSP server
Now adopting an RTCP client so that the RTP stream from the RTSP server can be maintained past 1 minute.
This change involved some refactor.
The rtcp.NewClient signature has been simplified. There is now a default send interval and name for use
in the source description in the receiver reports. These can be customised if required with the new
SetSendInterval and SetName funcs. The rtcp.NewClient signature now takes an rtp.Client, so that it
can get information from the RTP stream, like most recent sequence number. As a result of this requirement
the rtp package parse file has been extended with some functions for parsing out the sequence number and
ssrc from RTP packets and the RTP client provides getters for these things.
2019-05-20 18:14:27 +09:30
Saxon Milton eaba622909 Merged in separate-codecs (pull request #188)
codec: created h264 and mjpeg packages to house lexers

Approved-by: Alan Noble <anoble@gmail.com>
2019-05-19 11:46:33 +00:00
Saxon 548b7caa81 revid: fixed rtpPort and rtcpPort parsing and added H264 and H265 IDs
Added H264ID and H265ID consts and added logic to select this const for use in encoder based on mediaType param in NewEncoder. Also now
declaring PMT in NewEncoder so that we can set streamID correctly based on mediaType.
2019-05-16 13:57:10 +09:30
Trek H 76edcfe8ed revid: added start and stop functions to AudioInput for proper closing 2019-05-15 15:57:49 +09:30
Saxon 25bb49bce7 revid: using h265 lexer now in the case of RTSPCamera input 2019-05-14 11:56:04 +09:30
Saxon 1059b5e738 revid: wrote basics of a startRTSPCamera func
Currently just connecting to RTSP server, requesting OPTIONS, DESCRIBE, SETUP and PLAY. Also creating RTP client and giving
this to process from for the lexer.
2019-05-14 11:47:18 +09:30
Saxon 835f97203a revid: config fields that are exported and acronyms now capitalized. 2019-05-13 16:23:38 +09:30
Saxon 51fcb18505 revid: capitalize exported enums that are acronyms like Rtmp->RTMP, Mpegts->MPEGTS etc. 2019-05-13 16:18:41 +09:30
Trek H e699c30a85 revid: updated documentation and licenses 2019-05-08 19:31:25 +09:30
Trek H 9099082609 revid: setting up mts encoder with pid based on media type 2019-05-08 19:05:00 +09:30
Trek H faa6246a51 Merge branch 'master' into revid-audio 2019-05-08 16:23:56 +09:30
Trek H 7d4da08cf0 revid: audio lexer reading and writing correct bytes 2019-05-07 16:52:58 +09:30
Saxon 5e568f277b revid/revid.go: fixed comment for Revid.setupInput field 2019-05-06 16:04:56 +09:30
Saxon 5c40c48e97 revid/revid.go: in Revid.Start() if errors occurs on call to Revid.setupInput() fall through error check and return err 2019-05-06 15:54:33 +09:30
Saxon 77ff88392f revid: setupInput function for revid now returns closure that is used to do any clean up 2019-05-06 15:12:05 +09:30
Saxon ec290f1058 revid: logging is now checked as a valid device so that logging level may be changed remotely 2019-05-05 19:39:56 +09:30
Trek H a3c7cb5616 revid: added chunkSize to audioInput and bufferSize to lex functions
The audio lexers need to know how much data they will be receiving unlike video which has a fixed buffer size.
This means that all the lex function will need to be given a buffer size since they are used as a function pointer with the same signature.
2019-05-05 17:56:14 +09:30
Saxon 32621f0cfe av: fixed build errors 2019-04-26 20:46:43 +09:30
Saxon b42278cfde revid: improved comment for Config() 2019-04-25 15:44:34 +09:30
Trek H b1e5b4341f revid: pid for audio being written to mts packets 2019-04-24 16:39:18 +09:30
Trek H 3484e35692 revid: revid building and running with audio additions 2019-04-24 13:58:56 +09:30
Saxon 74379ea047 revid: simplified comments for Start, Stop and Update. 2019-04-24 13:00:20 +09:30
Trek H 889d440259 revid: updated audio config parameters throughout audio-input.go to use revid.Config 2019-04-24 11:46:00 +09:30
Trek H c51e0ec168 revid: adding audio config parameters 2019-04-23 19:05:47 +09:30
Trek H 20c9e6c409 revid: added PCM and ADPCM codecs 2019-04-23 16:20:47 +09:30
Saxon 9ba72fac62 av: addressing PR feedback 2019-04-22 15:14:08 +09:30
Trek H 46ca3e2611 revid: created an audioInput struct to record audio that acts as a reader for revid 2019-04-19 01:20:48 +09:30
Saxon d76b60a515 revid: addressing PR feedback 2019-04-18 18:31:49 +09:30
Saxon 74c995d452 revid: addressing PR feedback 2019-04-18 16:55:48 +09:30
Saxon 1c5d3997bb revid: fixed indentation on Dan's name under authors 2019-04-18 16:21:18 +09:30
Trek H e0ec6a8dc9 revid: added basic PCM lexer and started adding startMic() func to revid setup. 2019-04-17 23:11:23 +09:30
Saxon d18373908b revid: added ringBuffer to rtmpSender 2019-04-15 10:48:12 +09:30
Saxon d75ea20137 revid: applying some feedback from last PR 2019-04-15 10:25:35 +09:30
Saxon f59879b51d revid: removed ringBuffer after lexer
Now that we want buffered senders (as required), the ringBuffer that was after the
lexer has been removed. Instead, we now have an ioext.multiWriterCloser to which the
lexer writes to. This then writes to the encoders, and then encoders write to each of
their own multiWriteClosers, which write to the appropriate senders. We now call
close on the first multiWriteCloser to close down the entired pipeline, as this close
call propogates through each level.

We have removed the outputClips routine as it's not required anymore to get data
from the revid ringBuffer, and have removed other things that were used by this, like
the IsRunning function.

We have also updated tests to work with these changes - they are passing.
2019-04-15 08:42:56 +09:30
Saxon b347f2e9d1 revid: set revid.isRunning to false before waiting, because this is what triggers output routine to be killed. 2019-04-14 11:13:17 +09:30
Saxon 9b48d22392 av: fixed conflicts with master 2019-04-13 20:15:08 +09:30
Saxon 02287bfd80 revid: added more to setupPipeline comment regarding parameters: 2019-04-10 14:05:53 +09:30
Saxon bab1e62798 revid: don't return from revid.Stop() if a close of one of the senders fails 2019-04-10 12:57:28 +09:30
Saxon 850b45d791 revid: temp writeCloser wc in setupPipeline renamed to w 2019-04-10 12:22:41 +09:30
Saxon dd833afe2e revid: updated comment for setupPipeline 2019-04-10 12:13:08 +09:30
Saxon d3e3904e75 revid: commented Revid.writeClosers 2019-04-10 12:11:45 +09:30
Saxon 66622920d5 revid: Buffered MtsSender
The mtsSender now has a ringBuffer and tests have been updated accordingly. The mtsSender now uses an output routine to get data from it's ringBuffer to send.
 Revid now uses ioext.multiWriteClosers for encoders to write to so that senders can be closed and therefore any output routines.
2019-04-09 15:58:34 +09:30
Trek H 9fe3de5d65 mts: Changed uses of NewEncoder in revid and senders_test to use extra argument. 2019-04-09 14:00:56 +09:30
Saxon a061a79805 revid: don't need to make new r.encoder each time just do r.encoder = r.encoder[:0] 2019-04-03 11:36:49 +10:30
Saxon 9bd41b7c3b revid: simplified signature for setupPipeline and fixed commenting 2019-04-03 11:29:54 +10:30
Saxon dbcac80d1f revid: fixed some general commenting 2019-04-02 13:45:36 +10:30
Saxon 6b91746cf6 revid: removed multiSender and started using std io.multiWriter
We are now using an io.multiWriter rather than the multiSender. Code has been updated inside revid.go to account for this change, and tests have also been updated accordingly. Tests for
the multiSender have been removed. A dummyMultiWriter has been written to inject our own multiWriter during testing.
2019-04-02 13:21:46 +10:30
Saxon f17d2ffb8c revid: got rid of minimalHttpSender
Now that we're removing the concept of a loadSender, there is no need to have a minimalHttpSender (did not implement loadSender) and a httpSender (implemented loadSender). So we can now have
a single httpSender that implements io.Writer just like every other sender.
2019-04-01 12:07:28 +10:30
Saxon 8cc7f6e500 revid: improved some naming 2019-03-29 16:22:51 +10:30
Saxon 3896a5e804 revid: senders are now io.Writers
Added a Write method to senders such that they implement io.Writer. The multiSender now takes a slice of io.writers.
Also modified revid code and tests to account for this chance.
2019-03-29 12:49:26 +10:30
Saxon 937f54f418 av: fixed conflicts with master 2019-03-28 11:03:05 +10:30
Saxon 5366eca2f2 av: fixed imports 2019-03-25 11:51:03 +10:30
Saxon e7c6b7319b revid: sender any logic that is performed on a failed send is now done inside loadSender.send() 2019-03-24 20:01:25 +10:30
Saxon fa011fb129 Merge branch 'master' into ringbuffer-move 2019-03-17 12:13:13 +10:30
Saxon 01a5759bde revid: changed remote param label for auto white balance from Awb to AutoWhiteBalance 2019-03-17 09:51:09 +10:30
Saxon 1533d6a7ff stream: got rid of Encoder interface as not needed anymore considering our encoders just implement io.Writer now 2019-03-16 15:46:33 +10:30
Saxon aa888ef115 revid: restructured revid.reset code to make more flexible for testing purposes. 2019-03-16 15:16:06 +10:30
Saxon 39a7b382f6 revid: fixed build errors 2019-03-15 18:05:15 +10:30
Saxon 524989d2ed revid: resolved conflicts 2019-03-15 17:51:17 +10:30
Saxon 9d5771fcbf revid: completed addition of exposure, awb, saturation and brightness options 2019-03-15 17:24:29 +10:30
Matthew Michael 9a510f5c31 cmd/revid-cli & revid: adding raspivid exposure and brightness parameters
Started working on adding exposure, brightness, saturation and awb flags to revid-cli so that we can control raspivid parameters.
Updated revid logic to give these to raspivid and updated config to consider these parameters in config validation.
2019-03-15 12:44:13 +10:30
Saxon 4d7f2d7b32 revid: further fixed logic in revid.reset encodersender setup 2019-03-14 14:43:55 +10:30
Saxon d2411a0761 revid: param label RtpAddr => RtpAddress 2019-03-14 14:16:55 +10:30
Saxon cbe4e52c11 revid: var label RtpAddr => RtpAddress 2019-03-14 14:11:38 +10:30
Saxon b7ef1a1a2b revid: improved error handling in revid.reset encoder/sender setup logic 2019-03-14 13:44:33 +10:30
Saxon 9b3a1d0ae7 revid: multiSender is no longer a struct, but rather a type derived from a []loadSender 2019-03-14 11:20:02 +10:30
Saxon 99a4010c79 revid: removed concept of send retry for now
Send retry has been removed from the multiSender. This also means there is not need for the active func, because we simply wait until the send is complete or failed to exit the output clips
routine. Tests pertinent to retrying or the active function have been removed.
2019-03-14 10:35:09 +10:30
Saxon 2e49de5fa0 revid: newMultiSender panics if active function is not provided 2019-03-14 08:34:35 +10:30
Saxon e593a04faf revid: added TestResetEncoderSenderSetup
Added a test to check that revid's reset method is correctly setting up encoders
and the senders they write to correctly.
2019-03-13 18:14:00 +10:30
Saxon 627297ce7e revid: using chunk.WriteTo rather than chunk.Bytes to get data to encoders 2019-03-13 12:25:57 +10:30
Saxon 500edc05aa revid: retry is now an attribute of senders and can be set at initialisation 2019-03-12 20:53:27 +10:30
Saxon 53382c5774 revid: newMultiSender returns error if the passed active function is nil 2019-03-12 15:39:51 +10:30
Saxon e2a6d9f4bd revid: added function type called active to multiSender
We wish to have a way to check that the 'owner' of the multi sender is still active while it may be doing continual send retries - therefore a function with bool return called active has been added
as a field to multiSender so that we can call this and check whether the owner of the multiSender is 'active' or not.
2019-03-12 15:32:01 +10:30
Saxon 0ca75538d2 revid: created multiSender retry field and setting based on outputs
Added a retry field for the multiSender which will be used to decide whether to retry sending or not. This is being set true if we have a http sender and no other senders.
2019-03-12 15:18:02 +10:30
Saxon 1c75867ba5 revid: simplified logic for setup of senders and encoders in revid.reset 2019-03-12 12:59:10 +10:30
Saxon a726acf520 revid: enc=>e 2019-03-12 03:05:36 +10:30
Saxon 652a5ab173 revid: made logic regarding sender and encoder selection more readable, and added more commenting 2019-03-12 03:01:43 +10:30
Saxon 9f4f9e8920 revid: Encoder type now implements io.Writer 2019-03-10 13:00:58 +10:30
Saxon def220daf3 revid: sending encode errors to errorHandler and made multiSender smarter
Errors captured from encoding are now sent to the error handler.
We also made multiSender smart so that during a write if sendRetry is on, we first check
that revid is actually running before attempting to send again. If revid is not running we return.
We also now log any send errors inside multiSender.
2019-03-10 12:34:45 +10:30
Saxon fc72eeaa0f revid: improved commenting 2019-03-10 12:21:53 +10:30
Saxon 93e856792d cmd/revid-cli & revid: fixed conflict 2019-03-09 15:54:52 +10:30
Saxon e0039da2e4 cmd/revid-cli & revid: moved ringBuffer to earlier in pipeline
Removed packetization flag for revid-cli as no longer required.
Packetization will be decided based on outputs.
Removed buffer type definition and Write receiver func in
mtsSender_test.go as this is now defined in revid.go.
Made ringbuffer size and element size consisten no matter the
output methods, as we're now going to only be putting h264 in there.
Modified H264 lex function to take an io.Writer rather than an
Encoder.
Removed destination []loadSender slice from revids fields and
added an encoder []stream.Encoder slice to hold encoders used
during a particular configuration. Each encoder will write to
the desired outputs.
Modified logic regarding encoder and sender setup. We now check
what outputs we have and add encoders to revid's encoder slice
depending on what each output requires.
Modified outputClips routine such that it ranges through revid's
encoders and encodes to them. They then write to the senders and
they handle logic regarding the amount of data they send out
and when. They also handle actions to perform on send failures.
Wrote multiSender struct which will be written to from encoders.
It will then use it's senders to distribute the data accordingly
to senders that work with the encoding from said encoders.
Modified senders so that their load methods no longer take ring
chunks, but rather slices.
Modified senders such that their release methods no longer
perform chunk closing.
2019-03-09 15:28:07 +10:30
Saxon Milton cfb4946588 Merged in video-rotate (pull request #158)
Video rotate

Approved-by: Alan Noble <anoble@gmail.com>
2019-03-08 23:33:40 +00:00
Saxon 0962b1047d revid: removed udp sender and anything pertainent to it 2019-03-07 20:14:50 +10:30
Saxon 6fa9f37972 revid: remove ffmpegSender and any code pertaining to it. 2019-03-07 19:15:39 +10:30
Saxon Milton a7ae1aa643 revid: fixed raspivid flag usage for vertical and horizontal flipping - tested and working 2019-03-06 01:38:13 +00:00
Saxon 3a9e90dcf8 cmd/revid-cli & revid: added back vertical and horizontal flip options 2019-03-06 11:51:55 +10:30
Saxon Milton 768ea3a007 Merged in csv-output-var (pull request #160)
revid: handling csv output var in revid's update function

Approved-by: Alan Noble <anoble@gmail.com>
2019-03-05 06:44:27 +00:00
Saxon 79d0dad757 revid: checking for changes to rtp address in vars now 2019-03-05 16:38:32 +10:30