Closed Srinu-try closed 5 years ago
The reproduction steps provided appear to be quite time consuming. Please can you provide more direct reproduction steps, such as an rtmp test stream that we can use to test this without having to spend time using FFmpeg / Wowza streaming engine ourselves? We really don't have sufficient time to do this kind of thing to debug non-widespread issues.
Hi,
Thanks for your response.
Finally, I got a public IP to stream the RTMP video. You can stream the content and reproduce the issue using the below address, rtmp://76.81.29.11:1935/live/Cam2
The stream restarts every 10 mins. During the restart, RTMP server is taking some time to connect with the RTMP clients.
Thanks, Sri
The stream appears malformed to me, although I'm not sure whether there's something I'm missing. What I see when I attach a debugger is:
SCRIPTDATAOBJECT,
and is well formed (fine)VIDEODATA
(fine)VIDEODATA
packet: CodecId = 7
(AVC), AVCPacketType = 0
(Avc Sequence Header), CompositionTime = 0
(all fine)AVCDecoderConfigurationRecord
as defined in ISO 14496-15. This appears to be malformed, in particular from numOfPictureParameterSets
, which has value of 174 (not fine).rtmpdump
and then try and play back that file, I do not see invalid data and the stream is able to play fine.So it appears the stream is not malformed, but there's probably a bug in LibRtmp that means it's not being read correctly. I'll file an issue on LibRtmp.
Hi,
Thanks for raising the issue with libRtmp.
Yes. LiRtmp library is causing the issue here. The output buffer data from libRtmp is missing last 13 bytes of SPS/PPS header data. Length of the data is shown as 43 bytes but libRtmp is providing only 30 bytes of data from the respective header. The rest of 13 bytes are filed from next Video Tag data header which is causing the issue.
Hi,
Any update on the librtmp issue? I did not see any comments or updates from libRtmp team on this issue.
Thanks, Sri
The underlying issue is tracked by https://github.com/ant-media/LibRtmp-Client-for-Android/issues/70
Hi guys,
So i was facing same issue and a little research I did arrived at HTTP/HTTPS issues so to fix it, use this attribute to your AndroidManifest.xml where you allow all http for all requests:
android:usesCleartextTraffic="true"
Eg.
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="false" android:theme="@style/AppTheme" android:usesCleartextTraffic="true" tools:ignore="GoogleAppIndexingWarning"> <uses-library android:name="org.apache.http.legacy" android:required="false" /> <activity android:name=".MainActivity" android:label="@string/app_name"/>
I don't think that's related to this issue.
Issue description
Hi All,
I am facing a playback issue in playing Video only RTMP stream using ExoPlayer2 RTMP extension.
I am streaming a video only file with FFMPEG using Wowza server (see the below command),
ffmpeg -i input.mp4 -c copy rtmp://WowzaServerIPADDRESS:1935/live/Cam
Exoplayer2 is failing to parse the AVC decoder SPS/PPS data and failed at "AvcConfig avcConfig = AvcConfig.parse(videoSequence);" API. I found that SPS/PPS data from the RTMPClient is missing last 13 bytes of information.
"rtmpClient.read(buffer, offset, readLength)" API output contains 13 bytes of less data (missing 9 bytes of SPS/PPS data + 4 bytes of Skip header data before the next Video tag header)
When I use a lower bitrate (<5 Mbps 3840*1920 video resolution) RTMP streaming, I observed similar behaviour. Here 13 bytes of data is mising from the 1st video frame received from RTMPClient instead of the data from SPS/PPS. In this case, 1st frame is displayed properly, but as 13 bytes are missed from 1st frame, the offset of next Video tag header is wrong and ExoPlayer fails to understand the next Video tag header offset position.
Surpraisingly, this issue is happening only with Video only file streaming. If Audio is present, this 13 bytes missing scenario is not happening.
Request your help in this regard.
Reproduction steps
Use the below command with video only input file for RTMP streaming and play using ExoPlayer2 with RTMP support
ffmpeg -re -i input.mp4 -c copy -f flv rtmp://WowzaServerIPADDRESS:port/live/Cam
Link to test content
Video File: Download "bbb_sunflower_2160p_30fps_normal.mp4" file from https://download.blender.org/demo/movies/BBB/
and extract video using FFMPEG
ffmpeg -i bbb_sunflower_2160p_30fps_normal.mp4 -c copy -an bbb-VideoOnly.mp4
Another video only file is uploaded at https://www.dropbox.com/s/q7gyqk02ac7ag0x/Cam2_7Mbps.mp4?dl=0
Version of ExoPlayer being used
Using the latest code from release-v2 branch of ExoPlayer2 project.
Device(s) and version(s) of Android being used
I am using Samsung Note 8 device with Android version 7.1.1
A full bug report captured from the device