Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to play an UDP URI in demo module? #2630

Closed
mossc opened this issue Mar 30, 2017 · 12 comments
Closed

How to play an UDP URI in demo module? #2630

mossc opened this issue Mar 30, 2017 · 12 comments

Comments

@mossc
Copy link

mossc commented Mar 30, 2017

Step:

  1. Add an UDP URI in media.exolist.json
{
    "name": "Multicast",
    "samples": [
      {
        "name": "udp://@239.255.42.128:5004",
        "uri": "udp://@239.255.42.128:5004"
      }
    ]
},
  1. Modify library/src/main/java/com/google/android/exoplayer2/upstream/DefaultDataSource.java
    according to the reply from @Avetri of issue How to use UdpDataSource in exoplayer? #2029
library/src/main/java/com/google/android/exoplayer2/upstream/DefaultDataSource.java 
index ae6f1e0..28a5b3d 100644
@@ -40,7 +40,9 @@ public final class DefaultDataSource implements DataSource {
 
   private static final String SCHEME_ASSET = "asset";
   private static final String SCHEME_CONTENT = "content";
+  private static final String SCHEME_UDP = "udp";
 
+  private final DataSource udpDataSource;
   private final DataSource baseDataSource;
   private final DataSource fileDataSource;
   private final DataSource assetDataSource;
@@ -99,6 +101,7 @@ public final class DefaultDataSource implements DataSource {
     this.fileDataSource = new FileDataSource(listener);
     this.assetDataSource = new AssetDataSource(context, listener);
     this.contentDataSource = new ContentDataSource(context, listener);
+    this.udpDataSource = new UdpDataSource(listener);
   }
 
   @Override
@@ -116,6 +119,8 @@ public final class DefaultDataSource implements DataSource {
       dataSource = assetDataSource;
     } else if (SCHEME_CONTENT.equals(scheme)) {
       dataSource = contentDataSource;
+    } else if (SCHEME_UDP.equals(scheme)) {
+      dataSource = udpDataSource;
     } else {
       dataSource = baseDataSource;
     }
  1. Test the demo module on Android phone.

Result:
Video won't be played and keep showing
playWhenReady:true playbackState:buffering window:0
sss

locat

03-30 14:10:25.105 27055-27251/com.google.android.exoplayer2.demo I/Adreno: QUALCOMM build                   : 03b6da7, I49f5588d88
                                                                            Build Date                       : 11/26/15
                                                                            OpenGL ES Shader Compiler Version: XE031.06.00.02
                                                                            Local Branch                     : 
                                                                            Remote Branch                    : refs/tags/AU_LINUX_ANDROID_LA.BF64.1.2.2_RB4.06.00.00.180.010
                                                                            Remote Branch                    : NONE
                                                                            Reconstruct Branch               : NOTHING
03-30 14:10:34.373 27055-27055/com.google.android.exoplayer2.demo I/ExoPlayerImpl: Init 2.3.1 [htc_himauhl, HTC_M9u, HTC, 23]
03-30 14:10:34.400 27055-27055/com.google.android.exoplayer2.demo D/EventLogger: state [0.00, true, I]
03-30 14:10:34.462 27055-27251/com.google.android.exoplayer2.demo W/OpenGLRenderer: Fail to change FontRenderer cache size, it already initialized
03-30 14:10:34.538 27055-27055/com.google.android.exoplayer2.demo D/EventLogger: state [0.14, true, B]
03-30 14:10:34.541 27055-27055/com.google.android.exoplayer2.demo D/EventLogger: sourceInfo [periodCount=1, windowCount=1
03-30 14:10:34.541 27055-27055/com.google.android.exoplayer2.demo D/EventLogger:   period [?]
03-30 14:10:34.541 27055-27055/com.google.android.exoplayer2.demo D/EventLogger:   window [?, false, false]
03-30 14:10:34.541 27055-27055/com.google.android.exoplayer2.demo D/EventLogger: ]
03-30 14:10:34.598 27055-27055/com.google.android.exoplayer2.demo D/EventLogger: loading [true]

Note:

  1. ExoPlayer version: ExoPlayer-release-v2
  2. The URI can be played normally on the same Android phone by VLC player
@Avetri
Copy link

Avetri commented Mar 30, 2017

Hello.

At least threre is no reason for @ before IP address.

Second, but not a source of the issue: 239 (as 224 and some others) group isn't suitable for an own multicast stream.

@Avetri
Copy link

Avetri commented Mar 30, 2017

@mossc
Please attach a full logcat of the player and some sample part of the stream.

@mossc
Copy link
Author

mossc commented Mar 30, 2017

@Avetri
Thanks for your reply.

About the @ before IP address, I had tested both URIs in VLC player Android version.
udp://@239.255.42.128:5004 ==> Play
udp://239.255.42.128:5004 ==> Won't play

And I had the same URI structure as issue #2029 ,

I think the UDP source is fine.

Or... I still miss something?

I will attach full log later.

@mossc
Copy link
Author

mossc commented Mar 30, 2017

@Avetri
The full log for both URI:

udp://@239.255.42.128:5004
full_log_with_a.txt

udp://239.255.42.128:5004
full_log_without_a.txt

Also attach the successfully playback log of VLC player
udp://@239.255.42.128:5004
vlc_with_a.txt

@mossc mossc changed the title How to play a UDP source in demo module? How to play an UDP URI in demo module? Mar 31, 2017
@Avetri
Copy link

Avetri commented Mar 31, 2017

I think the UDP source is fine.

I am not sure. Please attach a sample.
What is your source of multicast? It is sad if it is the VLC. Use tsplay.

Successfull VLC's playback says almost nothing. It is old native player that can open many kinds of bad content.

Unfortunatelly the logcat's logs are helpless. I saw no helpfull info. Output of the player is almost absent.

@mossc
Copy link
Author

mossc commented Mar 31, 2017

@Avetri

My multicast source is a HDMI over IP Transmitter.
devices

Testing environment:
HDMI -> Transmitter -> LAN -> Receiver -> HDMI

I would like to implement a android video player to replace that Receiver -> HDMI.

@Avetri
Copy link

Avetri commented Mar 31, 2017

@mossc

So You have to make dumps of the Transmitter's stream in this case. No fact that there is MPEG TS in the stream as I expected.
I had (as DVB Engineer) a similar situation with security IP cams. Their developers don't like to completely follow MPEG TS standarts even when their streams look like it.

@mossc
Copy link
Author

mossc commented Mar 31, 2017

@Avetri

OK, I will try to dump the Transmitter's stream.

Mean while, do you have any suggestion to build another transmitter?
May be another application like VLC?

I just want to try to use ExoPlayer play a multicast stream.

Thanks for your help!

@Avetri
Copy link

Avetri commented Apr 3, 2017

@mossc
VLC isn't a good solution. It requires some tricks to send TS.
As I wrote above You should use tsplay as a source of multicast streams. But it is only a sender also. You need TS files.

@mossc
Copy link
Author

mossc commented Apr 5, 2017

@Avetri

I had dumped the streaming data from transmitter, please reference to the attachment.
dump.out.zip

Check the dump file through MediaInfo:
mediainfo

Thanks

@Avetri
Copy link

Avetri commented Apr 7, 2017

@mossc @ojw28
Issue #1002 strikes back.

@mossc
Copy link
Author

mossc commented Apr 11, 2017

@Avetri
It seems really something happened on that TX device.
Thanks!!

@mossc mossc closed this as completed Apr 13, 2017
@google google locked and limited conversation to collaborators Aug 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants