Git Product home page Git Product logo

belledonnecommunications / mediastreamer2 Goto Github PK

View Code? Open in Web Editor NEW
132.0 26.0 102.0 55.36 MB

Linphone.org mirror for mediastreamer2 (git://git.linphone.org/mediastreamer2.git)

Home Page: http://linphone.org

License: GNU Affero General Public License v3.0

Shell 0.28% Makefile 0.56% C++ 19.96% C 69.67% C# 0.58% HTML 0.03% CMake 2.41% Awk 0.01% Java 1.55% Objective-C 2.14% Assembly 0.10% GLSL 0.04% Batchfile 0.02% M4 1.27% Python 0.10% Objective-C++ 1.28%

mediastreamer2's Introduction

pipeline status

Mediastreamer2

Mediastreamer2 is a powerful and lightweight streaming engine for voice/video telephony applications. This media processing and streaming toolkit is responsible for receiving and sending all multimedia streams in Linphone, including voice/video capture, encoding and decoding, and rendering.

For additional information, please visit mediastreamer2's homepage on linphone.org

License

Copyright © Belledonne Communications

Mediastreamer2 is dual licensed, and is available either :

  • under a GNU/AGPLv3 license, for free (open source). Please make sure that you understand and agree with the terms of this license before using it (see LICENSE.txt file for details). AGPLv3 is choosen over GPLv3 because mediastreamer2 can be used to create server-side applications, not just client-side ones. Any product incorporating mediastreamer2 to provide a remote service then has to be licensed under AGPLv3. For a client-side product, the "remote interaction" clause of AGPLv3 being irrelevant, the usual terms GPLv3 terms do apply (the two licences differ by this only clause).

  • under a proprietary license, for a fee, to be used in closed source applications. Contact Belledonne Communications for any question about costs and services.

Documentation

Please browse supported features and RFCs from [https://www.linphone.org/technical-corner/mediastreamer2/features].

Mediastreamer2 has a concept of filters, that can be connected to form a graph. Each filter is responsible for doing some kind of processing and delivers data to the next filter. As an example, you could get some data from network and unpack it in an RTP filter. This RTP filter will deliver the data to a decoder (speex, G711...) which will deliver it to a filter that is able to play the PCM data or another to record it into a .wav file. A more high level API is available in mediastreamer2/mediastream.h header file, exposing primitives to create audio and video streams suitable for a VoIP application.

Compilation and installation

Required dependencies:

  • bctoolbox[1]: portability layer
  • oRTP[2]: RTP stack

Optional dependencies

  • libsrtp for SRTP encryption
  • bzrtp[3] for ZRTP encryption
  • libgsm: GSM codecs support
  • libbv16: BV16 codec support
  • libopus for Opus encoding and decoding
  • libspeex: SPEEX codec support
  • **libspeex-dsp: resampler and AEC
  • libalsa: ALSA support (GNU/Linux only)
  • libpulse: PulseAudio support (GNU/Linux only)
  • libv4l2: video capture (GNU/Linux only;disablable)
  • libx11 and libxv: video display with X11 (GNU/Linux only)
  • libglx: video dispaly with GLX (GNU/Linux only)
  • libvpx for VP8 encoding and decoding
  • libmastroska-c for recording/playing of audio/video streams
  • libturbojpeg: video screenshot feature
  • ffmpeg, h264 decoder, mpeg4 and mjpeg encoder/decoders, rescaling and pixel conversion.

Build instructions:

The Autotools way is deprecated. Use CMake to configure the source code.

cmake . -DCMAKE_INSTALL_PREFIX=<prefix> -DCMAKE_PREFIX_PATH=<search_path>

make
make install

Alternatively, mediastreamer2 library is integrated in linphone-sdk[4] meta project, which provides a convenient way to build it for various targets.

Supported options:

  • CMAKE_INSTALL_PREFIX=<string> : install prefix
  • CMAKE_PREFIX_PATH=<string> : column-separated list of prefixes where to search for dependencies
  • ENABLE_STRICT=NO : build without strict compilation flags (-Wall -Werror)
  • ENABLE_UNIT_TESTS=YES : build tester binaries
  • ENABLE_DOC=NO : do not generate the documentation
  • ENABLE_DEBUG_LOGS=YES : turn on debug-level logs

Note for packagers:

Our CMake scripts may automatically add some paths into research paths of generated binaries. To ensure that the installed binaries are striped of any rpath, use -DCMAKE_SKIP_INSTALL_RPATH=ON while you invoke cmake.

Rpm packaging mediastremer2 rpm can be generated with cmake3 using the following command: mkdir WORK cd WORK cmake3 ../ make package_source rpmbuild -ta --clean --rmsource --rmspec mediastreamer--.tar.gz

Environment variables used by mediastreamer2

MS2_RTP_FIXED_DELAY : default value is 0. When set to 1, RTP packets belonging from one tick execution are actually sent at the beginning of the next tick. This allows a zero jitter in the RTP timing at sender side. This is to be used for measurements, this mode has no interest for doing a real conversation and does not improve quality.

MS_AUDIO_PRIO, MS_VIDEO_PRIO : define the scheduling policy of the audio and video threads (MSTicker objects). Possible values are 'NORMAL', 'HIGH', 'REALTIME'. The corresponding behavior is as follows:

+-------------------+------------------------+------------------------+-------------------------+
| Priority type     |     GNU/Linux          |        MacOS           |         Windows         |
+-------------------+------------------------+------------------------+-------------------------+
| NORMAL            | SCHED_OTHER, def. prio | SCHED_OTHER, def. prio | Default priority.       |
| HIGH              | SCHED_RR, max prio     | SCHED_RR, max prio     | THREAD_PRIORITY_HIGHEST |
| REALTIME          | SCHED_FIFO, max prio   | SCHED_FIFO, max prio   | THREAD_PRIORITY_HIGHEST |
+-------------------+------------------------+------------------------+-------------------------+

Note that SCHED_FIFO leaves entire control of the cpu to the mediastreamer2 thread. In case of CPU overload due to heavy encoder processing for example, a mono-core machine will stop responding.

  • MS_TICKER_SCHEDPRIO : UNIX only. It is an integer defining the thread priority to be used by MSTicker. Values are OS specific and depend on the scheduling policy SCHED_FIFO, SCHED_RR or SCHED_OTHER.
  • MS2_OPUS_COMPLEXITY : opus codec complexity parameter. A value of -1 stands for mediastreamer2's own default value. Otherwise it must be between 0 and 10.
  • MEDIASTREAMER_DEBUG : when set to 1, verbose logging is activated by default.
  • DISPLAY : used by video display filters relying on X11 (GNU/Linux only).

Contact information

Use the linphone mailing list for question about mediastreamer2. [email protected]. Subscribe here: https://savannah.nongnu.org/mail/?group=linphone


mediastreamer2's People

Contributors

andreagianarda avatar bagage avatar bensartor avatar brieucv avatar cdeschambc avatar datbewar avatar diorcety avatar edhelas avatar ethoms avatar fgrisez avatar fwh-dc avatar gberaudo avatar goffioul avatar gui13 avatar jeannotlapin avatar ledjlale avatar mfortini avatar mickhopes avatar peppsac avatar sanavak avatar smallmuou avatar smorlat avatar thibaultlemaire avatar viish avatar wescoeur 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

mediastreamer2's Issues

Have a few questions

Hi,

1,When two devices are talking, there is a sound distortion after a few seconds, and the distortion lasts for about 2 seconds. What's the reason?
2,I try to delay 1 second to call sender_process in msrtp.c, and find that the distortion of 2 seconds occurre as soon as it begin to talk, and then it return to normal after 2 seconds.
3, When answering, the start delay is larger, then the delay is shorter and shorter, and the voice is faster and faster. It'll be OK in a moment,What's the reason?
4,When the caller and the called are connected for the first time, the audio-video delay is relatively large. When they are connected later, the audio-video delay is relatively small. What's the reason?
thanks.

[Bug]: v5.3.1 `CMakeLists.txt` missing target `bcg729` and target `bcmatroska2` [OBS Build Service (Archlinux/Manjaro)]

OBS Build Service

Suggestion to patch mediastreamer2 to add missing target bcg729 and target bcmatroska2 which seems to affect Archlinux/Manjaro compilation repeatedly across the last releases of mediastreamer2:

mediastreamer2-fix-Archlinux-compilation.patch

General information

  • Device: Linuxbox
  • OS: Archlinux/Manjaro
  • Version of the App: 5.2.0
  • Version of the SDK: corresponding (mediastremer2 v 5.3.1).

Expected behaviour

Find targets bcg729 and bcmatroska2 .

To Reproduce

OBS Build Service compilation

Additional context

The same need seems to exists in liblinphone for Archlinux/Manjaro compilation on OBS Build Service. Direct link to issue description here

SDK logs URL

No response

Query related to local video stream customisation

Hi

I want to provide customisation of the video stream to be previewed and send as the remote stream. Customisation is for adding effects like blur in the background like a portrait effect of camera to show an object or face and the background is blur.

I'm using the Linphone SDK V5.2.110.

Could you give us in brief the steps required and files to be modified in order to implement such filters or can you provide recent code or architecture related documentation?

It's kind on an urgent basis, would highly appreciate your quick reply.

Thanks

[Bug]: Question enable h264

Context

Hi @fgrisez , sorry for tagging, but i saw you active on this github

I have a simple question, hoping you can help me out...
Using Debian 11 , and i want to use the Console version of linphone, so i installed it with:

apt-get install -y git ffmpeg libavcodec-dev libswscale-dev libavutil-dev libx264-dev liblinphone-dev linphone-nogtk
I enabled the h264 codec in the linphonerc file:

[video_codec_0]
mime=H264
rate=90000
enabled=1
send_fmtp=profile-level-id=42801F; packetization-mode=0
recv_fmtp=profile-level-id=42801F; packetization-mode=0

[video_codec_1]
mime=H264
rate=90000
enabled=1
send_fmtp=profile-level-id=42801F; packetization-mode=1
recv_fmtp=profile-level-id=42801F; packetization-mode=1

When i start, i get this error below...
What do i need to install extra to enable h264 ?

thnx in advance!!

2022-05-31 11:41:55:590 mediastreamer-message-Could not find encoder for H264
2022-05-31 11:41:55:590 liblinphone-warning-Codec H264/90000 read from conf is not supported by mediastreamer2, ignored.
2022-05-31 11:41:55:590 mediastreamer-message-Could not find encoder for H264
2022-05-31 11:41:55:590 liblinphone-warning-Codec H264/90000 read from conf is not supported by mediastreamer2, ignored.

General information

  • Device: linphonec
  • OS: Debian 11
  • Version of the App: 4.4.21
  • Version of the SDK:

Expected behaviour

Enable h264

To Reproduce

not relevant

Additional context

Add any other context about the problem here.

SDK logs URL

No response

[Bug]: SOVERSION is not used when building a shared library for Linux.

The comment in line 619 says that the SOVERSION should only be set if the system is not Android, but the line setting the SOVERSION for the shared library is in a conditional branch that is only run when building for Android.

if(ANDROID)
if(VPX_FOUND)
set_target_properties(mediastreamer2 PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,libvpx.a")
endif()
# Do not version shared library on Android
set_target_properties(mediastreamer2 PROPERTIES SOVERSION ${MEDIASTREAMER_SO_VERSION})
else()

Until this commit the lines which are now 619 and 620 were correctly in the else branch of the Android condition.

A nicer `nowebcamCIF.jpg`?

Context

Current nowebcamCIF.jpg

Could it be nicer to have something like:

nowebcamCIF.jpg

General information

  • Device: OBS Build Service
  • OS: All Linux-OS
  • Version of the App: 5.2.4
  • Version of the SDK: corresponding

Expected behaviour

Something nicer to look at when there is no webcam.

To Reproduce

Not applicable.

Additional context

Add any other context about the problem here.

SDK logs URL

No response

Misspellings in source code (patch file included)

While working on packaging version 4.4.0 for Debian/Ubuntu I encountered some misspelled words in the code comments and took a few extra minutes to craft a patch file to correct them. I'm attaching it to this issue in case you'd like to apply it here upstream.

Patch file:
mediastreamer2-corrected-misspellings.txt

Patch file contents
--- a/help/ht0-buildagraph.dox
+++ b/help/ht0-buildagraph.dox
@@ -114,7 +114,7 @@ cards' filters:
 Then you need to 'attach' the filters to a ticker. A ticker is a graph
 manager responsible for running filters.
 
-In the above case, there is 2 independant graph within the ticker: you
+In the above case, there are two (2) independent graphs within the ticker: you
 need to attach the first element of each graph (the one that does not
 contains any INPUT pins)
 
--- a/include/mediastreamer2/msfileplayer.h
+++ b/include/mediastreamer2/msfileplayer.h
@@ -30,7 +30,7 @@
 /* set loop mode: 
 	-1: no looping, 
 	0: loop at end of file, 
-	x>0, loop after x miliseconds after eof
+	x>0, loop after x milliseconds after EOF
 */
 #define MS_FILE_PLAYER_LOOP	MS_FILTER_METHOD(MS_FILE_PLAYER_ID,4,int)
 #define MS_FILE_PLAYER_DONE	MS_FILTER_METHOD(MS_FILE_PLAYER_ID,5,int)
--- a/include/mediastreamer2/msticker.h
+++ b/include/mediastreamer2/msticker.h
@@ -39,7 +39,7 @@
 
 
 /**
- * Function pointer for method getting time in miliseconds from an external source.
+ * Function pointer for method of getting time in milliseconds from an external source.
  * @var MSTickerTimeFunc
  */
 typedef uint64_t (*MSTickerTimeFunc)(void *);
@@ -77,7 +77,7 @@ struct _MSTicker
 	MSList *execution_list;     /* the list of source filters to be executed.*/
 	MSList *task_list; /* list of tasks (see ms_filter_postpone_task())*/
 	ms_thread_t thread;   /* the thread ressource*/
-	int interval; /* in miliseconds*/
+	int interval; /* in milliseconds*/
 	int exec_id;
 	uint32_t ticks;
 	uint64_t time;	/* a time since the start of the ticker expressed in milisec*/
--- a/src/audiofilters/genericplc.h
+++ b/src/audiofilters/genericplc.h
@@ -26,7 +26,7 @@
 /* 2/<min frequency we want to be able to reproduce> gives then length in seconds */
 #define PLC_BUFFER_LEN	2/40
 
-/* define in ms the maximum duration of PLC(after wich the output will be 0), and after how long we start decreasing the output volume to reach 0 at MAX_PLC_LEN */
+/* define in ms the maximum duration of PLC(after which the output will be 0), and how long before we start decreasing the output volume to reach 0 at MAX_PLC_LEN */
 #define PLC_DECREASE_START 100
 #define MAX_PLC_LEN 150
 
--- a/src/base/msticker.c
+++ b/src/base/msticker.c
@@ -454,7 +454,7 @@ void * ms_ticker_run(void *arg)
 		s->time+=s->interval;
 		late=s->wait_next_tick(s->wait_next_tick_data,s->time);
 		if (late>s->interval*5 && late>lastlate){
-			ms_warning("%s: We are late of %d miliseconds.",s->name,late);
+			ms_warning("%s: We are late by %d milliseconds.",s->name,late);
 			late_tick_time=ms_get_cur_time_ms();
 		}
 		lastlate=late;
--- a/src/crypto/dtls_srtp.c
+++ b/src/crypto/dtls_srtp.c
@@ -231,7 +231,7 @@ static void schedule_rtcp(struct _RtpTra
 }
 /**
  * Check if the incoming message is a DTLS packet.
- * If it is, store it in the context incoming buffer and call the polarssl function wich will process it.
+ * If it is, store it in the context incoming buffer and call the polarssl function which will process it.
  * This function also manages the client retransmission timer
  *
  * @param[in] 		msg	the incoming message
@@ -346,7 +346,7 @@ static bool_t ms_dtls_srtp_process_dtls_
 							base_index += Handshake_Header_Length + frag_length; // bytes parsed so far
 							frag += Handshake_Header_Length + frag_length; // point to the begining of the next fragment
 						} else { // message is malformed in a nasty way
-							ms_warning("DTLS Received %s packet len %d sessions: %p rtp session %p is malformed in an agressive way", is_rtp==TRUE?"RTP":"RTCP", (int)msgLength, ctx->stream_sessions, ctx->stream_sessions->rtp_session);
+							ms_warning("DTLS Received %s packet len %d sessions: %p rtp session %p is malformed in an aggressive way", is_rtp==TRUE?"RTP":"RTCP", (int)msgLength, ctx->stream_sessions, ctx->stream_sessions->rtp_session);
 							base_index = msgLength; // get out of the while
 							ms_free(reassembled_packet);
 							reassembled_packet = NULL;
@@ -644,7 +644,7 @@ static int ms_dtls_srtp_rtp_process_on_r
 			}
 
 			if (ctx->role != MSDtlsSrtpRoleIsServer) { /* close the connection only if we are client, if we are server, the client may ask again for last packets */
-				/*FireFox version 43 requires DTLS channel to be kept openned, probably a bug in FireFox ret = ssl_close_notify( &(ctx->rtp_dtls_context->ssl) );*/
+				/*FireFox version 43 requires DTLS channel to be kept open, probably a bug in FireFox ret = ssl_close_notify( &(ctx->rtp_dtls_context->ssl) );*/
 				
 			}
 
@@ -725,7 +725,7 @@ static int ms_dtls_srtp_rtcp_process_on_
 			}
 
 			if (ctx->role != MSDtlsSrtpRoleIsServer) { /* close the connection only if we are client, if we are server, the client may ask again for last packets */
-			/*FireFox version 43 requires DTLS channel to be kept openned, probably a bug in FireFox  ret = ssl_close_notify( &(ctx->rtcp_dtls_context->ssl) );*/
+			/*FireFox version 43 requires DTLS channel to be kept open, probably a bug in FireFox  ret = ssl_close_notify( &(ctx->rtcp_dtls_context->ssl) );*/
 			}
 		}
 
@@ -845,7 +845,7 @@ void ms_dtls_srtp_set_peer_fingerprint(M
 		size_t peer_fingerprint_length = strlen(peer_fingerprint)+1; // include the null termination
 		if (peer_fingerprint_length>sizeof(context->peer_fingerprint)) {
 			memcpy(context->peer_fingerprint, peer_fingerprint, sizeof(context->peer_fingerprint));
-			ms_error("DTLS-SRTP received from SDP INVITE a peer fingerprint %d bytes length wich is longer than maximum storage %d bytes", (int)peer_fingerprint_length, (int)sizeof(context->peer_fingerprint));
+			ms_error("DTLS-SRTP received from SDP INVITE a peer fingerprint %d bytes long, which is longer than maximum storage of %d bytes", (int)peer_fingerprint_length, (int)sizeof(context->peer_fingerprint));
 		} else {
 			memcpy(context->peer_fingerprint, peer_fingerprint, peer_fingerprint_length);
 		}
--- a/src/crypto/ms_srtp.c
+++ b/src/crypto/ms_srtp.c
@@ -589,6 +589,6 @@ const char * ms_srtp_stream_type_to_stri
 	case MSSRTP_RTCP_STREAM: return "MSSRTP_RTCP_STREAM";
 	case MSSRTP_ALL_STREAMS: return "MSSRTP_ALL_STREAMS";
 	}
-	return "Unkown srtp tream type";
+	return "Unknown srtp stream type";
 }
 
--- a/src/crypto/zrtp.c
+++ b/src/crypto/zrtp.c
@@ -641,7 +641,7 @@ MSZrtpContext* ms_zrtp_multistream_new(M
 	int retval;
 	MSZrtpContext *userData;
 	if ((retval = bzrtp_addChannel(activeContext->zrtpContext, sessions->rtp_session->snd.ssrc)) != 0) {
-		ms_warning("ZRTP could't add stream, returns %x", retval);
+		ms_warning("ZRTP couldn't add stream, returned %x", retval);
 	}
 
 	ms_message("Initializing multistream ZRTP context on rtp session [%p] ssrc 0x%x",sessions->rtp_session, sessions->rtp_session->snd.ssrc);
--- a/src/otherfilters/msrtp.c
+++ b/src/otherfilters/msrtp.c
@@ -731,7 +731,7 @@ static void receiver_process(MSFilter *
 		return;
 	
 	if (d->reset_jb){
-		ms_message("Reseting jitter buffer");
+		ms_message("Resetting jitter buffer");
 		rtp_session_resync(d->session);
 		d->reset_jb=FALSE;
 	}
--- a/src/utils/audiodiff.c
+++ b/src/utils/audiodiff.c
@@ -283,7 +283,7 @@ static int _ms_audio_diff_chunked(FileIn
 	*ret = cum_res / (double)tot_energy;
 	ms_message("Similarity factor weighted with most significant chunks is [%g]", *ret);
 	*ret = *ret * (1-variance);
-	ms_message("After integrating max position variance accross chunks, it is [%g]", *ret);
+	ms_message("After integrating maximum position variance across chunks, it is [%g]", *ret);
 	ms_free(chunk_energies);
 	ms_free(max_pos_table);
 	return maxpos;
--- a/src/utils/mkv_reader.h
+++ b/src/utils/mkv_reader.h
@@ -136,7 +136,7 @@ MKVTrackReader *mkv_reader_get_track_rea
 /**
  * @brief Set the reading head of each assocated track reader at a specific position
  * @param reader MKVReader
- * @param pos_ms Position of the head in miliseconds
+ * @param pos_ms Position of the head in milliseconds
  * @return The effective position of the head after the operation
  */
 int mkv_reader_seek(MKVReader *reader, int pos_ms);
--- a/src/videofilters/bb10_capture.cpp
+++ b/src/videofilters/bb10_capture.cpp
@@ -125,7 +125,7 @@ static void bb10capture_open_camera(BB10
 	camera_error_t error;
 	
 	if (d->camera_openned) {
-		ms_warning("[bb10_capture] camera already openned, skipping...");
+		ms_warning("[bb10_capture] camera already opened, skipping...");
 		return;
 	}
 	
@@ -157,7 +157,7 @@ static void bb10capture_open_camera(BB10
 
 static void bb10capture_start_capture(BB10Capture *d) {
 	if (!d->camera_openned) {
-		ms_error("[bb10_capture] camera not openned, skipping...");
+		ms_error("[bb10_capture] camera not opened, skipping...");
 		return;
 	}
 	if (d->capture_started) {
@@ -186,7 +186,7 @@ static void bb10capture_stop_capture(BB1
 
 static void bb10capture_close_camera(BB10Capture *d) {
 	if (!d->camera_openned) {
-		ms_warning("[bb10_capture] camera not openned, skipping...");
+		ms_warning("[bb10_capture] camera not opened, skipping...");
 		return;
 	}
 	
--- a/src/videofilters/msv4l2.c
+++ b/src/videofilters/msv4l2.c
@@ -697,7 +697,7 @@ static void *msv4l2_thread(void *ptr){
 	ms_message("msv4l2_thread starting");
 	if (s->fd==-1){
 		if( msv4l2_open(s)!=0){
-			ms_warning("msv4l2 could not be openned");
+			ms_warning("msv4l2 could not be opened");
 			goto close;
 		}
 	}
--- a/src/videofilters/vp8.c
+++ b/src/videofilters/vp8.c
@@ -407,10 +407,10 @@ static void enc_fill_encoder_flags(EncSt
 		} else if (frame_type & VP8_ALTR_FRAME) {
 			*flags |= (VP8_EFLAG_FORCE_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_REF_ARF);
 			if (s->frame_count > s->frames_state.last_independent_frame + 5*enc_get_ref_frames_interval(s)){
-				/*force an independant alt ref frame to force picture to be refreshed completely, otherwise
+				/*force an independent alt ref frame to force picture to be refreshed completely, otherwise
 				 * pixel color saturation appears due to accumulation of small predictive errors*/
 				*flags |= VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF;
-				ms_message("Forcing independant altref frame.");
+				ms_message("Forcing independent altref frame.");
 			}
 		}
 		if (!(*flags & VPX_EFLAG_FORCE_KF)){
@@ -1141,7 +1141,7 @@ static int dec_freeze_on_error(MSFilter
 
 static int dec_reset(MSFilter *f, void *data) {
 	DecState *s = (DecState *)f->data;
-	ms_message("Reseting VP8 decoder");
+	ms_message("Resetting VP8 decoder");
 	ms_filter_lock(f);
 	vpx_codec_destroy(&s->codec);
 	if (dec_initialize_impl(f) != 0){
--- a/src/voip/audiostream.c
+++ b/src/voip/audiostream.c
@@ -914,7 +914,7 @@ int audio_stream_start_from_io(AudioStre
 	}
 
 	/* sample rate is already set for rtpsend and rtprcv, check if we have to adjust it to */
-	/* be able to use the echo canceller wich may be limited (webrtc aecm max frequency is 16000 Hz) */
+	/* be able to use the echo canceller, which may be limited (webrtc aecm max frequency is 16000 Hz) */
 	// First check if we need to use the echo canceller
 	// Overide feature if not requested or done at sound card level
 	if ( ((stream->features & AUDIO_STREAM_FEATURE_EC) && !stream->use_ec) || has_builtin_ec )
--- a/src/voip/msvideo.c
+++ b/src/voip/msvideo.c
@@ -955,7 +955,7 @@ void ms_average_fps_init(MSAverageFPS* a
 	afps->mean_inter_frame = 0;
 	afps->context = ctx;
 	if (!ctx || strstr(ctx, "%f") == 0) {
-		ms_error("Invalid MSAverageFPS context given '%s' (must be not null and must contain one occurence of '%%f'", ctx);
+		ms_error("Invalid MSAverageFPS context given '%s' (must be not null and must contain one occurrence of '%%f'", ctx);
 	}
 }
 
--- a/tools/mediastream.c
+++ b/tools/mediastream.c
@@ -198,7 +198,7 @@ const char *usage="mediastream --local <
 								"[ --ec-tail <echo canceller tail length in ms> ]\n"
 								"[ --el (enable echo limiter) ]\n"
 								"[ --el-force <(float) [0-1]> (The proportional coefficient controlling the mic attenuation) ]\n"
-								"[ --el-speed <(float) [0-1]> (gain changes are smoothed with a coefficent) ]\n"
+								"[ --el-speed <(float) [0-1]> (gain changes are smoothed with a coefficient) ]\n"
 								"[ --el-sustain <(int)> (Time in milliseconds for which the attenuation is kept unchanged after) ]\n"
 								"[ --el-thres <(float) [0-1]> (Threshold above which the system becomes active) ]\n"
 								"[ --el-transmit-thres <(float) [0-1]> (TO BE DOCUMENTED) ]\n"
@@ -210,7 +210,7 @@ const char *usage="mediastream --local <
 								"[ --ice-remote-candidate <ip:port:[host|srflx|prflx|relay]> ]\n"
 								"[ --infile <input wav file> specify a wav file to be used for input, instead of soundcard ]\n"
 								"[ --interactive (run in interactive mode) ]\n"
-								"[ --jitter <miliseconds> ]\n"
+								"[ --jitter <milliseconds> ]\n"
 								"[ --log <file> ]\n"
 								"[ --mtu <mtu> (specify MTU)]\n"
 								"[ --netsim-bandwidth <bandwidth limit in bits/s> (simulates a network download bandwidth limit) ]\n"
@@ -228,7 +228,7 @@ const char *usage="mediastream --local <
 								"[ --outfile <output wav file> specify a wav file to write audio into, instead of soundcard ]\n"
 								"[ --playback-card <name> ]\n"
 								"[ --rc <rate control algorithm> possible values are: none, simple, advanced ]\n"
-								"[ --srtp <local master_key> <remote master_key> (enable srtp, master key is generated if absent from comand line) ]\n"
+								"[ --srtp <local master_key> <remote master_key> (enable srtp, master key is generated if absent from command line) ]\n"
 								"[ --verbose (most verbose messages) ]\n"
 								"[ --video-display-filter <name> ]\n"
 								"[ --video-windows-id <video surface:preview surface >]\n"

I've downloaded and filled out your Contributor Agreement as well, in case you need it on file to use the patch. If so, just let me know which method you'd prefer I use to transmit it to you and it's yours.

Warmly,
Peter

the problem for compile m2

hi all,
I have no crypto required ,so set disable for bctoolbox ; but it's unable to compile.
complie mediastreamer2 as the following steps

  1. compile bctoolbox : set -DENABLE_MBEDTLS=NO -DENABLE_POLARSSL=NO
  2. compile ortp
  3. set -DENABLE_SRTP=NO

and then excute the command make for mediastreamer2 ;the following error occurred:

./mediastreamer2/src/crypto/dtls_srtp.c:28:30: fatal error: bctoolbox/crypto.h: No such file or directory
compilation terminated.
src/CMakeFiles/mediastreamer.dir/build.make:878: recipe for target 'src/CMakeFiles/mediastreamer.dir/crypto/dtls_srtp.c.o' failed
make[2]: *** [src/CMakeFiles/mediastreamer.dir/crypto/dtls_srtp.c.o] Error 1

Building error

No Matter what I do always I get this error on Debian 11:

/usr/src/mediastreamer2/src/crypto/dtls_srtp.c:28:10: fatal error: bctoolbox/crypto.h: No such file or directory

This is the command line for build:

bctoolbox:

sudo cmake . -DCMAKE_PREFIX_PATH=/usr/local/include/mbedtls -DENABLE_POLARSSL=NO -DENABLE_TESTS=NO -DENABLE_TESTS_COMPONENT=NO

m2:

sudo cmake . -DSRTP_INCLUDE_DIRS=/usr/include -DSRTP_LIBRARIES=/usr/lib -DENABLE_DOC=NO -DENABLE_UNIT_TESTS=NO -DCMAKE_PREFIX_PATH=/usr/include:/usr/local/include/mbedtls:/usr/local/include/bctoolbox:/usr/local/include/BCUnit:/usr/src/bctoolbox/include/bctoolbox:/usr/src/bctoolbox/include

Any advice will be much appreciate
Thanks in avanced.

mediastreamer2 fails to compile on opensuse 15.x

On openSUSE Leap, we are compiling mediastreamer2 using gcc7. Since few weeks, we face this error:

[   12s] cd /home/abuild/rpmbuild/BUILD/mediastreamer2-4.5.16/build/src && /usr/bin/cc -DBCTBX_LOG_DOMAIN=\"mediastreamer\" -DHAVE_CONFIG_H -DMS2_EXPORTS -DMS2_FILTERS -DMS2_INTERNAL -DVIDEO_ENABLED -D_TRUE_TIME -Dmediastreamer_EXPORTS -I/home/abuild/rpmbuild/BUILD/mediastreamer2-4.5.16/include -I/home/abuild/rpmbuild/BUILD/mediastreamer2-4.5.16/src/audiofilters -I/home/abuild/rpmbuild/BUILD/mediastreamer2-4.5.16/src/utils -I/home/abuild/rpmbuild/BUILD/mediastreamer2-4.5.16/src/voip -I/home/abuild/rpmbuild/BUILD/mediastreamer2-4.5.16/build -I/home/abuild/rpmbuild/BUILD/mediastreamer2-4.5.16/build/src -I/usr/include/ffmpeg -I/usr/include/bcmatroska2  -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -fcommon -Wno-implicit-function-declaration -DNDEBUG -O2 -g -DNDEBUG -fPIC    -Wall -Wuninitialized -Wno-format-truncation -Wstrict-prototypes -Wno-error=strict-prototypes -o CMakeFiles/mediastreamer.dir/utils/jpgloader-turbojpeg.c.o   -c /home/abuild/rpmbuild/BUILD/mediastreamer2-4.5.16/src/utils/jpgloader-turbojpeg.c
[   12s] /home/abuild/rpmbuild/BUILD/mediastreamer2-4.5.16/src/utils/jpgloader-turbojpeg.c: In function 'jpeg2yuv_details':
[   12s] /home/abuild/rpmbuild/BUILD/mediastreamer2-4.5.16/src/utils/jpgloader-turbojpeg.c:116:44: error: 'TJERR_WARNING' undeclared (first use in this function)
[   12s]     ) <0 && tjGetErrorCode(turbojpegDec) != TJERR_WARNING) {
[   12s]                                             ^~~~~~~~~~~~~
[   12s] /home/abuild/rpmbuild/BUILD/mediastreamer2-4.5.16/src/utils/jpgloader-turbojpeg.c:116:44: note: each undeclared identifier is reported only once for each function it appears in

[Bug]: `libaom-dev`, `libaom-devel`, `libdav1d-dev`, `dav1d-devel`, `libdav1d-devel` libraries from distribution not found by `CMakeLists.txt` and `FindAom.cmake` (OBS Build Service)

Context

Compiling stand-alone with OBS Build Service, libaom-dev and libdav1d-dev development files is reported not found, although installed on the system from repository.

[   34s] -- Could NOT find Dav1d (missing: Dav1d_TARGET) 
[   34s] CMake Warning at CMakeLists.txt:414 (message):
[   34s]   Could not find dav1d, mediastreamer2 will be compiled without AV1 support.
[   34s] 
[   34s] 
[   34s] -- Could NOT find Aom (missing: Aom_TARGET) 
[   34s] CMake Warning at CMakeLists.txt:419 (message):
[   34s]   Could not find aom, mediastreamer2 will be compiled without AV1 support.

Compiling as a bundle on OBS Build Service, those development libraries are found.

[  140s] -- Found Dav1d: libdav1d  
[  140s] -- Found Aom: aom  

It seems that aom and dav1d development files [ -dev or -devel ] is only searched for in the build directory cmake file location, not in the system package install location. In FindAom.cmake there seems to be a mismatch with "_Aom*" vs "Aom*" . /usr/lib64, /usr/lib/x86_64-linux-gnu are other places where aom might install its library.

	find_path(Aom_INCLUDE_DIRS
		NAMES aom/aomcx.h
		HINTS _Aom_ROOT_PATHS
		PATH_SUFFIXES include
	)

	find_library(Aom_LIBRARY
		NAMES aom
		HINTS _Aom_ROOT_PATHS
		PATH_SUFFIXES bin lib lib/Win32
	)

	if(_Aom_INCLUDE_DIRS AND _Aom_LIBRARY)

Log Archlinux
Log openSUSE Tumbleweed
Log Fedora 39
Log Ubuntu 22.04

General information

  • Device: OBS Build Service build robot
  • OS: Ubuntu 22.04, openSUSE Tumbleweed, Fedora 39, Archlinux ... etc.
  • Version of the App: 5.2.0
  • Version of the SDK: corresponding (mediastreamer2 v5.3.1)

Expected behaviour

I wanted to add aom AV1 video encoder/decoder.

To Reproduce

  1. Go to package page

Additional context

No response

SDK logs URL

No response

JNI ERROR (app bug): local reference table overflow (max=512)

Hi:
First of all, I am sorry that I did not give feedback according to the format requirements, because I used a mobile phone to edit, it is difficult to translate and edit according to the format at the same time.
I'm using the latest version at (5.2.0).
When I frequently switch between the preview window and the remote video window, I find that it crashes, and some error messages are as follows:

Line 33381: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] Window released for windowId 0x0
Line 33383: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] Surface released for windowId 0x0
Line 33385: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] Surface destroyed for windowId 0x0
Line 33387: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] Context destroyed for windowId 0x0
Line 33389: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863e08] Initializing context for windowId 0x200daa
Line 33391: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] New windowId jobject ptr is 0x100dda, current one is 0x0
Line 33393: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] Took global ref on 0x100dda, windowId is now 0x200dca, scheduling creation
Line 33395: 07-12 17:21:19.426 D/Linphone(14219): --caltta--lc---[M:setNativeVideoWindowId]: end ...
Line 33397: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] JNI ERROR (app bug): local reference table overflow (max=512)
Line 33399: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] local reference table dump:
Line 33401: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] Last 10 entries (of 512):
Line 33403: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 511: 0x714e6d88 java.lang.Class<android.view.Surface>
Line 33405: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 510: 0x12e202c0 android.view.Surface
Line 33407: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 509: 0x12ea6340 android.graphics.SurfaceTexture
Line 33409: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 508: 0x12e113c0 android.view.Surface
Line 33411: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 507: 0x12e0faf0 android.graphics.SurfaceTexture
Line 33413: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 506: 0x714e6d88 java.lang.Class<android.view.Surface>
Line 33415: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 505: 0x714e6d88 java.lang.Class<android.view.Surface>
Line 33417: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 504: 0x12eae080 android.view.Surface
Line 33419: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 503: 0x12f6f760 android.graphics.SurfaceTexture
Line 33421: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 502: 0x12eae040 android.view.Surface
Line 33423: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] Summary:
Line 33425: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 172 of java.lang.Class (2 unique instances)
Line 33427: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 170 of android.view.Surface (170 unique instances)
Line 33429: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 170 of android.graphics.SurfaceTexture (170 unique instances)
Line 33431: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98]

[Bug]: Possible problem in msgenericplc.c

Context

Learning to work with RTP protocol

General information

  • Device: PC
  • OS: Ubuntu 20.04
  • Version of the App:
  • Version of the SDK: mediastreamer2-5.1.12

Expected behaviour

I wrote an additional filter for forwarding media data to the media streamer chain from the application. When testing, I pass data from the file through my filter to the media streamer chain. When the file is finished reading, a media packet less than 320 bytes in size is passed to the chain.
A plc filter is included in the media processing chain. In this filter, a memory access error occurs on line 96 (msgenericplc.c)

if (plc_context->plc_samples_used!=0) {
    /*we were doing PLC, now resuming with normal audio, continuity buffer is twice the transition delay lengths,  the second half is untouched by the update function and contains transition data generated by PLC */
   generic_plc_transition_mix((int16_t *) (m->b_rptr+transitionBufferSize), (int16_t *) (plc_context->continuity_buffer+transitionBufferSize), mgps->rate*TRANSITION_DELAY/1000);
}

This is due to a shift in the data buffer by an amount greater than the size of the buffer, or by an amount that, together with the size mgps->rate*TRANSITION_DELAY/1000, exceeds the length of the buffer.

I would like to know if this is an error in the logic in the plc module, or should I check the size of the media frame at the application level before sending it?

To Reproduce

Send a media frame less than 120 bytes to the PLC filter

Additional context

Add any other context about the problem here.

SDK logs URL

No response

v5.3.37 ffmpegjpegwriter.c:188:25: error: label "end" used but not defined (Fedora 39/40)

Context

Compilation on Fedora 39/40 (logfile OBS Build Service) stops with:

/home/abuild/rpmbuild/BUILD/mediastreamer2-5.3.37/src/videofilters/ffmpegjpegwriter.c: In function ‘jpg_process_frame_task’:
/home/abuild/rpmbuild/BUILD/mediastreamer2-5.3.37/src/videofilters/ffmpegjpegwriter.c:188:25: error: label ‘end’ used but not defined
188 |                         goto end;
    |                         ^~~~
gmake[2]: *** [src/CMakeFiles/mediastreamer2.dir/build.make:1409: src/CMakeFiles/mediastreamer2.dir/videofilters/ffmpegjpegwriter.c.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....

General information

  • Device: OBS Build Service
  • OS: Fedora 39/40
  • Version of the App: 5.2.4
  • Version of the SDK: corresponding (=5.3.37)

Expected behaviour

Successful packaging expected.

To Reproduce

  1. Go to mediastreamer2 package
  2. Compile.

Additional context

Add any other context about the problem here.

SDK logs URL

No response

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.