I'm trying to open and display a UDP video stream encoded as H.264 on an Android device. Right now I'm using ExoPlayer somewhat successfully with mp4 files, but it fails on the stream from my Jetson Nano.
Here is Nvidia deepstream pipeline string I'm using to send the stream from my Nano with:
gst-launch-1.0 -v nvarguscamerasrc sensor-id=0 bufapi-version=true ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! nvvideoconvert flip-method=2 ! nvv4l2h264enc iframeinterval=1 ! h264parse ! rtph264pay pt=96 config-interval=1 ! udpsink host=192.168.1.53 port=4711 sync=0 Here is the gstreamer pipeline string I'm able to receive the video stream with on my laptop:
udpsrc port=4711 ! application/x-rtp ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink Here is the relevant Java code I'm attempting to use to display the stream on my android device:
public class MainActivity extends AppCompatActivity { ExoPlayer player; PlayerView playerView; String udpUri = "udp://0.0.0.0:4711"; MediaSource mediaSource; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); player = new ExoPlayer.Builder(this).build(); playerView = findViewById(R.id.PlayerView); playerView.setPlayer(player); SetupUdp(); } @SuppressLint("UnsafeOptInUsageError") private void SetupUdp() { DataSource.Factory factory = () -> new UdpDataSource(3000, 50000); Uri videoUri = Uri.parse(udpUri); MediaItem mediaitem = new MediaItem.Builder().setUri(videoUri).build(); mediaSource = new ProgressiveMediaSource.Factory(factory).createMediaSource(mediaitem); player.setMediaSource(mediaSource); player.setPlayWhenReady(true); player.prepare(); } } The apparent output in the app on my android device is just a black screen with a play button that does nothing. Again, I'm able to view other video sources with ExoPlayer just fine. Any help is appreciated.
Related questions 4012 Proper use cases for Android UserManager.isUserAGoat()? 4333 How can I close/hide the Android soft keyboard programmatically? 3538 Why is the Android emulator so slow? How can we speed up the Android emulator? Related questions 4012 Proper use cases for Android UserManager.isUserAGoat()? 4333 How can I close/hide the Android soft keyboard programmatically? 3538 Why is the Android emulator so slow? How can we speed up the Android emulator? 3080 Is there a unique Android device ID? 3161 How to stop EditText from gaining focus when an activity starts in Android? 2246 What is 'Context' on Android? 1989 "Debug certificate expired" error in Eclipse Android plugins 2085 Is there a way to run Python on Android? 2078 How to lazy load images in ListView in Android Load 6 more related questions Show fewer related questions
Reset to default