GNOME Bugzilla – Bug 753032
mpegtsmux: AVFoundation can not play videos muxed with mpegts if h.264 profile is high-4:4:4
Last modified: 2016-02-26 21:11:22 UTC
In case I feed x264enc with planar 4:4:4 YUV, videos aren't playable with Apple apps like QuickTime, Safari, etc. Maybe we should add more restrictions to it's sink pad? Or we shouldn't? I am not sure. gst-launch-1.0 videotestsrc num-buffers=300 ! video/x-raw,format=Y444 ! x264enc ! mpegtsmux ! filesink location=output.ts
And this a bug in GStreamer why?
I am not sure, maybe NOTABUG. Maybe thats Apple limitation or issue. Maybe we limit allowed format. Is that allowed to use that format in transport stream? Workaround for encodebin is to specify H.264 profile other than high-4:4:4 in caps of encoding profile, e.g.: caps = gst_caps_from_string("video/x-h264,profile=(string)high"); gst_encoding_video_profile_new(caps, "x264enc_preset", NULL, 0); This prevents x264enc from negotiating Y444 with it's predecessor.
You have filed this bug against mpegtsmux, not x264enc. Why is that? Does it work if you use mp4mux instead of mpegtsmux? As for x264enc, it seems to behave correctly as far as I can tell: 1) Y444 in, outputs high-4:4:4 gst-launch-1.0 videotestsrc ! video/x-raw,format=Y444 ! x264enc ! fakesink -v 2) Y444 in, with output requested to be main/high profile -> error gst-launch-1.0 videotestsrc ! video/x-raw,format=Y444 ! x264enc ! video/x-h264,profile=high ! fakesink -v 3) Y444 in + videoconvert, with output requested to be main/high profile -> converts to I420 and outputs main/high profile gst-launch-1.0 videotestsrc ! video/x-raw,format=Y444 ! videoconvert ! x264enc ! video/x-h264,profile=high ! fakesink -v
I think the answer is simply that this is not a bug in GStreamer. The high-4:4:4 profile is not something that most consumer devices will support. You should in your application request a specific H.264 profile that matches your target application and target devices instead of letting x264enc pick one based on the input. Please re-open if I misunderstood something.
> You have filed this bug against mpegtsmux, not x264enc. Why is that? Does it work if you use mp4mux instead of mpegtsmux? You are right, I have same result with mp4mux. It is playable by VLC or gst-play but unplayable via AVFoundation. > 2) Y444 in, with output requested to be main/high profile -> error > 3) Y444 in + videoconvert, with output requested to be main/high profile -> converts to I420 and outputs main/high profile Yes, and that means that video/x-h264,profile=high capsfilter after x264enc prevents x264enc from connecting to it's predecessor with Y444 format during negotiation. Thats workaround I use to make my streams be visible in Safari. I think, maybe there is some additional requirements are filed by Apple (like AU delimiters we faced few weeks ago).
Do you have any other file that contains H.264 high-4:4:4 profile video and plays fine in Safari? If yes, we can investigate.
Yes, Apple H.264 doc says: >> Three High profiles (also known as Fidelity Range Extension or FRExt). Consists of three separate High profiles (High, High 10, and High 4:2:2), intended for high-end professional uses.
>> Do you have any other file that contains H.264 high-4:4:4 profile video and plays fine in Safari? If yes, we can investigate. No, I haven't.