Issues when injecting OD into live with RTMP

Luca

Member
Hi

When I inject a video OD from storage into a mixer live stream and the mixer stream is sent via RTMP to a Wowza server, when I connect to the video via HLS(to the wowza Server) the video is not showing correctly, it's very choppy and almost unusable, this is when the original OD video has around 25 to 30 FPS if I convert the OD video to 60FPS it is much better(but still slightly choppy), is there any optimal configuration for the mixer or the RTMP service that I can change to prevent the issue with the choppy video when we have 25/30 FPS injected OD into a mixer and sent to a wowza server?

Also, one more thing, when I inject the OD file via the API, I do not receive the newly created VOD localStreamName so I have to jump through some hoops to find out the name when I have to terminate it, is there a way you guys can return the newly created VOD localStreamName so I can keep I can save it in the application state and use it immediately when I have to switch back to the live mixer stream?


Please let me know if the above is clear enough or if you need clarification.

Thank you
 
Last edited:

Max

Administrator
Staff member
Good day.
When I inject a video OD from storage into a mixer live stream and the mixer stream is sent via RTMP to a Wowza server, when I connect to the video via HLS(to the wowza Server) the video is not showing correctly
Please try to split a case into some atomic tasks:
- is the mixer stream playing correctly form WCS via WebRTC without injection?
- is the mixer stream playing correctly form WCS via WebRTC after injection?
- is the mixer stream pushed to Wowza playing correctly via RTMP from Wowza without injection?
- is the mixer stream pushed to Wowza playing correctly via RTMP from Wowza with injection?
Also, one more thing, when I inject the OD file via the API, I do not receive the newly created VOD localStreamName so I have to jump through some hoops to find out the name when I have to terminate it
The query like
Code:
/stream/inject/startup
{
    "localStreamName":"host",
    "remoteStreamName":"vod-live://advertising.mp4"
}
is intended for one-time injection (advertising for example). The VOD stream is this case should not be reused, so you don't need a local stream name.
If you want to reuse the VOD stream, use /vod/startup with a certain local stream name. Then, you can use the name in inject case.
 

Luca

Member
Good day.

Please try to split a case into some atomic tasks:
- is the mixer stream playing correctly form WCS via WebRTC without injection?
- is the mixer stream playing correctly form WCS via WebRTC after injection?
- is the mixer stream pushed to Wowza playing correctly via RTMP from Wowza without injection?
- is the mixer stream pushed to Wowza playing correctly via RTMP from Wowza with injection?

-----RESPONSE-----

- The mixer stream is playing correctly without injection
- The mixer Stream is playing correctly after injection
- The RTMP stream pushed to Wowza is playing correctly without injection
- The RTMP stream pushed to Wowza is playing very choppy when the OD is injected into the mixer stream, the audio is fine, but the video as I said is choppy
- The RTMP stream pushed to Wowza is playing choppy even if the video FPS is converted to different values ranging from 25 to 60 FPS

------------------

The query like
Code:
/stream/inject/startup
{
    "localStreamName":"host",
    "remoteStreamName":"vod-live://advertising.mp4"
}
is intended for one-time injection (advertising for example). The VOD stream is this case should not be reused, so you don't need a local stream name.
If you want to reuse the VOD stream, use /vod/startup with a certain local stream name. Then, you can use the name in inject case.
-------RESPONSE------

Do not worry about the API response with the VOD stream name, I will just use the inject/terminate API call, that works fine to go back to the mixer original state

However I have a questions, the VOD once starts will play in a loop, is there any way to control that and have the video stopped once is ended?

Please let me know how to fix the initial problem

Thank you
 
Last edited:

Max

Administrator
Staff member
However I have a questions, the VOD once starts will play in a loop, is there any way to control that and have the video stopped once is ended?
You can disable or enable looping for a certain VOD file: VOD looping on demand
Please let me know how to fix the initial problem
The case seems a very complex: Mixer+Inject->RTMP->HLS, so it should be split to an elementary cases. Please answer the questions we asked in this post.
 

Luca

Member
You can disable or enable looping for a certain VOD file: VOD looping on demand

The case seems a very complex: Mixer+Inject->RTMP->HLS, so it should be split to an elementary cases. Please answer the questions we asked in this post.
Hi

Thank you for you answer

The response to your initial questions were already in the context of my previous message, but I added it below

-----RESPONSE-----

- The mixer stream is playing correctly without injection
- The mixer Stream is playing correctly after injection
- The RTMP stream pushed to Wowza is playing correctly without injection
- The RTMP stream pushed to Wowza is playing very choppy when the OD is injected into the mixer stream, the audio is fine, but the video as I said is choppy
- The RTMP stream pushed to Wowza is playing choppy even if the video FPS is converted to different values ranging from 25 to 60 FPS

------------------

Please let me know if any further information is needed for the time being

Thank you
 

Max

Administrator
Staff member
Please check the following:
1. Start a VOD stream (do not inject it anywhere)
2. Push the VOD stream to Wowza as RTMP
3. Is the VOD stream playing correctly from Wowza via RTMP?
If the VOD stream is choppy, please provide the file sample using this form (if the file size is near 30 M or more, place it to Google Drive or another cloud and send a link)
Please also try to enable the following parameter (WCS restart required)
Code:
h264_strict_kframe_detect=true
 
Last edited:

Luca

Member
Please check the following:
1. Start a VOD stream (do not inject it anywhere)
2. Push the VOD stream to Wowza as RTMP
3. Is the VOD stream playing correctly from Wowza via RTMP?
If the VOD stream is choppy, please provide the file sample using this form (if the file size is near 30 M or more, place it to Google Drive or another cloud and send a link)
Please also try to enable the following parameter (WCS restart required)
Code:
h264_strict_kframe_detect=true
I have tried to push the VOD directly to RTMP, but for some reason it does not reach the Wowza Server.

However, I have done the following:

- Started VOD stream from MP4 file via API

- Added the VOD Stream to a Mixer

- Push the Mixer stream to Wowza via RTMP push API


It all works well if I do it as above; however, if I inject the same video VOD file into the same mixer and stream to Wowza via RTMP API the issue with the choppy video represents itself again.

Have you been able to reproduce it yourself? if yes, what are the encoding parameters of the video you are using?

Please let me know
Thanks
 

Max

Administrator
Staff member
- Started VOD stream from MP4 file via API

- Added the VOD Stream to a Mixer

- Push the Mixer stream to Wowza via RTMP push API
In this case, the VOD file is transcoded.
if I inject the same video VOD file into the same mixer
And in this case the mixer output stream content is replaced by VOD file content
So the VOD file content seems the main reason of the issue.
Have you been able to reproduce it yourself?
No. We need a file sample to reproduce it.
what are the encoding parameters of the video you are using?
Please try to encode the file without B-frames, for example
Code:
ffmpeg -re -i source.mp4 -acodec aac -ar 48000 -vcodec h264 -preset ultrafast -profile:v baseline -filter:v fps=30 -g 60 destination.mp4
 

Luca

Member
In this case, the VOD file is transcoded.

And in this case the mixer output stream content is replaced by VOD file content
So the VOD file content seems the main reason of the issue.

No. We need a file sample to reproduce it.

Please try to encode the file without B-frames, for example
Code:
ffmpeg -re -i source.mp4 -acodec aac -ar 48000 -vcodec h264 -preset ultrafast -profile:v baseline -filter:v fps=30 -g 60 destination.mp4
If I convert the file with the above the below happens:

1. The file plays without being choppy in the HLS player using the stream from the Wowza Server

2. The video played in the HLS player using the same stream as above is pixelated(whilst the same VOD in the mixer plays perfectly fine)

I have sent the file I am using via the form you have provided

Please let me know if anything else is needed

Thank you
 

Max

Administrator
Staff member
Please try to re-encode file like this
Code:
ffmpeg -re -i source.mp4 -acodec copy -vcodec h264 -preset fast -profile:v main -g 50 -filter:v fps=25 -bf 0 -crf 23 -maxrate 4M -bufsize 2M destination.mp4
 

Luca

Member
Please try to re-encode file like this
Code:
ffmpeg -re -i source.mp4 -acodec copy -vcodec h264 -preset fast -profile:v main -g 50 -filter:v fps=25 -bf 0 -crf 23 -maxrate 4M -bufsize 2M destination.mp4
It works much better, thank you, now the video is smooth on the RTMP push and the quality is better, still a bit of pixelation, so if you think we can play with any of those ffmpeg parameters would be great
 
Top