New issue
Advanced search Search tips

Issue 921715 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

FFmpegDemuxer reports "Format conversion failed" when player video captured by getDisplayMedia API

Project Member Reported by xhw...@chromium.org, Jan 14

Issue description

Tried the demo page [1] on Windows with a debug M73 build. When playing back the video, I see a lot of logs like the following. This log is coming from FFmpegDemuxer [2], when bitstream_converter_->ConvertPacket(packet.get()) fails.

[17900:21436:0114/122213.660:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Format conversion failed."}
[17900:21436:0114/122213.693:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Format conversion failed."}
[17900:21436:0114/122213.725:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Format conversion failed."}
[17900:21436:0114/122213.755:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Format conversion failed."}
[17900:21436:0114/122213.791:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Format conversion failed."}
[17900:21436:0114/122213.830:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Format conversion failed."}
[17900:21436:0114/122213.860:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Format conversion failed."}
[17900:21436:0114/122213.890:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Format conversion failed."}
[17900:21436:0114/122213.926:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Format conversion failed."}
[17900:21436:0114/122213.955:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Format conversion failed."}
[17900:21436:0114/122213.989:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Format conversion failed."}


[1] https://webrtc.github.io/samples/src/content/getusermedia/getdisplaymedia/ 

[2] https://cs.chromium.org/chromium/src/media/filters/ffmpeg_demuxer.cc?rcl=8f1acc1bc79381110501dce1ef1424e261d8c4c9&l=441

 
We need to:
1) Suppress the log spam, e.g. using LIMITED_MEDIA_LOG.
2) Understand why ConvertPacket is failing.
FWIW, info from chrome://media-internals:

bitrate	0
duration	unknown
error	Format conversion failed.
event	SUSPENDED
for_suspended_start	false
found_audio_stream	false
found_video_stream	true
frame_title	getDisplayMedia
frame_url	https://webrtc.github.io/samples/src/content/getusermedia/getdisplaymedia/
height	1440
info	Effective playback rate changed from 0 to 1
is_platform_video_decoder	true
max_duration	kInfiniteDuration
origin_url	https://webrtc.github.io/
pipeline_buffering_state	BUFFERING_HAVE_ENOUGH
pipeline_state	kSuspended
player_id	1
range_header_supported	true
render_id	8
single_origin	true
start_time	0
streaming	false
surface_layer_mode	kOnDemand
time_base	1/1000
total_bytes	1342415
url	blob:https://webrtc.github.io/6157789d-611f-4c86-9382-8857ec399b40
video_buffering_state	BUFFERING_HAVE_ENOUGH
video_codec_name	h264
video_dds	false
video_decoder	MojoVideoDecoder
video_format	PIXEL_FORMAT_I420
video_is_encrypted	false
width	2560
Hmm, I wonder if recorder is writing them already in annexb format.
It turned out the |stream_codec_parameters_->extradata| is null. Any idea what that means and how that could happen? I am not familiar with this code :)

https://cs.chromium.org/chromium/src/media/filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc?rcl=0692410369582ff412054fb672f3912553eefb1c&l=33

I'd guess it's not muxed into the stream correctly. It's probably okay if the content is already in annexB. Does it play correctly?
Yes, it plays fine.
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 16 (6 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/917912ae2272a73e898bf4c817c90c2e1accf7fe

commit 917912ae2272a73e898bf4c817c90c2e1accf7fe
Author: Xiaohan Wang <xhwang@chromium.org>
Date: Wed Jan 16 18:42:32 2019

media: Change ConvertPacket() MediaLog to DVLOG in FFmpegDemuxerStream

There are cases where we could get a lot of ConvertPacket() errors
without failing the playback. Hence, use DVLOG instead of MediaLogs.
If the video plays fine we don't care about these logs. If it fails we
should get some (potentially more useful) log from the video decoder.

Also add DVLOGs in ffmpeg_h264_to_annex_b_bitstream_converter.cc for
debugging the Bug.

Bug: 921715
Change-Id: I1d684552da83c7342850dc5bb0c7b6f5d9b6b76c
Reviewed-on: https://chromium-review.googlesource.com/c/1409728
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623309}
[modify] https://crrev.com/917912ae2272a73e898bf4c817c90c2e1accf7fe/media/filters/ffmpeg_demuxer.cc
[modify] https://crrev.com/917912ae2272a73e898bf4c817c90c2e1accf7fe/media/filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc

Sign in to add a comment