Open caiiiycuk opened 2 years ago
under investigation.
Question to better understand the scenario for the VP8 ffmpeg: WebRTC protocol supports H264 as per https://developer.mozilla.org/en-US/docs/Web/Media/Formats/WebRTC_codecs
Which is supported by: Chrome (52+), Edge, Firefox, Safari So, to avoid inserting extra latency to IVS, the solution just copy the video, not performing any transcoding. In the logs provided, it's sending in VP8
What is the browser that you had performed the tests, also the version?
I just used this test app, without changing codes/etc. I used Chrome 101.0.4951.41 Ubuntu. I think VP8 is default codec for chrome.
Hi Alexander @caiiiycuk, We have been rewriting the code, for better reading and maintenance, please not that webrtc has support variations among browsers and Chrome is the recommend browser for this solution.
I've just published a preview version, branch v2preview https://github.com/aws-samples/aws-simple-streaming-webapp/tree/v2preview intend to address the main points reported by you as well as simplification of the deployment steps and option to run locally de UI and container, only depending on deploy the Amplify components, such as Auth and APIs (API Gateway, Lambda and Cognito User Pool).
A few considerations on the issues reported by you:
let vidStreaming = stream.current.captureStream(30);
The video element has been added into a canvas element that seems to have better compatibility with browsers. Please check check the https://github.com/osmarbento-AWS/simple-streaming-webapp/blob/v2preview/frontend/BROWSER.md for more information
Fixed. Please check the v2preview.
Safari and IOS in not currently supported. You can change ffmpeg to transcode the video by replacing the ffmpeg command on thebackend/docker_files/src/transwrap.js if that is a requirement for you and change the MediaRecorder as you suggested. Please see below the ffmpeg command bellow: chenge the vcoded to:
const ffmpeg = callff.spawn(
'ffmpeg',
['-i', '-', '-c:v', 'libx264', 'pix_fmt', 'yuv420p', '-profile:v main', '-preset', 'veryfast', '-tune', 'zerolatency', '-acodec', 'aac', '-reconnect', '3', '-reconnect_at_eof', '1', '-reconnect_streamed', '3', '-f', 'flv', rtmpURL
]);
More details in the follow link
mediaRecorder.current = new MediaRecorder(outputStream, {
mimeType: "video/webm;codecs=h264", // attempt to improve cross browser / platform support with h264
videoBitsPerSecond: 3000000,
});
The main reason to not transcode in the proxy server ECS container is to avoid adding additional latency. Which is one of the key features of amazon IVS.
Q1. Do I need to scale the instance count of fargate nodes somehow, like add node for each of the 10 publisher? We are doing tests, we are happy to discuss in a call. We are about to publish a new Dockerfile to improve performance and container size
Q2. Same for ivs channel. Do I need to create a new channel for a new publisher (1 channel == 1 publisher)? So, I need to do it programmatically?
1 Channel per simultaneous publisher, you can also use IVS API's to manage the stream keys, so that you provide 1 stream key per publisher, please check Amazon IVS API documentation for more information. https://docs.aws.amazon.com/ivs/latest/APIReference/Welcome.html
Please note that this is a preview, we are doing sanity checks, code review before merging it to the main branch.
Thank you. Doesn't IVS support RTMPS/vp9? I mean can I copy of video stream with ffmpeg like in h264 case?
I did npm install
in frontend but, I have following errors on npm start
:
Module not found: Error: Can't resolve 'aws-amplify' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/SetupTOTP'
ERROR in ./node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/SetupTOTP/SetupTOTP.js 5:0-53
Module not found: Error: Can't resolve 'aws-amplify' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/SetupTOTP'
ERROR in ./node_modules/@aws-amplify/ui-react/dist/esm/components/Geo/MapView/index.js 3:0-54
Module not found: Error: Can't resolve 'aws-amplify' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/@aws-amplify/ui-react/dist/esm/components/Geo/MapView'
ERROR in ./node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/formFields/defaults.js 6:0-21
Module not found: Error: Can't resolve 'aws-amplify' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/formFields'
ERROR in ./node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/utils.js 1:0-39
Module not found: Error: Can't resolve 'aws-amplify' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator'
ERROR in ./node_modules/@aws-amplify/ui/dist/esm/i18n/translations.js 2:0-40
Module not found: Error: Can't resolve 'aws-amplify' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/@aws-amplify/ui/dist/esm/i18n'
ERROR in ./node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/actors/signIn.js 2:0-40
Module not found: Error: Can't resolve 'aws-amplify' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/actors'
ERROR in ./node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/actors/signOut.js 2:0-40
Module not found: Error: Can't resolve 'aws-amplify' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/actors'
ERROR in ./node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/defaultServices.js 2:0-54
Module not found: Error: Can't resolve 'aws-amplify' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/@aws-amplify/ui/dist/esm/machines/authenticator'
ERROR in ./node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/signUp.js 2:0-40
Module not found: Error: Can't resolve 'aws-amplify' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/@aws-amplify/ui/dist/esm/machines/authenticator'
ERROR in ./node_modules/maplibre-gl-js-amplify/lib/esm/AmplifyMapLibreGeocoder.js 46:0-39
Module not found: Error: Can't resolve '@aws-amplify/geo' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/maplibre-gl-js-amplify/lib/esm'
ERROR in ./node_modules/maplibre-gl-js-amplify/lib/esm/AmplifyMapLibreRequest.js 47:0-39
Module not found: Error: Can't resolve '@aws-amplify/geo' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/maplibre-gl-js-amplify/lib/esm'
ERROR in ./node_modules/maplibre-gl-js-amplify/lib/esm/drawClusterLayer.js 1:0-39
Module not found: Error: Can't resolve '@aws-amplify/geo' in '/home/caiiiycuk/aws-streaming/frontend/node_modules/maplibre-gl-js-amplify/lib/esm'
webpack compiled with 12 errors
``
guess need to add aws-amplify
and @aws-amplify/geo
into package.json
.
1) For now, IVS only support H264 2) We are using Amplify Modular Import to reduce the bundle size, so adding aws-amplify goes to the full import. which I was trying to avoid https://github.com/aws-amplify/amplify-js/wiki/Amplify-Modularization Could you share, npm, node, amplify versions been used, please?
npm: 6.14.17 node: 14.19.2 amplify: 8.2.0
I added this libs, and frontend is working, also I deployed backend. I saw 2 running task in ivs service. Everything seems working, but when I trying to go live I have this issues:
DynamoDB config:
Ok, I saw that you added a CloudFront in front of the ECS servers, and probably cloudfront is not accepting the self-signed certificate, having TLS negation denied.
Alternatives:
1) Use HTTP between the
1.1) change the Docker file to use the transwrap_local.js instead:
CMD ["pm2-runtime","/opt/ivs-simple-webrtc/transwrap_local.js","-i max"]
1.2) now point the distribution to the HTTP endpoint, so the conversation between browser and CDN, will happen in HTTPS and HTTP between the CDN and Server.
2) Add a valid certificate to the container.
Okay, I removed cloudfront, and now everything works. But, I have very big delay ~5 min. When I open a stream player I see the stream that was like 5 min ago. I think it's because the fargate container is not powerful enough to process a stream in realtime (I used transcoder for h264):
1653361652165
frame=13384 fps= 14 q=-1.0 size= 102102kB time=00:08:56.86 bitrate=1558.0kbits/s speed=0.578x
1653361653235
frame=13411 fps= 14 q=-1.0 size= 102302kB time=00:08:57.94 bitrate=1557.9kbits/s speed=0.578x
1653361653925
frame=13439 fps= 14 q=-1.0 size= 102488kB time=00:08:59.06 bitrate=1557.5kbits/s speed=0.579x
1653361655093
frame=13465 fps= 14 q=-1.0 size= 102693kB time=00:09:00.10 bitrate=1557.6kbits/s speed=0.579x
1653361656080
frame=13488 fps= 14 q=-1.0 size= 102871kB time=00:09:01.02 bitrate=1557.6kbits/s speed=0.58x
1653361657293
frame=13516 fps= 14 q=-1.0 size= 103078kB time=00:09:02.14 bitrate=1557.6kbits/s speed=0.58x
1653361658229
frame=13545 fps= 14 q=-1.0 size= 103259kB time=00:09:03.30 bitrate=1557.0kbits/s speed=0.581x
1653361659199
frame=13575 fps= 14 q=-1.0 size= 103462kB time=00:09:04.50 bitrate=1556.6kbits/s speed=0.582x
1653361660152
frame=13602 fps= 15 q=-1.0 size= 103661kB time=00:09:05.58 bitrate=1556.5kbits/s speed=0.582x
1653361661296
frame=13632 fps= 15 q=-1.0 size= 103858kB time=00:09:06.78 bitrate=1556.0kbits/s speed=0.583x
1653361662210
frame=13663 fps= 15 q=-1.0 size= 104071kB time=00:09:08.02 bitrate=1555.7kbits/s speed=0.583x
1653361663768
frame=13683 fps= 15 q=-1.0 size= 104228kB time=00:09:08.82 bitrate=1555.8kbits/s speed=0.583x
1653361665342
frame=13737 fps= 15 q=-1.0 size= 104589kB time=00:09:10.98 bitrate=1555.0kbits/s speed=0.585x
1653361666736
frame=13765 fps= 15 q=-1.0 size= 104774kB time=00:09:12.10 bitrate=1554.6kbits/s speed=0.585x
1653361667564
frame=13790 fps= 15 q=-1.0 size= 104962kB time=00:09:13.10 bitrate=1554.6kbits/s speed=0.586x
1653361668585
frame=13818 fps= 15 q=-1.0 size= 105174kB time=00:09:14.22 bitrate=1554.6kbits/s speed=0.586x
You see that fps is 15, and speed is 0.586x, at start it was like 1.2x
Setting vCPU to 1 didn't help. Delay is here. It works very unstable for me. I have 3 cases: 1. I press "GO Live" wait until ffmpeg start showing frame messages. When I open a player it says that stream have corrupted/incompatible data. In ivs dashboard stream showed as not started (happens rarely). 2. I press "GO Live" wait until ffmpeg start showing frame messages. When I open a player it shows a black screen. In ivs dashboard I see same black screen and "Live" message, in stream detail I can see that data is sending:
(happens often)
3. Stream is normally started, and works but I have delay ~5min or more.
Each time I have this error messages from ffmpeg:
MSG: Connected to server
1653364175068
ffmpeg version 4.3.2-0york0~18.04 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04) configuration: --prefix=/usr --extra-version='0york0~18.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libzimg --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
1653364175068
libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100
1653364177796
[h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced
1653364177801
Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 2 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 3 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced
1653364177986
Last message repeated 2 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 2 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 2 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame!
1653364177986
[h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 2 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame! [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] non-existing PPS 0 referenced [h264 @ 0x55cfcfaac140] decode_slice_header error [h264 @ 0x55cfcfaac140] no frame!
1653364180571
Input #0, h264, from 'pipe:': Duration: N/A, bitrate: N/A Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive), 458x152, 25 fps, 25 tbr, 1200k tbn, 50 tbc
1653364181123
Output #0, flv, to 'rtmps://8d9be9fbc687.global-contribute.live-video.net:443/app/sk_us-east-1_tD66LgHKwLYO_H3kTaWtHciPF2oZ2KDCCGWWv399EwR': Metadata: encoder : Lavf58.45.100
1653364181123
Stream #0:0: Video: h264 (Constrained Baseline) ([7][0][0][0] / 0x0007), yuv420p(progressive), 458x152, q=2-31, 25 fps, 25 tbr, 1k tbn, 1200k tbc Stream mapping: Stream #0:0 -> #0:0 (copy) [flv @ 0x55cfcfaad5c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
I have been thinking on how to auto detect the supported mimeType of the browser and based on that, choose to transcode or not in the remote container.
In the frontend, we might think in a function like:
function getmimeType() {
let options = {
mimeType: "video/webm;codecs=h264",
videoBitsPerSecond: 3000000,
};
if (!MediaRecorder.isTypeSupported(options.mimeType)) {
addDebugLine(Date.now(), `${options.mimeType} + is not Supported`);
options = {
mimeType: "video/webm",
videoBitsPerSecond: 3000000,
};
if (!MediaRecorder.isTypeSupported(options.mimeType)) {
addDebugLine(Date.now(), `${options.mimeType} + is not Supported`);
options = {
mimeType: "video/mp4",
videoBitsPerSecond: 3000000,
};
}
}
return options;
}
"video/webm", would cover most of the cases for vp9 and vp8, although vp9 has several impact on performance, and instead we might force to vp8 instead.
mimeType: "video/webm;codes=vp8,opus",
In the backend, transwrap.js I'm planning to add a if to detect the codec and so decide on transcoding or not. As has several impact on the container size.
With Chrome Version 102.0.5005.61 (Official Build) (x86_64), and mac, it accepts video/webm;codecs=h264, it runs correctly and reasonable performance, 1.X speed and 6s e2e latency.
Could you provide the following information:
1) what the current video and audio codec selected in the MediaRecorder, if you check the console log is been printing the data blob, there you can get such information: Chrome:
Firefox:
2) Also, could you run the following JS:
function getSupportedMimeTypes(media, types, codecs) {
const isSupported = MediaRecorder.isTypeSupported;
const supported = [];
types.forEach((type) => {
const mimeType = `${media}/${type}`;
codecs.forEach((codec) => [
`${mimeType};codecs=${codec}`,
`${mimeType};codecs=${codec.toUpperCase()}`,
// /!\ false positive /!\
// `${mimeType};codecs:${codec}`,
// `${mimeType};codecs:${codec.toUpperCase()}`
].forEach(variation => {
if(isSupported(variation))
supported.push(variation);
}));
if (isSupported(mimeType))
supported.push(mimeType);
});
return supported;
};
// Usage ------------------
const videoTypes = ["webm", "ogg", "mp4", "x-matroska"];
const audioTypes = ["webm", "ogg", "mp3", "x-matroska"];
const codecs = ["should-not-be-supported","vp9", "vp9.0", "vp8", "vp8.0", "avc1", "av1", "h265", "h.265", "h264", "h.264", "opus", "pcm", "aac", "mpeg", "mp4a"];
const supportedVideos = getSupportedMimeTypes("video", videoTypes, codecs);
const supportedAudios = getSupportedMimeTypes("audio", audioTypes, codecs);
console.log('-- Top supported Video : ', supportedVideos[0])
console.log('-- Top supported Audio : ', supportedAudios[0])
console.log('-- All supported Videos : ', supportedVideos)
console.log('-- All supported Audios : ', supportedAudios)
3) what is the current ffmpeg command that you are using?
I will look into it
1) type: "video/x-matroska;codecs=avc1,opus"
2)
For Chrome:
Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36
-- Top supported Video : video/webm;codecs=vp9
-- Top supported Audio : audio/webm;codecs=opus
-- All supported Videos : video/webm;codecs=vp9,video/webm;codecs=VP9,video/webm;codecs=vp9.0,video/webm;codecs=VP9.0,video/webm;codecs=vp8,video/webm;codecs=VP8,video/webm;codecs=vp8.0,video/webm;codecs=VP8.0,video/webm;codecs=avc1,video/webm;codecs=AVC1,video/webm;codecs=h264,video/webm;codecs=H264,video/webm;codecs=opus,video/webm;codecs=OPUS,video/webm;codecs=pcm,video/webm;codecs=PCM,video/webm,video/x-matroska;codecs=vp9,video/x-matroska;codecs=VP9,video/x-matroska;codecs=vp9.0,video/x-matroska;codecs=VP9.0,video/x-matroska;codecs=vp8,video/x-matroska;codecs=VP8,video/x-matroska;codecs=vp8.0,video/x-matroska;codecs=VP8.0,video/x-matroska;codecs=avc1,video/x-matroska;codecs=AVC1,video/x-matroska;codecs=h264,video/x-matroska;codecs=H264,video/x-matroska;codecs=opus,video/x-matroska;codecs=OPUS,video/x-matroska;codecs=pcm,video/x-matroska;codecs=PCM,video/x-matroska
-- All supported Audios : audio/webm;codecs=opus,audio/webm;codecs=OPUS,audio/webm;codecs=pcm,audio/webm;codecs=PCM,audio/webm
For FF:
Browser: Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0
-- Top supported Video : video/webm;codecs=vp8
-- Top supported Audio : audio/webm;codecs=opus
-- All supported Videos : video/webm;codecs=vp8,video/webm;codecs=vp8.0,video/webm;codecs=opus,video/webm
-- All supported Audios : audio/webm;codecs=opus,audio/webm,audio/ogg;codecs=opus,audio/ogg
For Android:
Browser: Mozilla/5.0 (Linux; Android 7.1.1; MI MAX 2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36
-- Top supported Video : video/webm;codecs=vp9
-- Top supported Audio : audio/webm;codecs=opus
-- All supported Videos : video/webm;codecs=vp9,video/webm;codecs=VP9,video/webm;codecs=vp9.0,video/webm;codecs=VP9.0,video/webm;codecs=vp8,video/webm;codecs=VP8,video/webm;codecs=vp8.0,video/webm;codecs=VP8.0,video/webm;codecs=opus,video/webm;codecs=OPUS,video/webm;codecs=pcm,video/webm;codecs=PCM,video/webm,video/x-matroska;codecs=vp9,video/x-matroska;codecs=VP9,video/x-matroska;codecs=vp9.0,video/x-matroska;codecs=VP9.0,video/x-matroska;codecs=vp8,video/x-matroska;codecs=VP8,video/x-matroska;codecs=vp8.0,video/x-matroska;codecs=VP8.0,video/x-matroska;codecs=opus,video/x-matroska;codecs=OPUS,video/x-matroska;codecs=pcm,video/x-matroska;codecs=PCM,video/x-matroska
-- All supported Audios : audio/webm;codecs=opus,audio/webm;codecs=OPUS,audio/webm;codecs=pcm,audio/webm;codecs=PCM,audio/webm
For iPhone 8 (15.5):
Browser: Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1
-- Top supported Video : video/mp4;codecs=avc1
-- Top supported Audio : undefined
-- All supported Videos : video/mp4;codecs=avc1,video/mp4;codecs=AVC1,video/mp4;codecs=mp4a,video/mp4;codecs=MP4A,video/mp4
-- All supported Audios :
3)
const ffmpeg = callff.spawn(
'ffmpeg',
['-i', '-', '-vcodec', 'copy', '-preset', 'veryfast', '-tune', 'zerolatency', '-acodec', 'aac', '-reconnect', '3', '-reconnect_at_eof', '1', '-reconnect_streamed', '3', '-f', 'flv', rtmpURL
]);
My solution is deployed to
https://d2k6w1x5vnqp9h.cloudfront.net/
,
you should accept certificate to
https://ec2-54-162-64-167.compute-1.amazonaws.com
and channel is
https://8d9be9fbc687.us-east-1.playback.live-video.net/api/video/v1/us-east-1.373068080393.channel.SSvwSLhPuFmf.m3u8
rtmps://8d9be9fbc687.global-contribute.live-video.net:443/app/
sk_us-east-1_tD66LgHKwLYO_H3kTaWtHciPF2oZ2KDCCGWWv399EwR
Will keep it live for couple of days, you will have a chance to test how it works for you. Because for me it completely unusable, I recorded couple of videos:
Task config:
Operating system/Architecture
Linux/X86_64
CPU | Memory
1 vCPU | 2 GB
Platform version
1.4.0
Full task logs: ffmpeg.logs.gz
Hi! I am trying to build a webrtc application that uses ivs to broadcast the video. The main requirement for my app: it must work in all major browsers (chrome, ff, edge, safari, android webview, ios safari). I found this app in aws blogs, and from first look it is exactly what I need. BUT, actually it's not working out of the box. Problems that I found so far:
1. (minor) It's not possible to deploy the app in a custom region, because the region is hard coded (
install_ivs_backend.sh:174
)I tried to change the region to eu-north-1 but no luck. Never mind, I deployed it to us-east-1.
2. (minor) The pattern in
hosting/S3AndCloudFront/parameters.json
contains account id which in my case have uppercase letters. And so whenever I tried to doaws push
it failed on the S3 bucket creation error. So I changed the pattern to be able to deploy it.3. (major)
stream.js:390
captureStream is not working for Firefox 100, it tells me no such method. Idk why, in Chrome it works.4. (major)
stream.js:380-404
the app tries to send data into websocket before it opens. So I put the media recorderstart(1000)
in the "open" listener to make it work5. (critical)
stream.js:397-400
mimeTypevideo/webm
is not supported by Safari (both mac/iphone), for Safari you should usevideo/mp4
. So this app will work only on Windows, Linux PC and Android. Not sure if ffmpeg will silently handle change of container.6. (critical) even with all of my fixes I can't test this app, because on fargate side ffmpeg didn't transcode stream, it prints:
FFMPEG MSG: [flv @ 0x56385e3ba380] Video codec vp8 not compatible with flv. - seems that ffmpeg command line arguments is incorrect.
So I am very surprised that this demo app is not working even for the most popular browser - Chrome.
--
Regarding to the app architecture, for me is not clear: is app intended to manage only one webrtc publisher? I know that ffmpeg does not do any intensive cpu operations when transcoding from webrtc to rtmps, but anyway at some count of publisher you can't use the same node.
Q1. Do I need to scale the instance count of fargate nodes somehow, like add node for each of the 10 publisher?
Q2. Same for ivs channel. Do I need to create a new channel for a new publisher (1 channel == 1 publisher)? So, I need to do it programmatically?
P. S. I am not trying to complain that app is not working, overall this app is doing a lot of work, so I hope to run it finally. Thank you for your work.