Closed thellaindudhar closed 4 years ago
We don't yet support RTMP in Shaka Streamer (see google/shaka-streamer#16), and I'm not sure we could reproduce this issue without access to your private stream. (I noticed a private IP range on the URL.)
It's possible that the "DTS out of order" error is a problem in the input. Where does this particular RTMP stream come from? What generates it?
Also, I'm going to transfer this issue to the streamer repo.
we are generating rtmp through node rtmp
Can you please give us some way to reproduce your results? Some details on how you are generating the RTMP stream?
Thanks for the response. By using node-media-server (node.js) and ffmpeg converting the mp4 video file with (h264 video and audio aac codecs) to rtmp url.
node app.js ffmpeg -re -i sample.mp4 -c copy -f flv rtmp://localhost/live/commet
Using the rtmp url in shaka streamer
Can you provide us with a more complete set of instructions to reproduce the issue? Please assume we know nothing about node-media-server, and please provide any source material you're starting with.
1)Creating a new folder nms , then i perform the steps as it is which was present in below link. ->This is the link where i follow the steps to generate the rtmp url with node.js:- click:- https://www.npmjs.com/package/node-media-server
2)Git version:-
mkdir nms
cd nms
git clone https://github.com/illuspas/Node-Media-Server
npm i
node app.js
npm version (recommended):-
mkdir nms
cd nms
npm install node-media-server
->create a new file app.js and open the file ,copy the below content to the app.js file:-
vi app.js
const NodeMediaServer = require('node-media-server');
const config = {
rtmp: {
port: 1935,
chunk_size: 60000,
gop_cache: true,
ping: 30,
ping_timeout: 60
},
http: {
port: 8000,
allow_origin: '*'
}
};
var nms = new NodeMediaServer(config)
nms.run();
Then run the node app.js in one terminal and ffmpeg in another terminal
node app.js
ffmpeg -re -i sample.mp4 -c copy -f flv rtmp://localhost/live/commet
Like this way i am generating the rtmp url. Then inserting this rtmp url to "input_looped_file_config.yaml" for both audio and video. Make changes in the pipeline_live_config.yaml according to us
->vi pipeline_live_config.yaml
streaming_mode: live
transcoder:
# A list of resolutions to encode.
resolutions:
# - 720p
- 480p
#- 360p
#- 240p
#- 144p
# The number of audio channels to output.
channels: 2
# The codecs to encode with.
audio_codecs:
- aac
video_codecs:
- h264
packager:
# Manifest format (dash, hls, or both)
manifest_format:
- dash
# - hls
# Length of each segment in seconds.
segment_size: 2
# Availability window, or the number of seconds a segment remains available.
availability_window: 200
# Presentation delay, or how far back from the edge the player should be.
presentation_delay: 50
# Update period, or how often the player should fetch a new manifest.
update_period: 4
After that the below command line executed in that terminal
python3 shaka-streamer -i config_files/input_looped_file_config.yaml -p config_files/pipeline_live_config.yaml -o /var/www/html/dash/
All these operation is done in the ("UBUNTU LTS 16.04 OS")
Thank you for the instructions. You still have not provided your sample.mp4
file, which could be key to reproducing your issue.
In particular, your command ffmpeg -re -i sample.mp4 -c copy -f flv rtmp://localhost/live/commet
copies the input to FLV, which requires certain audio sample rates (44100, 22050, or 11025) and certain codecs (aac, for example). So not just any MP4 will do.
You also left out the contents of your input config file.
I've tried to reproduce your issue by recreating the missing pieces.
I created my own sample.mp4
from known-good content with:
ffmpeg \
-t 60 -i Sintel.2010.720p.mkv \
-ac 2 -ar 44100 \
-c:v h264 -b:v 4M \
-c:a aac -b:a 128k \
sample.mp4
This is 60 seconds of Sintel, in stereo, 44.1kHz AAC, 720p h264, 4Mbps.
Your pipeline config is in an older format, so I'm guessing you're using v0.1 of the application. Please update to a newer build, either from source or with pip3 install --upgrade shaka-streamer
.
In spite of the fact that we don't officially support RTMP yet (see #16), I've gotten this working without changing any of the Streamer code. I think I see the issue, and it's with your ffmpeg commands.
You're taking your sample.mp4
and sending it to RTMP, then asking Streamer to create a loop for you. For a networked input like this, you need to have the RTMP input be unending instead. So you need to loop that mp4 in your ffmpeg command.
ffmpeg -stream_loop -1 -re -i sample.mp4 -c copy -f flv rtmp://localhost/live/commet
Then, your pipeline config (updated to the current format) would be:
streaming_mode: live
resolutions:
- 480p
audio_codecs:
- aac
video_codecs:
- h264
manifest_format:
- dash
segment_size: 2
availability_window: 200
presentation_delay: 50
update_period: 4
And your input config would be (note the lack of input_type: looped_file
):
inputs:
- name: rtmp://localhost/live/commet
media_type: video
- name: rtmp://localhost/live/commet
media_type: audio
This works for me, and plays fine in the latest version of Shaka Player.
Does this help?
Details of sample.mp4: $ mediainfo BangladeshInnings2nd.mp4
General Complete name : BangladeshInnings2nd.mp4 Format : MPEG-4 Format profile : Adobe Flash Codec ID : f4v (isom/mp42/m4v ) File size : 690 MiB Duration : 23mn 20s Overall bit rate mode : Variable Overall bit rate : 4 134 Kbps Encoded date : UTC 2019-05-17 17:55:14 Tagged date : UTC 2019-05-17 17:55:14
Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.1 Format settings, CABAC : Yes Format settings, ReFrames : 1 frame Format settings, GOP : M=1, N=60 Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 23mn 20s Bit rate mode : Constant Bit rate : 4 000 Kbps Width : 1 280 pixels Height : 720 pixels Display aspect ratio : 16:9 Frame rate mode : Variable Frame rate : 30.000 fps Minimum frame rate : 1.751 fps Maximum frame rate : 30.303 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.145 Stream size : 668 MiB (97%) Title : WowzaStreamingEngine Language : English Encoded date : UTC 2019-05-17 17:55:14 Tagged date : UTC 2019-05-17 17:55:14
Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 23mn 20s Bit rate mode : Variable Bit rate : 129 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 44.1 KHz Frame rate : 43.066 fps (1024 spf) Compression mode : Lossy Stream size : 21.5 MiB (3%) Title : WowzaStreamingEngine Language : English Encoded date : UTC 2019-05-17 17:55:14 Tagged date
Thanks for your reply, but can i get some more detail information regarding of the issue and its solution
May i know what are the contents i left in the input_config files. If you don't mind can you please explain me in step by step method how you are approaching and what are the changes you made for resolving the issue and what are the changes i need to do to resolve the issue on my side.
Here i am using the upgrade version of shaka-streamer but it is not taking the version of shaka-packager can you help me how to resolve the issue
We require Shaka Packager v2.1 or above. If you have a pre-release version built from source, you'll need to:
1) Verify that it is newer than the v2.1 tag 2) Get the latest Shaka Streamer source code from github 3) Run it with the option --skip_deps_check to bypass the version number check on Shaka Packager
The --skip_deps_check option will appear in Streamer v0.4, which has yet to be released on PyPI.
After that, you should use the commands and config files I showed you in my earlier comment. (ffmpeg -stream_loop -1
when streaming to the RTMP encoder, and use the input config I showed you without looped_file
.)
If that doesn't work for you, you'll need to send us the actual MP4 source file you're using, not just the output of mediainfo
on it. I can't reproduce a specific failure with mediainfo
output alone.
Does this help?
While playing encrypted live+vod content in shakaplayer its not playing and throwing the issue :- Shaka Error MANIFEST.RESTRICTIONS_CANNOT_BE_MET ([object Object])
I'm unable to reproduce your results. Please wait for the 0.4 release with documented RTMP support.
@thellaindudhar Does this answer all your questions? Can we close the issue?
yes you can close the issue
Thanks! Let us know if we can do anything else for you.
Shaka streamer with rtmp url :-
Stream #0:1: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 3999 kb/s, 30 fps, 30 tbr, 1k tbn, 60 tbc
ffmpeg -stream_loop -1 -re -loglevel warning -i rtmp://192.168.26.250/live/commet -f mpegts -vcodec copy -acodec copy -y /tmp/shaka-live-l9xznts7/c981326e-352a-4fff-9699-1ca7683c2eba
ffmpeg -stream_loop -1 -re -loglevel warning -i rtmp://192.168.26.250/live/commet -f mpegts -vcodec copy -acodec copy -y /tmp/shaka-live-l9xznts7/b5a06f54-b5e4-4299-96c0-46f4ec9c39d6
ffmpeg -y -thread_queue_size 100 -i /tmp/shaka-live-l9xznts7/c981326e-352a-4fff-9699-1ca7683c2eba -thread_queue_size 100 -i /tmp/shaka-live-l9xznts7/b5a06f54-b5e4-4299-96c0-46f4ec9c39d6 -map 0:0 -an -cmp chroma -f mpegts -preset ultrafast -c:v h264 -b:v 2M -bf 0 -pix_fmt yuv420p -flags +cgop -profile:v main -level:v 3.1 -keyint_min 60 -g 60 -vf scale=-2:480 /tmp/shaka-live-l9xznts7/28b66dc7-8a57-45ec-8498-3d0c5ab7bb06 -map 1:1 -vn -ac 2 -f mpegts -c:a aac -b:a 64k /tmp/shaka-live-l9xznts7/bee4f5c6-c812-4d02-aa19-053c8b9dbcc8
packager 'init_segment=/RAM_Disk/out//audio_und_2c_64k_init.mp4,stream=audio,in=/tmp/shaka-live-l9xznts7/bee4f5c6-c812-4d02-aa19-053c8b9dbcc8,segment_template=/RAM_Disk/out//audio_und_2c64k$Number$.m4s,' 'init_segment=/RAM_Disk/out//video_480p_2M_init.mp4,stream=video,in=/tmp/shaka-live-l9xznts7/28b66dc7-8a57-45ec-8498-3d0c5ab7bb06,segment_template=/RAM_Disk/out//video_480p2M$Number$.m4s,' --segment_duration 2 --time_shift_buffer_depth 50 --preserved_segments_outside_live_window 1 --suggested_presentation_delay 1 --minimum_update_period 4 --mpd_output /RAM_Disk/out/dash.mpd --io_block_size 65536
While playing the playback url:-
[dash @ 0x7ffaf0000940] DTS 4626000 < 4983000 out of order]
repeating the same segment util the segment disappears on the folder, later for every 2 seconds the video stops for 5 seconds up to last segment.
If i increase the seconds in time_Shift_Buffer_Depth then it will play the segments for that particular time,later same issue repeat.
Can any one guide me how to resolve the issue,what are the changes i need to do in the shaka-streamer