Gcore named a Leader in the GigaOm Radar for AI Infrastructure!Get the report
  1. Home
  2. Blog
  3. How to create a mobile streaming app on Android
Network
Developers

How to create a mobile streaming app on Android

  • June 9, 2022
  • 6 min read
How to create a mobile streaming app on Android

Livestreaming from mobile devices allows you to connect with your audience, wherever you are. Services that provide such an opportunity are very popular and used in various fields.

In this article, we will take a closer look at how to create your own application for mobile streaming and watching livestreams on Android, as well as how to integrate it with Gcore Streaming Platform.

Mobile livestreaming with Gcore Streaming Platform

Streaming protocols

Streaming protocols are used to send video and audio over public networks. One of the most popular streaming protocols is RTMP. It is supported by most streaming platforms. RTMP is reliable and perfect for livestreaming due to its low latency and retransmission of data packets based on the TCP protocol.

To distribute and play content on users’ devices, streaming platforms offer the popular and scalable broadcast HLS and DASH formats. In addition, Android devices are equipped with a native MediaPlayer that supports HLS playback. That is why we will focus on this particular protocol.

Selecting a library to create an RTMP stream

There are few open-source solutions for RTMP streaming from Android devices and even fewer truly functional options. Let’s take a look at some of them.

1. rtmp-rtsp-stream-client-java

Pros:

  • New, constantly updated library
  • Minimum API 16 support
  • Camera and Camera2 API support
  • Camera switching during streaming
  • Adaptive bitrate
  • Audio and video activation/deactivation during streaming
  • Possibility to configure broadcasting parameters
  • Installation of OpenGL filters, images, GIFs, or text in real-time
  • Easy to use: Everything works out of the box, without any additional manipulations
  • Availability of documentation and instructions for the library on GitHub
  • Convenient library import via Gradle

Cons:

  • Pause function for a broadcast stream is not available

2. HaishinKit

Pros:

  • Stable updates
  • Supports RTMP playback
  • Uses the current Camera2 API
  • Supports camera switching during streaming
  • Allows you to configure broadcasting parameters

Cons:

  • Adaptive bitrate option is not available
  • Pause function for a broadcast stream is not available

3. LiveVideoBroadcaster

Pros:

  • Minimum API 28 support
  • Camera switching during streaming
  • Adaptive stream quality (frame rate and bit rate)
  • Audio activation/deactivation during streaming

Cons:

  • Out of date: last commit on July 28, 2020
  • Uses outdated Camera API
  • No library import via Gradle
  • Much more complex than rtmp-rtsp-stream-client-java
  • Frames sent by the library contain errors (DC, AC, MV)

To summarize, rtmp-rtsp-stream-client-java has the most advantages and the fewest disadvantages of all the three options. Therefore, we consider this library to be the most suitable solution.

Streaming implementation via RTMP protocol from an Android smartphone

The rtmp-rtsp-stream-client-java library provides two types of objects for streaming—RtmpCamera1 and RtmpCamera2. The former uses Camera API to capture the stream from your smartphone camera, while the latter uses Camera2 API.

We recommend using RtmpCamera2, as Camera API has been obsolete since Android API level 21. Our example uses the up-to-date RtmpCamera2.

We will now take a step-by-step look at how to use the rtmp-rtsp-stream-client-java library for mobile streaming. But first, let’s briefly review how it works.

  • When the rtmpCamera2.startPreview() method is called, the camera is captured.
  • The captured camera session is sent to the OpenGlView input, where it is displayed to the user.
  • When the rtmpCamera2.startStream() method is called, a connection to the remote server is established.
  • The captured session from the camera is transmitted via the RTMP protocol to the specified rtmpUrl.

Now let’s take a step-by-step look at how to organize online mobile streaming.

1. Init

To use the rtmp-rtsp-stream-client-java library in your project, you need to add dependencies to build.gradle:

Plaintext
allprojects { repositories { maven { url ’https://jitpack.io’ } }}dependencies { implementation ’com.github.pedroSG94.rtmp-rtsp-stream-client- java:rtplibrary:2.1.7’}

Current library version

2. Permissions

Specify the required permissions in the AndroidManifest.xml file:

Plaintext
<uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><uses-permission android:name="android.permission.CAMERA"/><uses-permission android:name="android.permission.RECORD_AUDIO"/>

3. Displaying the camera stream

When streaming from a smartphone camera, you need to see what is being broadcast. For this purpose, a corresponding View will display the camera stream on the screen. Android uses SurfaceView or TextureView. The used library also has its own OpenGlView that is inherited from SurfaceView.

With RtmpCamera1 you can use any of these Views, while only OpenGlView is available with RtmpCamera2. But among all Views, only OpenGlView allows you to use various filters, images, GIFs, or text during streaming.

Add OpenGlView to Layout Activity or Fragment to see the camera stream:

Plaintext
<com.pedro.rtplibrary.view.OpenGlView android:id="@+id/openGlView" android:layout_width="match_parent" android:layout_height="match_parent" android:keepScreenOn="true" android:visibility="gone" app:keepAspectRatio="true" app:aspectRatioMode="adjust"/>

4. Preparing for streaming

To initialize the RtmpCamera2 object, you need the OpenGlView object and the ConnectCheckerRtmp interface implementation:

Plaintext
private val connectCheckerRtmp = object : ConnectCheckerRtmp { override fun onAuthErrorRtmp() { _toastMessageId.postValue(R.string.auth_error) } override fun onAuthSuccessRtmp() { _toastMessageId.postValue(R.string.auth_success) } override fun onConnectionFailedRtmp(reason: String) { _toastMessageId.postValue(R.string.connection_failed) stopBroadcast() } override fun onConnectionStartedRtmp(rtmpUrl: String) {} override fun onConnectionSuccessRtmp() { _toastMessageId.postValue(R.string.connection_success) _streamState.postValue(StreamState.PLAY) } override fun onDisconnectRtmp() { _toastMessageId.postValue(R.string.disconnected) _streamState.postValue(StreamState.STOP) } override fun onNewBitrateRtmp(bitrate: Long) {}}

To use the adaptive bitrate, make some additions to the implementation of this interface:

Plaintext
//... private lateinit var bitrateAdapter: BitrateAdapter override fun onConnectionSuccessRtmp() { bitrateAdapter = BitrateAdapter { bitrate -> rtmpCamera2?.setVideoBitrateOnFly(bitrate) }.apply { setMaxBitrate(StreamParameters.maxBitrate) } _toastMessageId.postValue(R.string.connection_success) _currentBitrate.postValue(rtmpCamera2?.bitrate)_streamState.postValue(StreamState.PLAY) } //... override fun onNewBitrateRtmp(bitrate: Long) { bitrateAdapter.adaptBitrate(bitrate) _currentBitrate.postValue(bitrate.toInt()) disableStreamingAfterTimeOut() }

Add a callback to the OpenGlView object. The callback methods will be used to start and stop the camera preview:

Plaintext
private val surfaceHolderCallback = object : SurfaceHolder.Callback { override fun surfaceCreated(holder: SurfaceHolder) { rtmpCamera2?.startPreview( StreamParameters.resolution.width, StreamParameters.resolution.height ) } override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {} override fun surfaceDestroyed(holder: SurfaceHolder) { rtmpCamera2?.stopPreview() } }binding.openGlView.holder.addCallback(surfaceHolderCallback)

Create the RtmpCamera2 object that will be used for streaming:

Plaintext
rtmpCamera2 = RtmpCamera2(openGlView, connectCheckerRtmp)

5. Launching and stopping a livestream

Set the video and audio parameters, and launch the livestream.

Livestream with default parameters:

Plaintext
fun startBroadcast(rtmpUrl: String) { rtmpCamera2?.let { if (!it.isStreaming) { if (it.prepareAudio() && it.prepareVideo()) { _streamState.value = StreamState.PLAY it.startStream(rtmpU } else { _streamState.value = StreamState.STOP_toastMessageId.value = R.string.error_preparing_stream } } }}

Livestream with custom parameters:

Plaintext
fun startBroadcast(rtmpUrl: String) { val audioIsReady = rtmpCamera2.prepareAudio( StreamParameters.audioBitrate, StreamParameters.sampleRate, StreamParameters.isStereo, StreamParameters.echoCanceler, StreamParameters.noiseSuppressor ) val videoIsReady = rtmpCamera2.prepareVideo( StreamParameters.resolution.width, StreamParameters.resolution.height, StreamParameters.fps, StreamParameters.startBitrate, StreamParameters.iFrameIntervalInSeconds, CameraHelper.getCameraOrientation(getApplication()) ) rtmpCamera2?.let { if (!it.isStreaming) { if (audioIsReady && videoIsReady) { _streamState.value = StreamState.PLAY it.startStream(rtmpU } else { _streamState.value = StreamState.STOP _toastMessageId.value = R.string.error_preparing_stream } } }}

Stopping the stream:

Plaintext
fun stopBroadcast() { rtmpCamera2?.let { if (it.isStreaming) { _streamState.value = StreamState.STOP it.stopStream() } }}

Integration with Gcore Streaming Platform

Creating a Gcore account

To integrate the streaming platform into the project, you need to create a free Gcore account with your email and password.

Activate the service by selecting Free Live or any other suitable plan.

To interact with Gcore Streaming Platform, we will use Gcore API. We will execute requests using Retrofit together with RxJava. But you can use any other method of sending HTTP requests if you want.

Authorization

Log in to start working with API. Use the email and password specified during registration to receive the Access Token, which you will need for further requests.

Plaintext
class AuthRequestBody( @SerializedName("username") val eMail: String, @SerializedName("password") val password: String,@SerializedName("one_time_password") val oneTimePassword: String = "authenticator passcode")interface AuthApi { @POST("./auth/jwt/login") fun performLogin(@Body body: AuthRequestBody): Single<AuthResponse>}private fun auth(eMail: String, password: String) { val requestBody = AuthRequestBody(eMail = eMail, password = password) compositeDisposable.add( (requireActivity().application as GCoreApp).authApi .performLogin(requestBody) .subscribeOn(Schedulers.computation()) .observeOn(AndroidSchedulers.mainThread()) .auth(requireActivity(), requestBody) .subscribe({ authResponse ->showToast(R.string.logged_success) saveAuthData(requestBody, authResponse) routeToStreams() }, { showToast(R.string.logged_fail) }) )}

Getting PUSH URL

There are two ways to get the URL for sending the RTMP stream:

Method 1. Send a Get all live streams request to get all livestreams. As a response, we will receive data on all streams created in your account.

An example of sending a request:

Plaintext
interface StreamsApi { /** * @param page integer; Query parameter. Use it to list the paginated content * @param with_broadcasts integer; Query parameter. * Set to 1 to get details of the broadcasts associated with the stream */ @GET("./vp/api/streams") fun getStreams( @Header("Authorization") accessToken: String, @Query("page") page: Int, @Query("with_broadcasts") withBroadcasts: Int = 1 ): Single<List<StreamItemResponse>> //...}private fun loadStreamItems(page: Int = 1) { val accessToken = getAccessToken() var currentPage = page if (currentPage == 1) { streamItems.clear() } compositeDisposable.add( (requireActivity().application as GCoreApp).streamsApi .getStreams("Bearer $accessToken", page = currentPage) .subscribeOn(Schedulers.computation()) .observeOn(AndroidSchedulers.mainThread()) .subscribe({ if (it.isNotEmpty()) { it.forEach { streamItemResponse -> streamItems.add(StreamItemModel.getInstance(streamItemResponse)) } loadStreamItems(page = ++currentPage) } else { updateDataInAdapter() } }, { it.printStackTrace() }) )}

Method 2. Send a Get live stream request to get a particular livestream. As a response, we will receive data only on the requested stream, if such stream exists.

An example of sending a request:

Plaintext
interface StreamsApi { //... @GET("/vp/api/streams/{stream_id}") fun getStreamDetailed( @Header("Authorization") accessToken: String, @Path("stream_id") streamId: Int ): Single<StreamDetailedResponse> //...}private fun getStreamDetailedInfo(streamId: Int) { val accessToken = getAccessToken() compositeDisposable.add( (requireActivity().application as GCoreApp).streamsApi .getStreamDetailed("Bearer $accessToken", streamId) .subscribeOn(Schedulers.computation()) .observeOn(AndroidSchedulers.mainThread()) .subscribe({ streamDetailedInfo -> //... }, { it.printStackTrace() }) )}

From the responses to these requests, we get a push_url and use it as the URL for sending the RTMP stream. Once the stream begins, the broadcast will start automatically. Select the required stream in your personal account. You can use the preview before publishing the stream to your website or player.

Active stream playback

With Gcore Streaming Platform, you can broadcast streams on third-party resources in various formats, including HLS.

In our example, we will not consider simultaneous streaming and playback on one device. Instead, streaming should be launched from any other device.

To play the active stream, use the standard Android MediaPlayer. If you want to have more control over the stream and the ability to customize the player, we recommend using ExoPlayer.

On-screen display

To display the video stream on the smartphone screen, VideoView is required. It should be added to the Layout Activity or Fragment where you plan to play the stream:

Plaintext
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="@color/black" android:id="@+id/streamPlayer" tools:context=".screens.StreamPlayerFragment"> <VideoView android:id="@+id/videoView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center"/> ...</FrameLayout>

Starting playback

Before playing, the hls_playlist_url of the active stream should be embedded in the player during its initialization. hls_playlist_url is returned in the response to the Get livestream request mentioned above.

Player initialization:

Plaintext
private fun initializePlayer(streamUri: String) { val videoView = binding.videoView videoView.setVideoURI(Uri.parse(streamUri)) val mediaController = MediaController(videoView.context) mediaController.setMediaPlayer(videoView) videoView.setMediaController(mediaController) videoView.setOnPreparedListener { binding.progressBar.visibility = View.GONE videoView.start() } videoView.setonerrorListener(mediaPlayeronerrorListener)}

Once the initialization is complete, start playback by calling the videoView.start() method.

Launching the player:

Plaintext
private fun releasePlayer() { binding.videoView.stopPlayback()}

Summary

Using our examples, organizing a livestream in an Android application is quite simple and does not take much time. All you need is the open-source rtmp-rtsp-stream-client-java library and our Streaming Platform.

Gcore streaming API

All the code mentioned in the article can be viewed on GitHub.

Related articles

How we engineered a single pipeline for LL-HLS and LL-DASH

Viewers in sports, gaming, and interactive events expect real-time, low-latency streaming experiences. To deliver this, the industry has rallied around two powerful protocols: Low-Latency HLS (LL-HLS) and Low-Latency DASH (LL-DASH).While they share a goal, their methods are fundamentally different. LL-HLS delivers video in a sequence of tiny, discrete files. LL-DASH delivers it as a continuous, chunked download of a larger file. This isn't just a minor difference in syntax; it implies completely different behaviors for the packager, the CDN, and the player.This duality presents a major architectural challenge: How do you build a single, efficient, and cost-effective pipeline that can serve both protocols simultaneously from one source?At Gcore, we took on this unification problem. The result is a robust, single-source pipeline that delivers streams with a glass-to-glass latency of approximately 2.0 seconds for LL-DASH and 3.0 seconds for LL-HLS. This is the story of how we designed it.Understanding the dualityTo build a unified system, we first had to deeply understand the differences in how each protocol operates at the delivery level.LL-DASH: the continuous feedMPEG-DASH has always been flexible, using a single manifest file to define media segments by their timing. Low-Latency DASH builds on this by using Chunked CMAF segments.Imagine a file that is still being written to on the server. Instead of waiting for the whole file to be finished, the player can request it, and the server can send it piece by piece using Chunked Transfer Encoding. The player receives a continuous stream of bytes and can start playback as soon as it has enough data.Single, long-lived files: A segment might be 2–6 seconds long, but it’s delivered as it’s being generated.Timing-based requests: The player knows when a segment should be available and requests it. The server uses chunked transfer to send what it has so far.Player-driven latency: The manifest contains a targetLatency attribute, giving the player a strong hint about how close to the live edge it should play.LL-HLS: the rapid-fire deliveryLL-HLS takes a different approach. It extends the traditional playlist-based HLS by breaking segments into even smaller chunks called Parts.Think of it like getting breaking news updates. The server pre-announces upcoming Parts in the manifest before they are fully available. The player then requests a Part, but the server holds that request open until the Part is ready to be delivered at full speed. This is called a Blocking Playlist Reload.Many tiny files (Parts): A 2-second segment might be broken into four 0.5-second Parts, each requested individually.Manifest-driven updates: The server constantly updates the manifest with new Parts, and uses special tags like #EXT-X-PART-INF and #EXT-X-SERVER-CONTROL to manage delivery.Server-enforced timing: The server controls when the player receives data by holding onto requests, which helps synchronize all viewers.A simplified diagram visually comparing the LL-HLS delivery of many small parts versus the LL-DASH chunked transfer of a single, larger segment over the same time period.These two philosophies demand different things from a CDN. LL-DASH requires the CDN to intelligently cache and serve partially complete files. LL-HLS requires the CDN to handle a massive volume of short, bursty requests and hold connections open for manifest updates. A traditional CDN is optimized for neither.Forging a unified strategyWith two different delivery models, where do you start? You find the one thing they both depend on: the keyframe.Playback can only start from a keyframe (or I-frame). Therefore, the placement of keyframes, which defines the Group of Pictures (GOP), is the foundational layer that both protocols must respect. By enforcing a consistent keyframe interval on the source stream, we could create a predictable media timeline. This timeline can then be described in two different “languages” in the manifests for LL-HLS and LL-DASH.A single timeline with consistent GOPs being packaged for both protocols.This realization led us to a baseline configuration, but each parameter involved a critical engineering trade-off:GOP: 1 second. We chose a frequent, 1-second GOP. The primary benefit is extremely fast stream acquisition; a player never has to wait more than a second for a keyframe to begin playback. The trade-off is a higher bitrate. A 1-second GOP can increase bitrate by 10–15% compared to a more standard 2-second GOP because you're storing more full-frame data. For real-time, interactive use cases, we prioritized startup speed over bitrate savings.Segment Size: 2 seconds. A 2-second segment duration provides a sweet spot. For LL-DASH and modern HLS players, it's short enough to keep manifest sizes manageable. For older, standard HLS clients, it prevents them from falling too far behind the live edge, keeping latency reduced even on legacy players.Part Size: 0.5 seconds. For LL-HLS, this means we deliver four updates per segment. This frequency is aggressive enough to achieve sub-3-second latency while being coarse enough to avoid overwhelming networks with excessive request overhead, which can happen with part durations in the 100–200ms range.Cascading challenges through the pipeline1. Ingest: predictability is paramountTo produce a clean, synchronized output, you need a clean, predictable input. We found that the encoder settings of the source stream are critical. An unstable source with a variable bitrate or erratic keyframe placement will wreck any attempt at low-latency delivery.For our users, we recommend settings that prioritize speed and predictability over compression efficiency:Rate control: Constant Bitrate (CBR)Keyframe interval: A fixed interval (e.g., every 30 frames for 30 FPS, to match our 1s GOP).Encoder tune: zerolatencyAdvanced options: Disable B-frames (bframes=0) and scene-cut detection (scenecut=0) to ensure keyframes are placed exactly where you command them to be.Here is an example ffmpeg command in Bash that encapsulates these principles:ffmpeg -re -i "source.mp4" -c:a aac -c:v libx264 \ -profile:v baseline -tune zerolatency -preset veryfast \ -x264opts "bframes=0:scenecut=0:keyint=30" \ -f flv "rtmp://your-ingest-url"2. Transcoding and packagingOur transcoding and Just-In-Time Packaging (JITP) layer is where the unification truly happens. This component does more than just convert codecs; it has to operate on a stream that is fundamentally incomplete.The primary challenge is that the packager must generate manifests and parts from media files that are still being written by the transcoder. This requires a tightly-coupled architecture where the packager can safely read from the transcoder's buffer.To handle the unpredictable nature of live sources, especially user-generated content via WebRTC, we use a hybrid workflow:GPU Workers (Nvidia/Intel): These handle the heavy lifting of decoding and encoding. Offloading to GPU hardware is crucial for minimizing processing latency and preserving advanced color formats like HDR+.Software Workers and Filters: These provide flexibility. When a live stream from a mobile device suddenly changes resolution or its framerate drops due to a poor connection, a rigid hardware pipeline would crash. Our software layer can handle these context changes gracefully, for instance, by scaling the erratic source and overlaying it on a stable, black-background canvas, meaning the output stream never stops.This makes our JITP a universal packager, creating three synchronized content types from a single, resilient source:LL-DASH (CMAF)LL-HLS (CMAF)Standard HLS (MPEG-TS) for backward compatibility3. CDN delivery: solving two problems at onceThis was the most intensive part of the engineering effort. Our CDN had to be taught how to excel at two completely different, high-performance tasks simultaneously.For LL-DASH, we developed a custom caching module we call chunked-proxy. When the first request for a new .m4s segment arrives, our edge server requests it from the origin. As bytes flow in from the origin, the chunked-proxy immediately forwards them to the client. When a second client requests the same file, our edge server serves all the bytes it has already cached and then appends the new bytes to both clients' streams simultaneously. It’s a multi-client cache for in-flight data.For LL-HLS, the challenges were different:Handling Blocked Requests: Our edge servers needed to be optimized to hold thousands of manifest requests open for hundreds of milliseconds without consuming excessive resources.Intelligent Caching: We needed to correctly handle cache statuses (MISS, EXPIRED) for manifests to ensure only one request goes to the origin per update, preventing a "thundering herd" problem.High Request Volume: LL-HLS generates a storm of requests for tiny part-files. Our infrastructure was scaled and optimized to serve these small files with minimal overhead.The payoff: ultimate flexibility for developersThis engineering effort wasn't just an academic exercise. It provides tangible benefits to developers building with our platform. The primary benefit is simplicity through unification, but the most powerful benefit is the ability to optimize for every platform.Consider the complex landscape of Apple devices. With our unified pipeline, you can create a player logic that does this:On iOS 17.1+: Use LL-DASH with the new Managed Media Source (MMS) API for ~2.0 second latency.On iOS 14.0 - 17.0: Use native LL-HLS for ~3.0 second latency.On older iOS versions: Automatically fall back to standard HLS with a reduced latency of ~9 seconds.This lets you provide the best possible experience on every device, all from a single backend and a single live source, without any extra configuration.Don't fly blind: observability in a low-latency worldA complex system is useless without visibility, and traditional metrics can be misleading for low-latency streaming. Simply looking at response_time from a CDN log is not enough.We had to rethink what to measure. For example:For an LL-HLS manifest, a high response_time (e.g., 500ms) is expected behavior, as it reflects the server correctly holding the request while waiting for the next part. A low response_time could actually indicate a problem. We monitor “Manifest Hold Time” to ensure this blocking mechanism is working as intended.For LL-DASH, a player requesting a chunk that isn't ready yet might receive a 404 Not Found error. While occasional 404s are normal, a spike can indicate origin-to-edge latency issues. This metric, combined with monitoring player liveCatchup behavior, gives a true picture of stream health.Gcore: one pipeline to serve them allThe paths of LL-HLS and LL-DASH may be different, but their destination is the same: real-time interaction with a global audience. By starting with a common foundation—the keyframe—and custom-engineering every component of our pipeline to handle this duality, we successfully solved the unification problem.The result is a single, robust system that gives developers the power of both protocols without the complexity of running two separate infrastructures. It’s how we deliver ±2.0s latency with LL-DASH and ±3.0s with LL-HLS, and it’s the foundation upon which we’ll build to push the boundaries of real-time streaming even further.

Gcore CDN updates: Dedicated IP and BYOIP now available

We’re pleased to announce two new premium features for Gcore CDN: Dedicated IP and Bring Your Own IP (BYOIP). These capabilities give customers more control over their CDN configuration, helping you meet strict security, compliance, and branding requirements.Many organizations, especially in finance and other regulated sectors, require full control over their network identity. With these new features, Gcore enables customers to use unique, dedicated IP addresses to meet compliance or security standards; retain ownership and visibility over IP reputation and routing, and deliver content globally while maintaining trusted, verifiable IP associations.Read on for more information about the benefits of both updates.Dedicated IP: exclusive addresses for your CDN resourcesThe Dedicated IP feature enables customers to assign a private IP address to their CDN configuration, rather than using shared ones. This is ideal for:Businesses that are subject to strict security or legal frameworks.Customers who want isolated IP resources to ensure consistent access and reputation.Teams using WAAP or other advanced security solutions where dedicated IPs simplify policy management.BYOIP: bring your own IP range to Gcore CDNWith Bring Your Own IP (BYOIP), customers can use their own public IP address range while leveraging the performance and global reach of Gcore CDN. This option is especially useful for:Resellers who prefer to keep Gcore infrastructure invisible to end clients.Enterprises maintaining brand consistency and control over IP reputation.How to get startedBoth features are currently available as paid add-ons and are configured manually by the Gcore team. To request activation or learn more, please contact Gcore Support or your account manager.We’re working on making these features easier to manage and automate in future releases. As always, we welcome your feedback on both the feature functionality and the request process—your insights help us improve the Gcore CDN experience for everyone.Get in touch for more information

Smart caching and predictive streaming: the next generation of content delivery

As streaming demand surges worldwide, providers face mounting pressure to deliver high-quality video without buffering, lag, or quality dips, no matter where the viewer is or what device they're using. That pressure is only growing as audiences consume content across mobile, desktop, smart TVs, and edge-connected devices.Traditional content delivery networks (CDNs) were built to handle scale, but not prediction. They reacted to demand, but couldn’t anticipate it. That’s changing.Today, predictive streaming and AI-powered smart caching are enabling a proactive, intelligent approach to content delivery. These technologies go beyond delivering content by forecasting what users will need and making sure it's there before it's even requested. For network engineers, platform teams, and content providers, this marks a major evolution in performance, reliability, and cost control.What are predictive streaming and smart caching?Predictive streaming is a technology that uses AI to anticipate what a viewer will watch next, so the content can be ready before it's requested. That might mean preloading the next episode in a series, caching popular highlights from a live event, or delivering region-specific content based on localized viewing trends.Smart caching supports this by storing that predicted content on servers closer to the viewer, reducing delays and buffering. Together, they make streaming faster and smoother by preparing content in advance based on user behavior.Unlike traditional caching, which relies on static popularity metrics or simple geolocation, predictive streaming is dynamic. It adapts in real time to what’s happening on the platform: user actions, traffic spikes, network conditions, and content trends. This results in:Faster playback with minimal bufferingReduced bandwidth and server loadHigher quality of experience (QoE) scores across user segmentsFor example, during the 2024 UEFA European Championship, several broadcasters used predictive caching to preload high-traffic game segments and highlight reels based on past viewer drop-off points. This allowed for instant replay delivery in multiple languages without overloading central servers.Why predictive streaming matters for viewersGlobally, viewers tend to binge-watch new streaming platform releases. For example, sci-fi-action drama Fallout got 25% of its annual US viewing minutes (2.9 billion minutes) in its first few days of release. The South Korean series Queen of Tears became Netflix's most-watched Korean drama of all time in 2024, amassing over 682.6 million hours viewed globally, with more than half of those watch hours occurring during its six-week broadcast run.A predictive caching system can take advantage of this launch-day momentum by pre-positioning likely-to-be-watched episodes, trailers, or bonus content at the edge, customized by region, device, or time of day.The result is a seamless, high-performance experience that anticipates user behavior and scales intelligently to meet it.Benefits for streaming providersTraditional CDNs often waste resources caching content that may never be viewed. Predictive caching focuses only on content that is likely to be accessed, leading to:Lower egress costsReduced server loadMore efficient cache hit ratiosOne of the core benefits of predictive streaming is latency reduction. By caching content at the edge before it’s requested, platforms avoid the delay caused by round-trips to origin servers. This is especially critical for:Live sports and eventsInteractive or real-time formats (e.g., polls, chats, synchronized streams)Edge environments with unreliable last-mile connectivityFor instance, during the 2024 Copa América, mobile viewers in remote areas of Argentina were able to stream matches without delay thanks to proactive edge caching based on geo-temporal viewing predictions.How it worksAt the core of predictive streaming is smart caching: the process of storing data closer to the end user before it’s explicitly requested. Here’s how it works:Data ingestion: The system gathers data on user behavior, device types, content popularity, and location-based trends.Behavior modeling: AI models identify patterns (e.g., binge-watching behaviors, peak-hour traffic, or regional content spikes).Pre-positioning: Based on predictions, the system caches video segments, trailers, or interactive assets to edge servers closest to where demand is expected.Real-time adaptation: As user behavior changes, the system continuously updates its caching strategy.Use cases across streaming ecosystemsSmart caching and predictive delivery benefit nearly every vertical of streaming.Esports and gaming platforms: Live tournaments generate unpredictable traffic surges, especially when underdog teams advance. Predictive caching helps preload high-interest match content, post-game analysis, and multilingual commentary before traffic spikes hit. This helps provide global availability with minimal delay.Corporate webcasts and investor events: Virtual AGMs or earnings calls need to stream seamlessly to thousands of stakeholders, often under compliance pressure. Predictive systems can cache frequently accessed segments, like executive speeches or financial summaries, at regional nodes.Education platforms: In EdTech environments, predictive delivery ensures that recorded lectures, supplemental materials, and quizzes are ready for users based on their course progression. This reduces lag for remote learners on mobile connections.VOD platforms with regional licensing: Content availability differs across geographies. Predictive caching allows platforms to cache licensed material efficiently and avoid serving geo-blocked content by mistake, while also meeting local performance expectations.Government or emergency broadcasts: During public health updates or crisis communications, predictive streaming can support multi-language delivery, instant replay, and mobile-first optimization without overloading networks during peak alerts.Looking forward: Personalization and platform governanceWe predict that the next wave of predictive streaming will likely include innovations that help platforms scale faster while protecting performance and compliance:Viewer-personalized caching, where individual user profiles guide what’s cached locally (e.g., continuing series, genre preferences)Programmatic cache governance, giving DevOps and marketing teams finer control over how and when content is distributedCross-platform intelligence, allowing syndicated content across services to benefit from shared predictions and joint caching strategiesGcore’s role in the predictive futureAt Gcore, we’re building AI-powered delivery infrastructure that makes the future of streaming a practical reality. Our smart caching, real-time analytics, and global edge network work together to help reduce latency and cost, optimize resource usage, and improve user retention and stream stability.If you’re ready to unlock the next level of content delivery, Gcore’s team is here to help you assess your current setup and plan your predictive evolution.Discover how Gcore streaming technologies helped fan.at boost subscription revenue by 133%

Protecting networks at scale with AI security strategies

Network cyberattacks are no longer isolated incidents. They are a constant, relentless assault on network infrastructure, probing for vulnerabilities in routing, session handling, and authentication flows. With AI at their disposal, threat actors can move faster than ever, shifting tactics mid-attack to bypass static defenses.Legacy systems, designed for simpler threats, cannot keep pace. Modern network security demands a new approach, combining real-time visibility, automated response, AI-driven adaptation, and decentralized protection to secure critical infrastructure without sacrificing speed or availability.At Gcore, we believe security must move as fast as your network does. So, in this article, we explore how L3/L4 network security is evolving to meet new network security challenges and how AI strengthens defenses against today’s most advanced threats.Smarter threat detection across complex network layersModern threats blend into legitimate traffic, using encrypted command-and-control, slow drip API abuse, and DNS tunneling to evade detection. Attackers increasingly embed credential stuffing into regular login activity. Without deep flow analysis, these attempts bypass simple rate limits and avoid triggering alerts until major breaches occur.Effective network defense today means inspection at Layer 3 and Layer 4, looking at:Traffic flow metadata (NetFlow, sFlow)SSL/TLS handshake anomaliesDNS request irregularitiesUnexpected session persistence behaviorsGcore Edge Security applies real-time traffic inspection across multiple layers, correlating flows and behaviors across routers, load balancers, proxies, and cloud edges. Even slight anomalies in NetFlow exports or unexpected east-west traffic inside a VPC can trigger early threat alerts.By combining packet metadata analysis, flow telemetry, and historical modeling, Gcore helps organizations detect stealth attacks long before traditional security controls react.Automated response to contain threats at network speedDetection is only half the battle. Once an anomaly is identified, defenders must act within seconds to prevent damage.Real-world example: DNS amplification attackIf a volumetric DNS amplification attack begins saturating a branch office's upstream link, automated systems can:Apply ACL-based rate limits at the nearest edge routerFilter malicious traffic upstream before WAN degradationAlert teams for manual inspection if thresholds escalateSimilarly, if lateral movement is detected inside a cloud deployment, dynamic firewall policies can isolate affected subnets before attackers pivot deeper.Gcore’s network automation frameworks integrate real-time AI decision-making with response workflows, enabling selective throttling, forced reauthentication, or local isolation—without disrupting legitimate users. Automation means threats are contained quickly, minimizing impact without crippling operations.Hardening DDoS mitigation against evolving attack patternsDDoS attacks have moved beyond basic volumetric floods. Today, attackers combine multiple tactics in coordinated strikes. Common attack vectors in modern DDoS include the following:UDP floods targeting bandwidth exhaustionSSL handshake floods overwhelming load balancersHTTP floods simulating legitimate browser sessionsAdaptive multi-vector shifts changing methods mid-attackReal-world case study: ISP under hybrid DDoS attackIn recent years, ISPs and large enterprises have faced hybrid DDoS attacks blending hundreds of gigabits per second of L3/4 UDP flood traffic with targeted SSL handshake floods. Attackers shift vectors dynamically to bypass static defenses and overwhelm infrastructure at multiple layers simultaneously. Static defenses fail in such cases because attackers change vectors every few minutes.Building resilient networks through self-healing capabilitiesEven the best defenses can be breached. When that happens, resilient networks must recover automatically to maintain uptime.If BGP route flapping is detected on a peering session, self-healing networks can:Suppress unstable prefixesReroute traffic through backup transit providersPrevent packet loss and service degradation without manual interventionSimilarly, if a VPN concentrator faces resource exhaustion from targeted attack traffic, automated scaling can:Spin up additional concentratorsRedistribute tunnel sessions dynamicallyMaintain stable access for remote usersGcore’s infrastructure supports self-healing capabilities by combining telemetry analysis, automated failover, and rapid resource scaling across core and edge networks. This resilience prevents localized incidents from escalating into major outages.Securing the edge against decentralized threatsThe network perimeter is now everywhere. Branches, mobile endpoints, IoT devices, and multi-cloud services all represent potential entry points for attackers.Real-world example: IoT malware infection at the branchMalware-infected IoT devices at a branch office can initiate outbound C2 traffic during low-traffic periods. Without local inspection, this activity can go undetected until aggregated telemetry reaches the central SOC, often too late.Modern edge security platforms deploy the following:Real-time traffic inspection at branch and edge routersBehavioral anomaly detection at local points of presenceAutomated enforcement policies blocking malicious flows immediatelyGcore’s edge nodes analyze flows and detect anomalies in near real time, enabling local containment before threats can propagate deeper into cloud or core systems. Decentralized defense shortens attacker dwell time, minimizes potential damage, and offloads pressure from centralized systems.How Gcore is preparing networks for the next generation of threatsThe threat landscape will only grow more complex. Attackers are investing in automation, AI, and adaptive tactics to stay one step ahead. Defending modern networks demands:Full-stack visibility from core to edgeAdaptive defense that adjusts faster than attackersAutomated recovery from disruption or compromiseDecentralized detection and containment at every entry pointGcore Edge Security delivers these capabilities, combining AI-enhanced traffic analysis, real-time mitigation, resilient failover systems, and edge-to-core defense. In a world where minutes of network downtime can cost millions, you can’t afford static defenses. We enable networks to protect critical infrastructure without sacrificing performance, agility, or resilience.Move faster than attackers. Build AI-powered resilience into your network with Gcore.Check out our docs to see how DDoS Protection protects your network

Introducing Gcore for Startups: created for builders, by builders

Building a startup is tough. Every decision about your infrastructure can make or break your speed to market and burn rate. Your time, team, and budget are stretched thin. That’s why you need a partner that helps you scale without compromise.At Gcore, we get it. We’ve been there ourselves, and we’ve helped thousands of engineering teams scale global applications under pressure.That’s why we created the Gcore Startups Program: to give early-stage founders the infrastructure, support, and pricing they actually need to launch and grow.At Gcore, we launched the Startups Program because we’ve been in their shoes. We know what it means to build under pressure, with limited resources, and big ambitions. We wanted to offer early-stage founders more than just short-term credits and fine print; our goal is to give them robust, long-term infrastructure they can rely on.Dmitry Maslennikov, Head of Gcore for StartupsWhat you get when you joinThe program is open to startups across industries, whether you’re building in fintech, AI, gaming, media, or something entirely new.Here’s what founders receive:Startup-friendly pricing on Gcore’s cloud and edge servicesCloud credits to help you get started without riskWhite-labeled dashboards to track usage across your team or customersPersonalized onboarding and migration supportGo-to-market resources to accelerate your launchYou also get direct access to all Gcore products, including Everywhere Inference, GPU Cloud, Managed Kubernetes, Object Storage, CDN, and security services. They’re available globally via our single, intuitive Gcore Customer Portal, and ready for your production workloads.When startups join the program, they get access to powerful cloud and edge infrastructure at startup-friendly pricing, personal migration support, white-labeled dashboards for tracking usage, and go-to-market resources. Everything we provide is tailored to the specific startup’s unique needs and designed to help them scale faster and smarter.Dmitry MaslennikovWhy startups are choosing GcoreWe understand that performance and flexibility are key for startups. From high-throughput AI inference to real-time media delivery, our infrastructure was designed to support demanding, distributed applications at scale.But what sets us apart is how we work with founders. We don’t force startups into rigid plans or abstract SLAs. We build with you 24/7, because we know your hustle isn’t a 9–5.One recent success story: an AI startup that migrated from a major hyperscaler told us they cut their inference costs by over 40%…and got actual human support for the first time. What truly sets us apart is our flexibility: we’re not a faceless hyperscaler. We tailor offers, support, and infrastructure to each startup’s stage and needs.Dmitry MaslennikovWe’re excited to support startups working on AI, machine learning, video, gaming, and real-time apps. Gcore for Startups is delivering serious value to founders in industries where performance, cost efficiency, and responsiveness make or break product experience.Ready to scale smarter?Apply today and get hands-on support from engineers who’ve been in your shoes. If you’re an early-stage startup with a working product and funding (pre-seed to Series A), we’ll review your application quickly and tailor infrastructure that matches your stage, stack, and goals.To get started, head on over to our Gcore for Startups page and book a demo.Discover Gcore for Startups

Introducing FastEdge Triggers: real-time edge logic

When you're building real-time applications, whether for streaming platforms, SaaS dashboards, or security-sensitive services, you need content that adapts on the fly. Blocking suspicious IPs, injecting personalized content, transforming media on the edge—these should be fast, scalable, and reliable.Until now, they weren't.Developers and technical teams often had to work across multiple departments to create brittle, hardcoded solutions. Each use case, like watermarking video or rewriting headers, required a custom integration. There was no easy way to run logic dynamically at the edge. That changes with FastEdge Triggers.Real-time logic, built into the edgeFastEdge Triggers let you execute custom serverless logic at key moments in the HTTP lifecycle:on_request_headerson_request_bodyon_response_headerson_response_bodyFastEdge is built on the proxy-wasm standard, making it easy to adapt existing proxy-wasm applications (e.g., for Envoy or Kong) for use with Gcore. These trigger types align directly with proxy-wasm conventions, meaning less friction for developers familiar with modern proxy architectures.This means that you can now:Authenticate users' tokens, such as JWTBlock access by IP, region, or user agentInject CSS, HTML, or JavaScript into responsesTransform images or convert markdown to HTML before deliveryAdd security tokens or watermarks to video contentRewrite or sanitize request headers and bodiesNo backend round-trips. No manual routing. Just real-time, programmable edge behavior, backed by Gcore's global infrastructure.While FastEdge enables instant logic execution at the edge, response-stage triggers (on_response_headers and on_response_body) naturally depend on receiving data from the origin before acting. Even so, transformations happen at the edge, reducing backend load and improving overall efficiency.Our architecture means that FastEdge logic is executed in ultra-low-latency environments, tightly coupled with CDN. Triggers can be layered across multiple stages of a request without performance degradation.Built for developersFastEdge Triggers were built to solve three core pain points for technical teams:Hard to scale: Custom logic used to require bespoke, team-specific workaroundsHard to maintain: Even single-team solutions became brittle without proper edge infrastructureLimited flexibility: Legacy CDN logic couldn't support complex, dynamic behaviorWith FastEdge, developers have full control: no DevOps bottlenecks, no workarounds, no compromises. Logic runs at the edge, not your origin, minimizing backend exposure. FastEdge apps execute in isolated, sandboxed environments, reducing the risk of vulnerabilities that might otherwise be introduced when logic runs on central infrastructure.How it works behind the scenesEach FastEdge application is written in Rust or AssemblyScript and connected to the HTTP request lifecycle through Gcore's configuration interface. Apps are linked to trigger types through the CDN resource settings page in the Gcore Customer Portal.Configuring FastEdge Triggers from the CDN resource settings screen in the Gcore Customer PortalHere's what happens under the hood:You assign a FastEdge app to a trigger point.Our Core Proxy detects that trigger and automatically routes execution through your custom logic.The result is returned before hitting cache or origin, modified, enriched, and secured.This flow is deeply integrated with our CDN, delivering minimal latency with zero friction.A sequence diagram showing how FastEdge Triggers works under the hood A real-life use case: markdown to HTML at the edgeHere's a real-world example that shows how FastEdge Triggers can power multi-step content transformation without a single backend server.One customer wanted to serve Markdown-based documentation as styled HTML, without spinning up infrastructure. Using this FastEdge app written in Rust, they achieved just that.The app listens at three trigger points: on_request_headers, on_response_headers, and on_response_bodyIt detects requests for .md files and converts them on the flyThe HTML is served directly via CDN, no origin compute requiredYou can see it live here:README renderedTerraform docs renderedThis use case showcases FastEdge's ability to orchestrate multi-stage logic at the edge: ideal for serverless documentation, lightweight rendering, or content transformation pipelines.Ready to build smarter at the edge?FastEdge Triggers are available now for all FastEdge customers. If you're looking to modernize your edge logic, simplify architecture, and ship faster with fewer backend dependencies, FastEdge is built for you.Reach out to your account manager or contact us to activate FastEdge Triggers in your environment.Try Fastedge Triggers

Subscribe to our newsletter

Get the latest industry trends, exclusive insights, and Gcore updates delivered straight to your inbox.