0

With @rowntreerob's help, I have successfully built the FFMpeg for Android library / shared object for use in an Android application.

How do I capture the stdout or stderr messages issued as a result of running an FFMpeg command and display the messages in a TexView widget in the same Android application from which the FFMpeg command was issued?

Also when FFMPeg connects to (Wowza/Flash Media Server)- FMS, FMS issues CONNECTING, CONNECTED and STREAMING messages. How does one capture these messages and display them using Toast in the application from from which the FFMpeg command was issued.

Sample code will really help. TIA

user1545779
  • 468
  • 1
  • 5
  • 14
  • are you calling ffmpeg through curl command? – Avichal Badaya Aug 20 '12 at 03:13
  • @user1585811, thanks for your question. The ffmpeg command is not issued using curl. – user1545779 Aug 20 '12 at 15:55
  • then how are you calling it. can you share some code. – Avichal Badaya Aug 20 '12 at 16:00
  • Please see this link, [Link](https://github.com/rowntreerob/android-ffmpeg) for the ffmpeg -for android implementation done by @rowntreerob which show an excellent implementation. The ffmpeg command is issued through a jni function -run - written in C. – user1545779 Aug 20 '12 at 16:20
  • @user1585811 this is the code that issues the FFMpeg command:
    – user1545779 Aug 20 '12 at 16:30
  • @user1585811 I am having a problem copying and pasting the code in this window, the code is within this: _italic_ **bold** `@TargetApi(9) public void onMpegButton(View view) {` of the
    com/b2bpo/media/notes/RecorderActivity.java
    code. There is alot of code to paste here. Could I email you the pertinent issues I have directly? -f you do not mind
    – user1545779 Aug 20 '12 at 16:38
  • Alright, No Problem. I think there won't be any need for sending me the code. I will go though the link you provided and suggest you some solution. – Avichal Badaya Aug 20 '12 at 17:08

1 Answers1

1

/dev/null ususally gets the console output of dalvik.

you need to understand the file system , streams, redirecting ...

try reading here

Community
  • 1
  • 1
Robert Rowntree
  • 6,230
  • 2
  • 24
  • 43
  • now that i think about this, java layer is the wrong place to be doing this ... you probably want 'ffprobe' to use and to invoke in the c layer! ffprobe reflects/queries all the properties of the input files relevant to ops of ffmpeg. The output of ffprobe u can capture as long as u know enough c to be able to read stdout. – Robert Rowntree Aug 21 '12 at 21:46
  • @rowntreerob, thanks for your input. I am soliciting the help of another programmer more seasoned than me to help with this issue. Will let you know what he comes up with. I however have another ffmpeg related question arising from your implementation for you. I notice that your version does not build the alsa format which I need to use the mic of the webcam. Also when I remove disble-avdevice and disable-devices, ndk-build fails. This makes me think that the ndk-build has something to do with avdevice. I will paste the build log in a separate question since this box does cannot fit the log. – user1545779 Aug 23 '12 at 04:14
  • if u change the config and encounter errors, you should be looking first at the config.log in ./jni/ffmpeg. then use the V, B switches on $NDK/ndk-build in order to explore issues with that step. – Robert Rowntree Aug 23 '12 at 12:46