avformat_open_input returns -2 (Android) - android

I'm using this FFMPEG port for Android.
My Goal is to read RTSP stream eventually.
I can open a stream from a local file (located at "/storage/emulated/0/bunny.mp4") ,
using *avformat_open_input* function.
However when I try to open the same file from remote location like *"http_://192.168.1.183/bunny.mp4*" , it returns error -2 .
The whole cpp code is here.
Any ideas ?

Check if you have INTERNET permission in your manifest.
Also check that you are building ffmpeg with tcp and rtsp protocol enabled. And codecs enabled, too. I believe FFMPEG's configure prints this info when building and also it's in the build log.
Also, there's a FFMPEG function to print error message by code, don't remember the name though. So you can call it and see what -2 error means.
This here project has FFMPEG configured correctly https://github.com/dannoy/dolphin-player look in the p folder

Related

Unable to build GStreamer pipeline; no element x265enc in Android

I am trying to implement H265 using the x265enc encoder in an android application using GStreamer. I have constructed the pipeline which works when using the terminal and gst-launch-1.0 and videotestsrc. However, when trying to execute the pipeline in android it doesn't work and gives the error gst_error_factory_make: no such element factory "x265enc"! and is unable to build the pipeline due to the element x265enc missing.
I have installed plugins-bad (contains x265enc) on the computer and it is in the android.mk file. When I look in the plugins.mk file I don't see x265 mentioned anywhere (x264 is mentioned and x264enc works). Is this an issue? Is there another way to install x265enc so that android can recognize it?
try to install gst-plugins-ugly-1.0 and it will solve your issue

Error while compiling Web RTC for Android

I am developing app of video chat in Web RTC.
I am going through documentation of Web RTC.
I have followed all steps mentioned for Getting the Code
export GYP_DEFINES="OS=android"
fetch --nohooks webrtc_android
gclient sync
I have all src code of web rtc in my root directory. As per documentation say we have to compile source to use in our application. Here i got error while compiling source using following command.
$ gn gen out/Default --args='target_os="android" target_cpu="arm"'
ERROR at //build/config/android/internal_rules.gni:636:3: Can't load input file.
import("//third_party/ijar/ijar.gni")
^-----------------------------------
Unable to load:
/Users/c86/webrtc-checkout/src/third_party/ijar/ijar.gni
I also checked in the secondary tree for:
/Users/c86/webrtc-checkout/src/build/secondary/third_party/ijar/ijar.gni
See //build/config/android/rules.gni:8:1: whence it was imported.
import("//build/config/android/internal_rules.gni")
^-------------------------------------------------
See //webrtc/examples/BUILD.gn:12:3: whence it was imported.
import("//build/config/android/rules.gni")
^----------------------------------------
See //BUILD.gn:13:5: which caused the file to be included.
"//webrtc/examples",
^------------------
How can I solve this? Am I going in right direction to develop app of video chat on Web RTC?
Building WebRTC for Android is only supported on Ubuntu(14 / 16).
Currently not supported in macOS.

Webrtc peerconnection error in Android

Guys. I need some help with WebRTC. I am developing an Android app that streams from a Service to a AngularJS client using Node.Js and Express as a signaling server. And I am using libjingle packaged by pristine.
Every time I stop the peer from the client it gives me the following error:
09-10 01:43:06.161 5935-5935/org.myapp E/rtc﹕ #
# Fatal error in ../../talk/app/webrtc/java/jni/peerconnection_jni.cc, line 956
# Check failed: 0 == (reinterpret_cast<MediaStreamTrackInterface*>(j_p))->Release() (0 vs. 1)
# Unexpected refcount.
#
I have absolutely no idea of what's going. I have spoken with one developer from pristine and he said that this error is not really seen frequently.
Did anybody ever run into it?
Tracing back: The call site invokes CHECK_RELEASE, which verifies that the last reference is being released. So, it looks like you've got an extra reference to the MediaStreamTrackInterface.

How do I use gdata and save a file on QPython for android?

I am in the process of migrating my scripts from python SL4A to QPython (can't get SL4A to work on android lollipop).
I can't save a file to the disk
So I am using:
with open("foo.txt" ,"a") as f:
f.write(theInfo)
And I get
IOError: [Errno 30] Read-only file system: 'foo.txt'
I know what the error means, I just don't know where to save the file...
Thanks for the help,
marbs
The error is saying that you are in a protected part of a file system.
That means you may want to save the file in an un-protected part.
So, you may want to replace the "foo.txt" part with "/mnt/sdcard/foo.txt" or "/storage/sdcard0/foo.txt" or whatever is the path of internal storage on your phone.
Do you understand what am I saying?
Qpython has disabled writing to files, my recommendation is to find a different script interpreter like the inpython app on android, or the python module in Termux and run it from there.

Running ffmpeg command in Android gives Protocol not found error for image path

I am trying to use ffmpeg from Android command line to convert images into video. I have stored my sequence of images on sdcard. When I run ffmpeg command to convert images into video, ffmpeg command give me error Protocol not found.
My command is like this:
/data/data/package/files/ffmpeg -r 40 -qscale 2 -i /mnt/sdcard/images/img%d.jpg /mnt/sdcard/images/finalvideo.mp4
Error is like this /mnt/sdcard/vid.mp4: Protocol not found
I found the same error message mentioned in error.c file. But I am not getting the type of error and condition when it throws the error. Also when I run ffmpeg command i.e. ffmpeg -protocols from Android and Linux, the number of supported protocols are not same.
I found file and many protocols missing in Android.
Have a look this link: https://github.com/halfninja/android-ffmpeg-x264
I am not sure that you are using an NDK FFMPEG

Categories

Resources