Repository navigation
container/flv: add audio support - #45
Conversation
We currently just add dummy audio, which does not allow us to have anything other than silence.
ao-david
left a comment
There was a problem hiding this comment.
Looks like a promising step!
I would like to see the tests passing and this still working with YouTube before merging
This is so that audio and video can be written separately. Some adapters are also provided to interface with io.Writer. A dummy audio decorator is provided for when you don't want any audio.
Added audio functionality to the stream from file test for RTSP so that we know it actually works. Also added a ADTS lexer, which may come in handy.
|
I have added a test (which worked successfully, albeit with some freezing). I think all of the comment should be fixed up now. |
|
This PR is quite big. Any chance we could do separate PRs ? Maybe one for reformatting, another for adding the lexer and then the other for the test ? And any other changes you think would be worth splitting up ? |
There was a problem hiding this comment.
Consider splitting this up into separate pull requests. I'm also not sure we need the adapter code at this stage. ISTM we could have written a proof of concept test without making modifications to the primary interface we're currently using in the pipeline.
trekhopton
left a comment
There was a problem hiding this comment.
Will revisit once the discussed changes to the encoder have been made.
This is so that the previous interface is retained. Dummy audio is now written by default again and can be enabled or disabled using SetDummyAudio.
|
|
||
| // SetDummyAudio disables or enables the sending of dummy audio frames at the same time as video frames. | ||
| // After this function is called, a new audio config must be sent in the first WriteAudio operation. | ||
| func (e *Encoder) SetDummyAudio(enabled bool) { |
There was a problem hiding this comment.
I have done this as a setter as the audio specific config should be reset at the same time. This is because the new audio stream may have a different config.
As it is unused and easy to implement yourself
|
Tested streaming to youtube on latest commit and it works great. I believe this is all good to go now. |
We currently just add dummy audio, which does not allow us to have anything other than silence. This requires renaming frame to videoFrame. I have also made Write return the total number of bytes written, rather than just the size of the video frame.