sourcey / libsourcey

C++14 evented IO libraries for high performance networking and media based applications
https://sourcey.com/libsourcey
GNU Lesser General Public License v2.1
1.31k stars 347 forks source link

webrtcrecorder no record file but only: [warn] [streamrecorder.cpp(118)] Dropping initial mono samples #217

Closed demobin8 closed 6 years ago

demobin8 commented 6 years ago

webrtcrecorder sample

  1. build webrtcrecorder sample with webrtc and ffmpeg following: libsourcey doc, successed
  2. settup https enviroment following: #131 , successed
  3. modify source code, record only audio(course my pc do not have a camera), successed

modify src/webrtc/samples/webrtcrecorder/config.h

...
#define OUTPUT_FORMAT av::Format("AAC", "aac", av::AudioCodec("AAC", "libfdk_aac", 2, 44100, 64000, "s16"));
...

modify src/webrtc/samples/webrtcrecorder/signaler.cpp

...
    //auto videoTracks = stream->GetVideoTracks();
    //if (!videoTracks.empty())
    //    _recorder->setVideoTrack(videoTracks[0]);
...

recompile webrtcrecorder modify src/webrtc/samples/webrtcrecorder/client/assets/symple.player.webrtc.js

...
        // The `MediaStreamConstraints` object to pass to `getUserMedia`
        this.userMediaConstraints = player.options.userMediaConstraints || { 
            audio: true, 
            video: false
        }
...

restart server with node app everything looks fine but i cant stop the recording by click stop button except close the browser, and i cann't find any record file, the webrtcrecorder show this message:

14:35:20 [debug] [application.cpp(45)] Create
[000:000] [17523] (audio_device_generic.cc:51): virtual bool webrtc::AudioDeviceGeneric::BuiltInAECIsAvailable() const: Not supported on this platform
[000:000] [17523] (audio_device_generic.cc:61): virtual bool webrtc::AudioDeviceGeneric::BuiltInAGCIsAvailable() const: Not supported on this platform
[000:000] [17523] (audio_device_generic.cc:71): virtual bool webrtc::AudioDeviceGeneric::BuiltInNSIsAvailable() const: Not supported on this platform
[000:000] [17523] (adm_helpers.cc:47): Unable to set recording channel to kChannelBoth.
14:35:20 [debug] [signaler.cpp(116)] Client state changed from Closed to Connecting
14:35:20 [debug] [application.cpp(104)] Wait for shutdown
14:35:20 [debug] [signaler.cpp(116)] Client state changed from Connecting to Connected
14:35:20 [debug] [client.cpp(364)] On handshake: sid=aSMUYEpwhVC5BKmRAAAA, pingInterval=25000, pingTimeout=60000
14:35:20 [debug] [client.cpp(387)] Peer connected:videorecorder|aSMUYEpwhVC5BKmRAAAA
14:35:20 [debug] [signaler.cpp(116)] Client state changed from Connected to Online
14:35:50 [debug] [signaler.cpp(89)] Peer message: demo|QPeNam0CkL0VyYIeAAAB
14:35:50 [debug] [signaler.cpp(71)] Peer connected: QPeNam0CkL0VyYIeAAAB
14:35:50 [debug] [client.cpp(387)] Peer connected:demo|QPeNam0CkL0VyYIeAAAB
14:35:50 [debug] [signaler.cpp(89)] Peer message: demo|QPeNam0CkL0VyYIeAAAB
14:35:50 [debug] [peer.cpp(130)] QPeNam0CkL0VyYIeAAAB: Receive offer: v=0
o=- 8576001316704736309 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS SdvcDBDBK7dlLzUsIcvWmjnsju4eUO7Aq4G0
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:GPgm
a=ice-pwd:eQEsmdtePpziFAcUnrWDAigm
a=ice-options:trickle
a=fingerprint:sha-256 B4:5A:B5:53:EC:AC:72:16:69:7D:64:C9:04:CD:B2:BC:D8:85:37:1F:31:40:EF:75:03:6C:23:29:4B:31:3D:59
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:1705708305 cname:NYbjW43V9zHuKgM8
a=ssrc:1705708305 msid:SdvcDBDBK7dlLzUsIcvWmjnsju4eUO7Aq4G0 0880a819-82d6-42ea-b3e0-17a6e4ef20d2
a=ssrc:1705708305 mslabel:SdvcDBDBK7dlLzUsIcvWmjnsju4eUO7Aq4G0
a=ssrc:1705708305 label:0880a819-82d6-42ea-b3e0-17a6e4ef20d2

14:35:50 [debug] [peer.cpp(165)] QPeNam0CkL0VyYIeAAAB: On signaling state change: 3
14:35:50 [debug] [peer.cpp(225)] QPeNam0CkL0VyYIeAAAB: On add stream
14:35:50 [debug] [peermanager.cpp(64)] Received offer: v=0
o=- 8576001316704736309 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS SdvcDBDBK7dlLzUsIcvWmjnsju4eUO7Aq4G0
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:GPgm
a=ice-pwd:eQEsmdtePpziFAcUnrWDAigm
a=ice-options:trickle
a=fingerprint:sha-256 B4:5A:B5:53:EC:AC:72:16:69:7D:64:C9:04:CD:B2:BC:D8:85:37:1F:31:40:EF:75:03:6C:23:29:4B:31:3D:59
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:1705708305 cname:NYbjW43V9zHuKgM8
a=ssrc:1705708305 msid:SdvcDBDBK7dlLzUsIcvWmjnsju4eUO7Aq4G0 0880a819-82d6-42ea-b3e0-17a6e4ef20d2
a=ssrc:1705708305 mslabel:SdvcDBDBK7dlLzUsIcvWmjnsju4eUO7Aq4G0
a=ssrc:1705708305 label:0880a819-82d6-42ea-b3e0-17a6e4ef20d2

14:35:50 [debug] [signaler.cpp(89)] Peer message: demo|QPeNam0CkL0VyYIeAAAB
14:35:50 [debug] [peermanager.cpp(85)] Received candidate: candidate:2133686242 1 udp 2122260223 192.168.88.62 60171 typ host generation 0 ufrag GPgm network-id 1
14:35:50 [debug] [peer.cpp(329)] On SDP parse success
14:35:50 [debug] [peer.cpp(255)] QPeNam0CkL0VyYIeAAAB: Set local description
14:35:50 [debug] [peer.cpp(165)] QPeNam0CkL0VyYIeAAAB: On signaling state change: 0
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:35:50 [debug] [peer.cpp(185)] QPeNam0CkL0VyYIeAAAB: On ICE connection change: 1
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:35:50 [debug] [peer.cpp(329)] On SDP parse success
14:35:50 [debug] [peer.cpp(191)] QPeNam0CkL0VyYIeAAAB: On ICE gathering change: 1
14:35:50 [debug] [peer.cpp(191)] QPeNam0CkL0VyYIeAAAB: On ICE gathering change: 2
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:35:50 [debug] [peer.cpp(185)] QPeNam0CkL0VyYIeAAAB: On ICE connection change: 2
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:35:50 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples

...
14:36:35 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:36:35 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:36:35 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:36:35 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:36:35 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:36:35 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:36:35 [warn] [streamrecorder.cpp(118)] Dropping initial mono samples
14:36:35 [debug] [signaler.cpp(89)] Peer message: demo|QPeNam0CkL0VyYIeAAAB
14:36:35 [debug] [client.cpp(394)] Peer disconnected:demo|QPeNam0CkL0VyYIeAAAB
14:36:35 [debug] [signaler.cpp(104)] Peer disconnected
14:36:35 [debug] [signaler.cpp(108)] Closing peer connection: QPeNam0CkL0VyYIeAAAB
14:36:35 [debug] [peer.cpp(106)] QPeNam0CkL0VyYIeAAAB: Closing
14:36:35 [debug] [peer.cpp(185)] QPeNam0CkL0VyYIeAAAB: On ICE connection change: 6
14:36:35 [debug] [peer.cpp(165)] QPeNam0CkL0VyYIeAAAB: On signaling state change: 5
14:36:35 [debug] [peermanager.cpp(110)] Deleting peer connection: QPeNam0CkL0VyYIeAAAB
14:36:36 [debug] [peer.cpp(51)] QPeNam0CkL0VyYIeAAAB: Destroying
14:36:56 [error] [client.cpp(210)] Set error: Stream read error: end of file
14:36:56 [debug] [signaler.cpp(116)] Client state changed from Online to Error
14:36:56 [error] [stream.h(170)] Stream exception: Cannot connect to Symple server. Did you start the demo app and the Symple server is running on port 4500?
webrtcrecorderd: /home/demobin/work/github/libsourcey/src/net/src/tcpsocket.cpp:287: virtual void scy::net::TCPSocket::setError(const scy::Error&): Assertion `!error().any()' failed.
demobin8 commented 6 years ago

any suggestion for only record audio sample settup?