nesterenkodm / pjsip

PJSIP is Open Source SIP, Media, and NAT Traversal Library
495 stars 220 forks source link

Unable to stream data with multichannel (L16) codec #93

Closed jaredhagel closed 4 years ago

jaredhagel commented 4 years ago

Recently I’ve tried using the ‘LPCM 44 kHz Stereo' codec to stream a wav file in stereo format to a device. To do so I used the following arguments to streamutil.c:

--remote=172.23.44.1:4000 --play-file C:\pjproject-2.10\pjsip-apps\bin\samples\i386-win32-vc14-debug\file_example_Test_44_1.wav --codec L16/44100/2

The file_example_Test_44_1.wav has a sample rate of 44.1kHz and has stereo channels (ie. left and right). When running this program I repeatedly get the error “Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT)”. Program output below:

Program

07:17:48.698 os_core_win32. !pjlib 2.10 for win32 initialized Direction is set to --send-only because of --play-file 07:17:49.226 wmme_dev.c WMME found 5 devices: 07:17:49.227 wmme_dev.c dev_id 0: Wave mapper (in=2, out=2) 07:17:49.227 wmme_dev.c dev_id 1: Microphone (Logitech Wireless H (in=2, out=0) 07:17:49.227 wmme_dev.c dev_id 2: Microphone Array (Realtek Audio (in=2, out=0) 07:17:49.227 wmme_dev.c dev_id 3: Speakers (Logitech Wireless Hea (in=0, out=2) 07:17:49.227 wmme_dev.c dev_id 4: Speakers / Headphones (Realtek (in=0, out=2) 07:17:49.228 wmme_dev.c WMME initialized 07:17:49.228 pjlib select() I/O Queue created (0091788C) 07:17:49.499 strm008D3AD4 VAD temporarily disabled 07:17:49.501 rtp.c pjmedia_rtp_session_init: ses=00933B9C, default_pt=10, ssrc=0x294823 07:17:49.501 rtp.c pjmedia_rtp_session_init: ses=009341B0, default_pt=10, ssrc=0x294823 07:17:49.501 stream.c Stream strm008D3AD4 created 07:17:49.508 wav_player.c File player 'C:\pjproject-2.9\pjsip-apps\bin\samples\i386-win32-vc14-debug\file_example_Test_44_1.wav' created: samp.rate=44100, ch=2, bufsize=4KB, filesize=5914KB Playing from WAV file C:\pjproject-2.9\pjsip-apps\bin\samples\i386-win32-vc14-debug\file_example_Test_44_1.wav.. 07:17:49.510 strm008D3AD4 Encoder stream started 07:17:49.510 strm008D3AD4 Decoder stream paused Stream is active, dir is send-only, sending to 224.0.0.0:4000

Commands: s Display media statistics q Quit

Command: 07:17:49.520 strm008D3AD4 !Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.530 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.540 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.549 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.560 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.570 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.581 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.590 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.600 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.611 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.621 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.631 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) 07:17:49.641 strm008D3AD4 Codec encode() error: Codec frame is too short (PJMEDIA_CODEC_EFRMTOOSHORT) ...

Similar issue is https://github.com/chebur/pjsip/issues/70

welljsjs commented 4 years ago

You should report any errors related to pjsip to the official pjsip repository which can be found here: https://github.com/pjsip/pjproject

This repo aims to make pjsip available for Apple platforms (we just provide the build process)

jaredhagel commented 4 years ago

Oh I see. Will do. Sorry about that.