Stream RTSP from Android to android via wi-fi

About encoding, codec settings, muxers and filter usage
kulkarni_rajiv
New Cone
New Cone
Posts: 4
Joined: 06 Mar 2020 05:18

Stream RTSP from Android to android via wi-fi

Postby kulkarni_rajiv » 06 Mar 2020 17:04

Hello,
I am trying to display rtsp stream on my android phone.
This RTSP stream is created by IPWEBCAM server on another android phone.
I am using libvlc 3.0 that I downloaded from github.
However, I get the "picture too late" messages and the video is not dispalyed.
It displays a static picture of the initial frame that it receives.

W/VLC: [d6b46330/2df4] libvlc video output: picture is too late to be displayed (missing 395 ms)
W/VLC: [d6b46330/2df4] libvlc video output: picture is too late to be displayed (missing 400 ms)

I am trying to paste more log and code, but unable due to character limitations.

Please let me know.

Thanks
Rajiv Kulkarni

kulkarni_rajiv
New Cone
New Cone
Posts: 4
Joined: 06 Mar 2020 05:18

Re: Stream RTSP from Android to android via wi-fi

Postby kulkarni_rajiv » 06 Mar 2020 17:12

Code: Select all

Here is my activity code: ==================== package com.example.mystream;//package com.pedro.vlctestapp; //import android.media.MediaPlayer; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.WindowManager; import android.widget.Button; import android.widget.EditText; import android.widget.PopupWindow; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import com.pedro.vlc.VlcListener; import com.pedro.vlc.VlcVideoLibrary; import org.videolan.libvlc.MediaPlayer; import java.util.Arrays; //import org.videolan.libvlc.LibVLC; //import org.videolan.libvlc.MediaPlayer; /** * Created by pedro on 25/06/17. */ public class MainActivity extends AppCompatActivity implements VlcListener, View.OnClickListener { private VlcVideoLibrary vlcVideoLibrary; private Button bStartStop; private EditText etEndpoint; public static EditText et_x ; public static EditText et_y; private PopupWindow popupWindow; private View popupView; private SurfaceHolder surfaceHolder; /* Rajiv commented line below for testing. private String[] options = new String[]{":sout-rtp-caching=10", ":no-plugins-cache",":avcodec-fast",":avcodec-skiploopfilter=4",":avcodec-dr", ":network-caching=150",":file-caching=3",":clock-jitter=0", ":codec=mediacodec_ndk,mediacodec_jni,none",":rtsp-frame-buffer-size=50", ":audio-time-stretch",":rtsp-tcp",":clock-synchro=0"};*/ private String[] options = new String[] {"-vvv","--file-caching=20","--network-caching=3000","--clock-jitter=20","--clock-synchro=20", "--ffmpeg-hw", "--rtsp-frame-buffer-size=200000","--live-caching==0","--demux","--h264","--no-audio"}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); setContentView(R.layout.activity_main); SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView); bStartStop = (Button) findViewById(R.id.b_start_stop); bStartStop.setOnClickListener(this); //etEndpoint = (EditText) findViewById(R.id.et_endpoint); et_x = (EditText) findViewById(R.id.et_x); et_y = (EditText) findViewById(R.id.et_y); et_x.setText("1000"); et_y.setText("700"); vlcVideoLibrary = new VlcVideoLibrary(this, this, surfaceView); //media.addOption(":network-caching=" + Constants.BUFFER); //media.addOption(":file-caching=" + Constants.BUFFER); vlcVideoLibrary.setOptions(Arrays.asList(options)); } @Override public void onComplete() { Toast.makeText(this, "Playing", Toast.LENGTH_SHORT).show(); } @Override public void onError() { Toast.makeText(this, "Error, make sure your endpoint is correct", Toast.LENGTH_SHORT).show(); vlcVideoLibrary.stop(); bStartStop.setText(getString(R.string.start_player)); } public void onBuffering(MediaPlayer.Event event) { } @Override public void onClick(View view) { if (!vlcVideoLibrary.isPlaying()) { //vlcVideoLibrary.play(etEndpoint.getText().toString()); vlcVideoLibrary.play("rtsp://192.168.1.12:8080/h264_ulaw.sdp"); bStartStop.setText(getString(R.string.stop_player)); } else { //comes here if Currently playing vlcVideoLibrary.stop(); bStartStop.setText(getString(R.string.start_player)); } } }

kulkarni_rajiv
New Cone
New Cone
Posts: 4
Joined: 06 Mar 2020 05:18

Re: Stream RTSP from Android to android via wi-fi

Postby kulkarni_rajiv » 06 Mar 2020 17:34

To help you, we need messages, to completely understand what your problems is.

From windows command line or linux or macos terminal, launch vlc with options -vv and --logfile=file

  • Windows example: vlc.exe -vv --logfile=c:\vlclog.txt
  • Linux example: vlc -vv --logfile=vlclog.txt, or vlc -vv 2>&1 > logfile.txt
Then paste the full resulting log here between [​code]and[​/code] (or use Pastebin.com if it's too long)

Also don't forget to name your Operating System and provide the VLC media player version.
Here is the log:
===============

03/05 23:04:26: Launching 'mystream' on ALLDOCUBE T701.
$ adb shell am start -n "com.example.mystream/com.example.mystream.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 11688 on device 'alldocube-t701-T70116GB19425330358'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/xample.mystrea: Late-enabling -Xcheck:jni
W/xample.mystrea: Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
W/xample.mystrea: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
W/xample.mystrea: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
W/xample.mystrea: Accessing hidden method Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic; (light greylist, linking)
W/xample.mystream: type=1400 audit(0.0:5728): avc: denied { read } for name="u:object_r:vendor_hwui_prop:s0" dev="tmpfs" ino=260 scontext=u:r:untrusted_app:s0:c119,c256,c512,c768 tcontext=u:object_r:vendor_hwui_prop:s0 tclass=file permissive=0
E/libc: Access denied finding property "ro.vendor.hwui.renderer"
D/OpenGLRenderer: Skia GL Pipeline
D/VLC: [d6ce3eb0/6c765f70] libvlc libvlc: VLC media player - 3.0.0-rc1 Vetinari
[d6ce3eb0/0] libvlc libvlc: Copyright © 1996-2017 the VideoLAN team
[d6ce3eb0/0] libvlc libvlc: revision 3.0.0-git-117-g3f53b97
[d6ce3eb0/0] libvlc libvlc: configured with ../configure '--host=arm-linux-androideabi' '--build=x86_64-unknown-linux' '--with-contrib=/home/pedro/AndroidStudioProjects/vlc-android/vlc/contrib/arm-linux-androideabi' '--enable-neon' '--disable-nls' '--enable-live555' '--enable-realrtsp' '--enable-avformat' '--enable-swscale' '--enable-avcodec' '--enable-opus' '--enable-opensles' '--enable-matroska' '--enable-taglib' '--enable-dvbpsi' '--disable-vlc' '--disable-shared' '--disable-update-check' '--disable-vlm' '--disable-dbus' '--enable-lua' '--disable-vcd' '--disable-v4l2' '--enable-dvdread' '--enable-dvdnav' '--disable-bluray' '--disable-linsys' '--disable-decklink' '--disable-libva' '--disable-dv1394' '--enable-mod' '--disable-sid' '--disable-gme' '--disable-tremor' '--disable-mad' '--enable-mpg123' '--disable-dca' '--disable-sdl-image' '--enable-zvbi' '--disable-fluidsynth' '--enable-fluidlite' '--disable-jack' '--disable-pulse' '--disable-alsa' '--disable-samplerate' '--disable-sdl' '--disable-xcb' '--dis
[d6ce3eb0/d6c43180] libvlc libvlc: plug-ins loaded: 297 modules
[f02312b0/ebef6778] libvlc logger: looking for logger module matching "any": 4 candidates
[f02312b0/0] libvlc logger: using logger module "android_logger"
[d6ce3eb0/2da8] libvlc libvlc: translation test: code is "C"
[f02318b0/2da8] libvlc keystore: looking for keystore module matching "memory": 3 candidates
[f02318b0/2da8] libvlc keystore: using keystore module "memory"
D/VLC: [d6ce3eb0/2da8] libvlc libvlc: CPU has capabilities ARM_NEON FPU
W/VLC: [d6ce3eb0/2da8] libvlc libvlc: options :file-caching=50 without item
D/LongScreenshotUtil: register longscreenshotReceiver
W/xample.mystream: type=1400 audit(0.0:5729): avc: denied { read } for name="u:object_r:vendor_hwui_prop:s0" dev="tmpfs" ino=260 scontext=u:r:untrusted_app:s0:c119,c256,c512,c768 tcontext=u:object_r:vendor_hwui_prop:s0 tclass=file permissive=0
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean)
I/gralloc: gralloc_register_buffer hnd=0xebe94340, share_fd=61, share_attr_fd=-1, magic=51647890, format=1, internal_format=1, byte_stride=2880, flags=4, usage=0xb00, size=3686400, width=720, height=1280, internalWidth=720, internalHeight=1280, stride=720, base=0xd367c000, writeOwner=0, attr_base=0xffffffff, yuv_info=1, fd=-1, buf_idx=0, offset=0, min_pgsz=4096, phyaddr=0
E/: Shared attribute region not available to be mapped
I/OpenGLRenderer: queryNativeWindowStatus 0xd326a808 query=0 dataspace=0
I/gralloc: gralloc_register_buffer hnd=0xebe947c0, share_fd=75, share_attr_fd=-1, magic=51647890, format=1, internal_format=1, byte_stride=640, flags=4, usage=0xb00, size=50560, width=149, height=79, internalWidth=149, internalHeight=79, stride=160, base=0xf0e5d000, writeOwner=0, attr_base=0xffffffff, yuv_info=1, fd=-1, buf_idx=0, offset=0, min_pgsz=4096, phyaddr=0
D/VLC: [d326a030/2de7] libvlc input: Stream buffering done (538 ms in 659 ms)
D/VLC: [d6b258b0/2df0] libvlc scale: 32x32 (32x32) chroma: YUVA -> 16x16 (16x16) chroma: RGBA with scaling using Bicubic (good quality)
I/gralloc: gralloc_unregister_buffer hnd=0xebe947c0, share_fd=75, share_attr_fd=-1, magic=51647890, format=1, internal_format=1, byte_stride=640, flags=4, usage=0xb00, size=50560, width=149, height=79, internalWidth=149, internalHeight=79, stride=160, base=0xf0e5d000, writeOwner=0, attr_base=0xffffffff, yuv_info=1, fd=-1, buf_idx=0, offset=0, min_pgsz=4096, phyaddr=0
W/VLC: [d6b46330/2df4] libvlc video output: picture is too late to be displayed (missing 462 ms)
W/libEGL: EGLNativeWindowType 0xd326a808 disconnect failed
W/VLC: [d6b46330/2df4] libvlc video output: picture is too late to be displayed (missing 543 ms)

kulkarni_rajiv
New Cone
New Cone
Posts: 4
Joined: 06 Mar 2020 05:18

Re: Stream RTSP from Android to android via wi-fi

Postby kulkarni_rajiv » 06 Mar 2020 17:37

I am working using Android studio on Windows.
I have downloaded the vlclib from github.
so I guess the "vlc" command will not work.

If some can work with me, I can share my screen, so it will be much easier to explain my problem.

Thanks
Rajiv


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 14 guests