Page 1 of 1

Adding duplicate sout option to libvlc_instance on Android

Posted: 13 Mar 2013 00:59
by gregoiregentil
The following option:
--sout=#duplicate{dst=display,dst=standard{access=file,mux=ts,dst=go.mpg}}"
is working wel on Linux when reading an rtsp file. The stream is shown on screen and dumped on file.

I would like to do the same on Android with libvlc. I have added the same option to "libvlc_instance_t *instance = libvlc_new(sizeof(argv) / sizeof(*argv), argv);" but it doesn't work. Stream appears on screen but nothing in any file. I have tried a few variations such asdst=file:///..., dst=/sdcard/... and I have obviously android.permission.WRITE_EXTERNAL_STORAGE.

Am I doing something wrong or can't it work on Android?

Thanks in advance for any hint.

Re: Adding duplicate sout option to libvlc_instance on Andro

Posted: 13 Mar 2013 22:09
by edwardw
Well, sout is not supported via libvlc yet. So there is nothing that can be done at this point.

Re: Adding duplicate sout option to libvlc_instance on Andro

Posted: 14 Mar 2013 07:47
by gregoiregentil
I'm so disappointed! :-(

Note that I'm not really trying to transcode here, I just want to dump the rtsp stream that is received an played by libVLC. Is there another option (that would be supported by libVLC) which could help me? Otherwise, could you point where in the vlc tree I could simply patch to dump the rtsp stream before it's decoded? Once again, I'm not interested by all the options of sout, just to dump. Thanks in advance.

Re: Adding duplicate sout option to libvlc_instance on Andro

Posted: 14 Mar 2013 12:25
by edwardw
This is 150% unsupported and if it doesn't work there is no warranty, but check in the logcat log to see what is blocking the --sout command.

Re: Adding duplicate sout option to libvlc_instance on Andro

Posted: 15 Mar 2013 09:02
by gregoiregentil
Unfortunately, there is nothing in logcat about the added sout. No error message. My modification is taken into account as I tested another command line option in libvlc_instance and it was working. I do understand that it's totally unsupported but any other recommendation? Thanks in advance.

Re: Adding duplicate sout option to libvlc_instance on Andro

Posted: 19 Mar 2013 07:18
by gregoiregentil
If anyone has the same problem, after enabling sout, the magic line in the jni code turned out to be: libvlc_media_add_option(p_md, ":sout=#stream_out_duplicate{dst=display,dst=std{access=file,mux=ts,dst=/sdcard/go.mpg}}");

Re: Adding duplicate sout option to libvlc_instance on Andro

Posted: 12 Jul 2013 23:45
by qontranami
Hi. I made the suggested modifications above, but I'm still unable to dump the stream onto a file. Here is what I did.

1. Enabled sout (--enable-sout) in .../android/android/configure.sh
2. Modified the jni code as gregoiregentil suggested. Write permissions were already set in the manifest xml file.
3. Ran compile.sh
4. Ran make -e
5. Installed VLC on an Android device and played a file. Playback was successful, but I was unable to obtain a dumped file.

Questions:
1) Have you been able to successfully dump a file? If so, why do you think I am not getting anything?
2) In your jni code, how does the software distinguish between sdcard1 and sdcard0?
3) How come you used "stream_out_duplicate..." instead of just "duplicate..."?

Re: Adding duplicate sout option to libvlc_instance on Andro

Posted: 13 Jul 2013 17:06
by edwardw
It just dumps to the default /sdcard of Android.

Sout is not officially supported in VLC for Android right now. You are on your own to troubleshoot.

Re: Adding duplicate sout option to libvlc_instance on Andro

Posted: 13 Jul 2013 18:02
by gregoiregentil
1) Yes. I don't know.
2) I don't. That's not the scope of the thread here. Just find a place you can write to file.
3) Just the magic string that works for me.
Check all your log first...