Comments (18)
The answer is I don't know. I'm yet to try it.
From a 2 second Google search it seems like Xamarin.Anrdoid + FFmpeg should work. Xamarin.iOS + FFmpeg seems possible but trickier.
I have been able to deploy the XamarinForms example app to my iPhone. So if you do try with iOS and get stuck on a programming issue I can at least look into it.
from sipsorcerymedia.ffmpeg.
So Seems worth to try at least . I'll on it. danke~
from sipsorcerymedia.ffmpeg.
What's your goal with using FFmpeg on Android? Video encoding? Or do you need to hook into the audio/video devices as well?
I've been playing around with Xamarin Android a bit and it seems that native libraries can be bundled into the application relatively painlessly. The painful bit seems to be building the native libraries but I suspect once it's been done once it's straight foward. If you're only need video encoding then building libvpx
for Android and using SIPSorceryMedia.Encoders could be easier than the FFmpeg route.
from sipsorcerymedia.ffmpeg.
Yes, this goal is Video encoding, And seems need to play such as rtp, rtsp, sdp straightly. The best result is just using Xamarin Forms , I can run it both on iOS and Android.
Is you said SIPSorceryMedia.Encoders
is same sort of SIPSorceryMedia.FFmpeg
? And I just need to use only one of them ?there be OK?
Yes if Android can run with this way, I want check iOS much be curious.
thanks for you kind note.~
from sipsorcerymedia.ffmpeg.
The encoding and device integration with sipsorcery is a bit convoluted. This is due to the lack of available C# libraries to do either of those things and where they are available not in a cross platform manner.
The current situation is:
sipsorcerymedia.encoders
: wrapper for libvpx (video encoding) including win x64 native libvpx dll.sipsorcerymedia.ffmpeg
: wrapper for ffmpeg libraries (audio and video encoding + more) with included win x86 and x64 dll's BUT also with the ability to use FFmpeg dll's on Linux and macOS. Not tested on Android or iOS.sipsorcerymedia.windows
: hooks into WinRT media controls for webcam capture.
Ultimately the plan is to get rid of sipsorcerymedia.encoders
and replace it with a C# port of libvpx or a H264 encoder but I have no idea if/when that will happen.
After that different solutions will still be required for using webcam and audio devices on each platform in the same way sipsorcerymedia.windows
currently facilitates.
from sipsorcerymedia.ffmpeg.
Can we build servals ffmpeg
of all platforms. I still think is encoding task is almost nothing to do with C# libraries.
It's all work for platform's ffmpeg
guy.
So I like sipsorcerymedia.ffmpeg
a little more.
And perhaps this repo called FFmpeg.AutoGen
seems can not satisfied for sipsorcerymedia.ffmpeg
well with all platforms, specially arm gang.
If things allowed, I choose to deny him. Just play with C# Strings to running ffmpeg
.
eg:
First build all platfroms ffmpeg
stuff into dist.
Then If a app worked on android-arm and android-x86. We run two different command for that.
for android-x86 /bin/x86/ffplay audio.wav
for android-arm /bin/arm64/ffplay audio.wav
If you want to, PLZ teach me about this point's problem. Will Much thanks for that.
from sipsorcerymedia.ffmpeg.
Can we build servals ffmpeg of all platforms.
It's possible but over time would end up being a big maintenance burden. Anytime a native library is required cross platform support can quickly spiral out of control...
- win_x64, win_x86, win_arm64, macos_x64 (macos_arm64 coming), linux_x64 and then all the different IOS and Android versions.
FFmpeg does have an advantage that it can be installed independently as a separate package on a number of OS thereby removing the need for packaging native libraries. Like any software the FFmpeg library will also change over time so there;s maintenance involved.
I still think is encoding task is almost nothing to do with C# libraries.
There are no free or opensource C# VP8
or H264
libraries that I know of. But that doesn't mean it's not suitable. I actually think C# would be fine for video encoding in client applications where there are likely to be a small number of streams.
I'm leaning towards spending time trying to port libvpx
or openh264
rather than doing more native library builds and wrappers...
from sipsorcerymedia.ffmpeg.
So this is bit like Game Theory :(
If some hard device just only use HEVC , I need to set it into somebody like ffmpeg
to encoding new stuff out for SIP.
Suppose I insist opinion of my words. Everything I need is just SIPSorceryMedia.Abstractions
Right?
I know nothing about codec, So Next counting on you! thank!
from sipsorcerymedia.ffmpeg.
If some hard device just only use HEVC , I need to set it into somebody like ffmpeg to encoding new stuff out for SIP.
To support a wide range of codecs, especially video ones, native wrappers are the only viable option. Of the native libraries FFmpeg is one of the best, if not the best, option since it wraps up a bunch of other libraries in a consistent interface.
For Android and/or iOS if you can work out how to get FFmpeg installed then it shouldn't be too much of a leap to use this SIPSorceryMedia.FFmpeg
library to use the install for VP8 and H264 encoding and decoding.
Suppose I insist opinion of my words. Everything I need is just SIPSorceryMedia.Abstractions Right?
If your question is:
If I want to write an audio or video endpoint to work with the main SIPSorcery library are all the required interfaces to implement in
SIPSorceryMedia.Abstractions
.
The answer is yes. The SIPSorceryMedia.Abstractions
package has been designed to be the interface between the main library and audio/video capabilities.
from sipsorcerymedia.ffmpeg.
This Month I got a big sick until last day. Sorry about the late comment.
Two things.
- How to build a URI about
rtp://
orrtcp://
. I see there is a demo namedwebrtc-to-ffplay
. But there is just build asdp
file and no any uri. I want to makewebrtc-to-uri
. Could U give me some suggest with it? - My
OnRtpPacketReceived => RTPPacket.PayloadType
is always equals111
, Is this normally? I think some lib even used followrfc3551
still can not recognize dynamic value111
.
This day I find Android And iOS both have MediaCodec
, But it's basically. I want try them without any ffmpeg
first.
from sipsorcerymedia.ffmpeg.
How to build a URI about rtp:// or rtcp://. I see there is a demo named webrtc-to-ffplay. But there is just build a sdp file and no any uri. I want to make webrtc-to-uri. Could U give me some suggest with it?
FFmpeg
supports the rtp
scheme (nothing supports the rtcp
scheme it's part of RTP, did you mean rtsp
?). But to be able to consume an RTP stream you need to know what the payload ID's correspond to. RTP does not have any way to negotiate media formats etc. That's where the SDP file comes in.
Unfortunately FFmpeg
does not support WebRTC so you won't be able to use it directly without some sort of bridge application along the lines of my demos. You could try gstreamer
instead. It's supposed to be very similar to FFmpeg
and does support WebRTC. I don't have any experience using it yet.
My OnRtpPacketReceived => RTPPacket.PayloadType is always equals 111, Is this normally? I think some lib even used follow rfc3551 still can not recognize dynamic value 111.
It's probably OPUS
and yes dynamic payload ID's are perfectly normal and part of the standard. That's what you need the SDP exchange for. Each peer needs to know what the dynamic payload ID's correspond to and then use them to negotiate common formats.
from sipsorcerymedia.ffmpeg.
It has never occurred to me that play a SDP file is such complex.
First, Try Xamarin Android SDK Codec
;
Second, Try gradle lib org.webrtc:google-webrtc
of Native Java;
Third, Try gstreamer
beyond FFMPEG
;
Seems It is a long way to finish this. thanks for reply.
Could I build a rtsp stream (Such as rtsp://locahost:port/video.sdp
) with method CreateRtpSession
from sipsorcerymedia.ffmpeg.
So this is My time midnight 2:00. I am so excitedly to tell U.
The WebRTC RTP Media channel of Xamarin-Android is complete to connecting without any FFMPEG, GStreamer or Native WebRTC Java codes.
It just use a nuget package called VLC. No more.
Soon if you want have some information. tell me yet.
Deeply Thanks of all your kind helps.
from sipsorcerymedia.ffmpeg.
Wow that's big news. I'd love to see how you've done it!
from sipsorcerymedia.ffmpeg.
https://github.com/CCMeta/Xamarin-Forms-demo
To run this demo and you will see every code of this.
This demo is so unfunctional and can not make RTC offer to sth.
You need to open https://shadow-board.ccmeta.com/web-rtc-canvas-with-css.html to make a RTC offer to Xamarin android.
When RTC connection status is OnRTPPacket it will CreateLocalRTPSession like your code ffmpeg.
Then to Click a start button on Android UI. The audio will come out.
I just write Xamarin receive audio from other client. So you need to open web-rtc-canvas-with-css.html with microphone.
This demo is a shack. Just want to show you the Core Point is nuget package LibVLC.
Just two folders are necessary. Xamarin-Forms-demo
and Xamarin-Forms-demo.Android
from sipsorcerymedia.ffmpeg.
If I understand your code correctly what you're doing is:
- Establish a WebRTC connection with a remote peer,
- On each peer your forward the RTP packets you receive from the remote WebRTC peer to a local (loopback) RTPSession that sends to a local instance of VLC player,
- The VLC player control takes care of decoding and renders the audio and video.
Does the information below represent what you're doing?
Browser Sending:
Canvas (video)/Microphone -> RTCPeerConnection (javascript) -> network
Android Receiving:
network -> RTCPeerConnection (C#) -> RTPSession -> VLC player
That's a neat trick with the loopback RTPSession
to VLC player.
from sipsorcerymedia.ffmpeg.
Yes. Absolutely like as your words.
I wonder LibVLC can do lot things. Such as decoding, renders, convert and more.
In my information and mind. This package should work on all kinds of platform.
At beginning I guess it has a lag at decode step. Not so 'Real-time'.
But now it runs well enough. Delay = 100ms or so.
I think there is nothing I can do for this Lib, But I want to. :)
Thanks your help. I'll close this.
from sipsorcerymedia.ffmpeg.
It is worth noting that the vlc and FFmpeg do have a lot in common and I believe wrap up a lot of the same native codec libraries.
vlc
is designed to be a media player while FFmpeg
is designed to be a general purpose library. vlc
does use some of the FFmpeg
modules.
from sipsorcerymedia.ffmpeg.
Related Issues (20)
- Attempted to read or write protected memory. This is often an indication that other memory is corrupt.” HOT 1
- Is there any way to show SIPSorceryMedia.Abstractions.RawImage in a cross-platform (Win, Mac, Linux) App HOT 1
- Switch file source in ffmpeg HOT 4
- Where to get FFmpeg binaries for arm64 Linux build? Readme outdated HOT 1
- Is there any way to quite from ffmpeg or clear the memory HOT 2
- OnVideoSourceRawSampleFaster event is not firing on Linux (Ubuntu 22.04)
- Issue with FFmpegFileSource OnVideoSourceRawSampleFaster HOT 3
- Cannot access file path on MacOS HOT 6
- System.NotSupportedException: Specified method is not supported. Since 5b2dbe2dabef1131f214632346bde2ada9f8e229 HOT 3
- SDL2 CRASHES WHEN CALL HOT 2
- Simulcast Video Display Issue with SipSorcery in Janus Media Server Setup HOT 2
- h264 encoding not working HOT 3
- In Ubuntu, I am getting Error: octl(VIDIOC_G_INPUT): Inappropriate ioctl for device HOT 1
- External camera not working in mac
- Getting distorted image after converting RawImage to System.Drawing.Bitmap HOT 13
- Initialize: Method not supported HOT 5
- Getting distorted images - possible error in decoder format? HOT 3
- FFmpeg path in docker container? HOT 1
- Mixed video codecs. H264 and VP8 HOT 1
- How to initialize FFmpeg in .NET MAUI-Windows HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sipsorcerymedia.ffmpeg.