H264 encoded mpegts stream doesnt play

Hello,

I a using latest Wowza server on Linux.

We are streaming a H264 encoded video via mpegts to wowza & viewing using a flash client.

It works perfectly if there are no B-frames, but if we enable B-frames, wowza seems to do generate wrong stream, where the video seems to be dropping B-frames.

If we use directly VLC instead of Wowza it works perfectly.

Can you please tell if B-frames are not supported in Wowza or is there some issue with mpegts having Bframes ?

Thanks

Kapil

First, be sure to update to Wowza 2.2. The b-frame problems in generally a player issue and not a Wowza issue. What encoder are you using. Which player technology. What are the exact encoder settings.

Charlie

I have seen Flash have problems with B-frames. Are you seeing the problems when you play the stream back using Flash?

Charlie

What happens if you use the same method to encode the stream, you save it to an MP4 file, and play it back in Flash using progressive download?

Charlie

I am trying to understand if it is a Flash problem or a Wowza problem. If you generate an MP4 file from gstreamer that includes the same multiple b-frames and it plays properly then it is a good indication that it could be a Wowza problem. If the MP4 file does not play properly then it is most likely a Flash problem. Quicktime is probably not that interesting of a test. The RTP mechanism in QuickTime has not been touched in years. There is a good chance it is just out of date.

Charlie

Post the complete .ts file from the gstreamer encoder somewhere for me to download and test (support@wowza.com). Be sure to reference this forum post.

Charlie

This was the last comment in the associated ticket:

We have resolved the issue, there was a bug in gstreamer.

Thanks

Here is everything:


Hello Charlie,

We have resolved the issue, there was a bug in gstreamer.

Thanks

gst-kaps


Charlie, Nov 24 11:04 am (CST):

No, we need both with B-frames.

Charlie


gst-kaps, Nov 24 10:26 am (CST):

Since you expect the sequence in decoding order, even if dts is not

there, but just pts is there I suppose it should be able to reconstruct

? Thats what VLC, etc player does.

  • gst-kaps

support@wowza.com wrote:


Charlie, Nov 24 07:38 am (CST):

We need both pts and dts value when doing streaming using B-frames. With B-frames, frames are sent out of order. They are sent to Wowza in decoding order and not presentation order. The pts and dts values help us instruct the player how to handle the out of order frames.

Charlie


gst-kaps, Nov 24 03:57 am (CST):

Thanks Charlie,

I verified with vlc based on your mail and it seems gstreamer has a bug.

Thanks for help me out.

Can you please help me understand if inside ts, dts values would be

important for wowza to decode Bframes properly ?

Or just pts would suffice ?

Regards

gst-kaps

support@wowza.com wrote:


Charlie, Nov 23 02:02 pm (CST):

I really don’t have an answer for you.

First, I tried to use VLC to turn your .ts file into a live TS stream for playback through Wowza. I used VLC 1.1.5 with this command:

vlc -vvv “C:\Users\cgood\Desktop\scratch\mediamagictechnologies\news_scroll-notworking-with-wowza.ts” --sout “#duplicate{dst=udp{dst=127.0.0.1:1234},dst=display}”

The stream did not look played back through VLC and looked equally messed up in Flash played through Wowza.

Next, I ran your stream through VLC and re-encoding it using multiple B-frames. This stream played fine in Flash when streamed through Wowza. So it is

something with the G-streamer encode that is not playing well in Flash. The VLC command I used was:

vlc -vvv “C:\Users\cgood\Desktop\scratch\mediamagictechnologies\news_scroll-notworking-with-wowza.ts” --sout “#transcode{venc=x264{keyint=60,profile=main,bframes=2},vcodec=x264,vb=500,scale=1,acodec=mp4a,ab=128,channels=2,samplerate=48000}:rtp{dst=127.0.0.1,mux=ts,port=10000}”

Using FFmpeg, I tried to take the .ts file and re-containerize it into a .mp4 or .flv container for direct playback in flash (removing Wowza from the equation) but I kept getting the error “non-monotone timestamps”. So I could not convert the .ts file to an .mp4 file for direct playback.

So I do not believe it is a general issue with B-frames and Wowza. I believe it is an issue with how the GStreamer encode is structured when using B-frames that is not compatible with Wowza or with Flash.

Charlie


Richard

Hi there … searching about issue i have when I encode using B frames, and send it out through Wowza, I found this thread

Is this something that has been solved with any patch?

I’d appreciate if you can share what happened with this case

Thanks

Thanks Charlie,

We are using Wowza 2.2.0

Our gstreamer pipleline looks like this

gst-launch-0.10 filesrc location=~/Desktop/news_scroll ! decodebin2 ! x264enc bframes=2 ! mpegtsmux ! udpsink host=192.168.1.125 port=40000

You can download the new_scroll from http://www.youtube.com/watch?v=Xc2xs7POefg

The news scroll thats moving can show you the bug. If I play the udp stream directly via vlc it works great.

Also if we save the file by using

gst-launch-0.10 filesrc location=~/Desktop/news_scroll ! decodebin2 ! x264enc bframes=2 ! mpegtsmux ! filesink location=news_scroll.ts

and play the file news_scroll.ts it works perfectly.

Please comment.

  • Kapil

yes I see that in flash as well as in the quicktime player on iphone & mac ?

We want to play using mpegts, how would using a mp4 file help ? also as I said its not just on flash , the same issue is seen in quicktime on mac ?

Maybe can you please confirm working of wowza perfectly using the above mentioned video, when you encode using H264 ,B-frames via mpegts ?

In Quicktime I am using the iphone http live streaming via mpegts, which is not rtp ?

Also as I mentioned the gstreamer generated mpegts udp stream, works perfectly if I use VLC directly instead of wowza, which posssibly might give some clue that wowza is breaking/not liking something, that is ok with VLC ?

kapil