Comments (11)
So, if you look at Streamer.as and UniversalPlayer.as you'll notice I output my AVANE encode to tcp:127.0.0.1:1234. This is a tcp socket created in AIR. In Streamer.as is where I setup the socket and forward the byteArray via a dispatchEvent. I then consume this in ns.appendBytes.
So, FFmpeg can output to a Socket and it can also read in from a tcp socket!
You could create a socket in AIR. Send your raw video to say 127.0.0.1:1235.
This "url" tcp:127.0.0.1:1235 is your input into AVANE.
I struggled with how to get btyeArrays into/out of FFmpeg for weeks and then it dawned on me I could just use an AIR Socket :)
You might also be able to use a UDP socket (Datagram Socket) which in theory has less latency
from avane.
I don't have any immediate plans.
Android is not as straight forward. In fact, I didn't include Libavdevice is it refused to build for me for Android.
AS3 actually natively supports camera capture and encoding to FMS (or other rtmp server)
http://www.adobe.com/devnet/adobe-media-server/articles/encoding-live-video-h264.html
Never personally used it.
from avane.
Sad to hear :(
Unfortunately H264 encoding is not supported on mobile devices, only the old Sorenson Spark codec which can only be played back in a browser with Flash plugin. So it's a no-go
I'm looking for solutions since years now, it looks like I have to build this app in native android/java
Thanks anyway
from avane.
It might be best to use native functionality Android (ie MediaRecorder) which I imagine has HW acceleration, is easier to specify cameras etc.
You could wrap it in an ANE !
You could then even output it to Socket and send that into AVANE.
Always options
from avane.
You could then even output it to Socket and send that into AVANE.
Could you please explain this?
I might have access to raw video data in AIR, so if there's any other option to send the bytearray to some kind of a buffer which AVANE can work with would be nice
from avane.
sounds great, thanks
i'll give it a try
from avane.
Edit: Nevermind, I made a mistake by connecting twice to the same address. All okay now
It works from command line perfectly, I can stream the camera's rawvideo to ffmpeg and convert it to an mp4 file.
However if I start AVANE, the socket cannot write data ( ioError )
Here's a sample code:
ffmpeg -y -f rawvideo -pixel_format argb -video_size 160x120 -framerate 15 -i tcp://127.0.0.1:1235?listen=1 test.mp4
(works)
The same does not work with AVANE. Camera size, framerate, etc is all correct. Socket connection is made successfully, but the writing fails. Permissions are set properly, file and directory paths exist.
from avane.
I ran some tests, maybe you're interested:
On a 4 core cpu android device a 1280x720 live video capture is encoded at average 9 fps, a 640x360 can be encoded at 25 fps with the fastest possible encoding. So for now it remains only a tech demo, but good to see that it's working fine with tcp sockets and bytearray.
I might run another test with udp instead, but I don't expect much of an improvement
from avane.
so you got Sockets working ok?
I'm not very happy with the encoding speeds on Android.
I believe I need to re-compile FFmpeg libs with mediacodec to allow for Hardware Accelerated encoding.
CPU encoding is not perfomant on devices. The information is pretty thin on this, but will revisit when I get a chance.
from avane.
yep, i got sockets working
just the raw video data is too much: for a 1280x720p 25fps 4 channel raw video is 92MB data in each second to process. that's a liitle bit too much. and i also need to take care of buffering, tcp is easily get stuck, udp packets are much smaller so it takes more cpu to make the chunks, emptying the buffer if needed etc. it's not really worth the headache. and flash does not have any video encoding at all (only for netstreams but it's a different story). so for now it works, but not really a solution. i'll give other ffmpeg builds a try, i've seen some promising implementation of v4l2, but i think ultimately a native android app will be necessary
from avane.
And for the sockets:
you need to set ffmpeg tcp input to listen mode (to act as some sort of a socket server) and connect from Flash/AIR to that, and everything you send there will be processed and sent to the output. of course you need to tell ffmpeg which format should it expect, but this is the basic logic (see example above)
from avane.
Related Issues (20)
- InputOptions.vcodec HOT 3
- AVANE.swc bytecode error HOT 5
- UniversalPlayer failed to seek and play HOT 2
- AVANE Global Options Error HOT 19
- FFmpegEvent.ON_START or similar
- Weird error when starting AVANE the 2nd time HOT 6
- Trying to play hls stream on Android HOT 8
- Issue when converting consecutive files HOT 11
- ANE Error when building app in ios HOT 3
- can i get the data from encoding ? HOT 1
- Program crushed when call avane encode
- The extension context does not have a method with the name setLogLevel. HOT 6
- Extension XML is not present or is invalid HOT 2
- Audio - Wav to MP3 Conversion HOT 3
- WIN dll debug HOT 4
- multiple input video, multiple output screenshot HOT 4
- Adobe Animate CC
- Desktop capture HOT 1
- Incompatible with Windows 64 bits version
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 avane.