New issue
Advanced search Search tips

Issue 715398 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

mp4 that used to be playable can no longer be played

Reported by k...@secondspectrum.com, Apr 26 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Firefox/52.0

Example URL:

Steps to reproduce the problem:
1. Open the attached short.mp4 in chrome

What is the expected behavior?
Video plays

What went wrong?
Video doesn't play, loading animation in tab keeps running

Did this work before? N/A 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes

Chrome version: 58.0.3029.81  Channel: stable
OS Version: OS X 10.12
Flash Version: 25.0.0.148

Contents of chrome://gpu: 
Graphics Feature Status
Canvas: Hardware accelerated
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Native GpuMemoryBuffers: Hardware accelerated
Rasterization: Hardware accelerated
Video Decode: Hardware accelerated
Video Encode: Hardware accelerated
VPx Video Decode: Hardware accelerated
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
Driver Bug Workarounds
add_and_true_to_loop_condition
adjust_src_dst_region_for_blitframebuffer
decode_encode_srgb_for_generatemipmap
disable_framebuffer_cmaa
disable_multimonitor_multisampling
disable_webgl_rgb_multisampling_usage
emulate_abs_int_function
get_frag_data_info_bug
init_two_cube_map_levels_before_copyteximage
msaa_is_slow
pack_parameters_workaround_with_pack_buffer
rebind_transform_feedback_before_resume
regenerate_struct_names
remove_invariant_and_centroid_for_essl3
reset_base_mipmap_level_before_texstorage
rewrite_texelfetchoffset_to_texelfetch
scalarize_vec_and_mat_constructor_args
set_zero_level_before_generating_mipmap
unfold_short_circuit_as_ternary_operation
unpack_alignment_workaround_with_unpack_buffer
unpack_image_height_workaround_with_unpack_buffer
use_intermediary_for_copy_texture_image
use_unused_standard_shared_blocks
Problems Detected
Multisampling is buggy on OSX when multiple monitors are connected: 237931
Applied Workarounds: disable_multimonitor_multisampling
Unfold short circuit on Mac OS X: 307751
Applied Workarounds: unfold_short_circuit_as_ternary_operation
Always rewrite vec/mat constructors to be consistent: 398694
Applied Workarounds: scalarize_vec_and_mat_constructor_args
Mac drivers handle struct scopes incorrectly: 403957
Applied Workarounds: regenerate_struct_names
On Intel GPUs MSAA performance is not acceptable for GPU rasterization: 527565
Applied Workarounds: msaa_is_slow
glGenerateMipmap fails if the zero texture level is not set on some Mac drivers: 560499
Applied Workarounds: set_zero_level_before_generating_mipmap
Pack parameters work incorrectly with pack buffer bound: 563714
Applied Workarounds: pack_parameters_workaround_with_pack_buffer
Alignment works incorrectly with unpack buffer bound: 563714
Applied Workarounds: unpack_alignment_workaround_with_unpack_buffer
copyTexImage2D fails when reading from IOSurface on multiple GPU types.: 581777
Applied Workarounds: use_intermediary_for_copy_texture_image
Multisample renderbuffers with format GL_RGB8 have performance issues on Intel GPUs.: 607130
Applied Workarounds: disable_webgl_rgb_multisampling_usage
Limited enabling of Chromium GL_INTEL_framebuffer_CMAA: 535198
Applied Workarounds: disable_framebuffer_cmaa
glGetFragData{Location|Index} works incorrectly on Max: 638340
Applied Workarounds: get_frag_data_info_bug
glResumeTransformFeedback works incorrectly on Intel GPUs: 638514
Applied Workarounds: rebind_transform_feedback_before_resume
glTexStorage* are buggy when base mipmap level is not 0: 640506
Applied Workarounds: reset_base_mipmap_level_before_texstorage
Result of abs(i) where i is an integer in vertex shader is wrong: 642227
Applied Workarounds: emulate_abs_int_function
Rewrite texelFetchOffset to texelFetch for Intel Mac: 642605
Applied Workarounds: rewrite_texelfetchoffset_to_texelfetch
Rewrite condition in for and while loops for Intel Mac: 644669
Applied Workarounds: add_and_true_to_loop_condition
Decode and encode before generateMipmap for srgb format textures on macosx: 634519
Applied Workarounds: decode_encode_srgb_for_generatemipmap
Init first two levels before CopyTexImage2D for cube map texture on Intel Mac 10.12: 648197
Applied Workarounds: init_two_cube_map_levels_before_copyteximage
Insert statements to reference all members in unused std140/shared blocks on Mac: 618464
Applied Workarounds: use_unused_standard_shared_blocks
Tex(Sub)Image3D performs incorrectly when uploading from unpack buffer with GL_UNPACK_IMAGE_HEIGHT greater than zero on Intel Macs: 654258
Applied Workarounds: unpack_image_height_workaround_with_unpack_buffer
adjust src/dst region if blitting pixels outside read framebuffer on Mac: 644740
Applied Workarounds: adjust_src_dst_region_for_blitframebuffer
Mac driver GL 4.1 requires invariant and centroid to match between shaders: 639760, 641129
Applied Workarounds: remove_invariant_and_centroid_for_essl3
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Version Information
Data exported	4/26/2017, 10:29:22 AM
Chrome version	Chrome/58.0.3029.81
Operating system	Mac OS X 10.12.4
Software rendering list version	12.20
Driver bug list version	9.36
ANGLE commit id	461d9a3060e3
2D graphics backend	Skia/58 4c81ba6ba3a3270db809bf7d4c3bc782694a56a4
Command Line Args	Chrome.app/Contents/MacOS/Google Chrome --flag-switches-begin --flag-switches-end
Driver Information
Initialization time	72
In-process GPU	false
Passthrough Command Decoder	false
Sandboxed	true
GPU0	VENDOR = 0x8086, DEVICE= 0x0a2e *ACTIVE*
Optimus	false
Optimus	false
AMD switchable	false
Driver vendor	
Driver version	10.24.45
Driver date	
Pixel shader version	4.10
Vertex shader version	4.10
Max. MSAA samples	8
Machine model name	MacBookPro
Machine model version	11.1
GL_VENDOR	Intel Inc.
GL_RENDERER	Intel Iris OpenGL Engine
GL_VERSION	4.1 INTEL-10.24.45
GL_EXTENSIONS	GL_ARB_blend_func_extended GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5 GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_occlusion_query2 GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_subroutine GL_ARB_shading_language_include GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_vertex_attrib_64bit GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_EXT_texture_sRGB_decode GL_APPLE_client_storage GL_APPLE_container_object_shareable GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_texture_range GL_ATI_texture_mirror_once GL_NV_texture_barrier
Disabled Extensions	GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent
Window system binding vendor	
Window system binding version	
Window system binding extensions	
Direct rendering	Yes
Reset notification strategy	0x0000
GPU process crash count	0
Compositor Information
Tile Update Mode	Zero-copy
Partial Raster	Enabled
GpuMemoryBuffers Status
ATC	Software only
ATCIA	Software only
DXT1	Software only
DXT5	Software only
ETC1	Software only
R_8	GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
RG_88	Software only
BGR_565	Software only
RGBA_4444	Software only
RGBX_8888	Software only
RGBA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE
BGRX_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE
BGRA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
YVU_420	Software only
YUV_420_BIPLANAR	GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
UYVY_422	GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT

Video works if we re-transcode it, however this version of the video worked for years in previous versions of chrome  (not sure when it stopped working, but must have been recent) and it continues to work as-is in firefox
 
short.mp4
1.1 MB View Download
Cc: sande...@chromium.org
Owner: dalecur...@chromium.org
Status: Assigned (was: Unconfirmed)
This is an "FFmpegDemuxer: unfixable negative timestamp" case.
Interesting, what do the timestamps coming out look like? I didn't think it was possible for mp4 to produce negative timestamps.
Also we should make this is not a bug in ffmpeg.
[PACKET]
codec_type=video
stream_index=0
pts=0
pts_time=0.000000
dts=N/A
dts_time=N/A
duration=512
duration_time=0.040000
convergence_duration=N/A
convergence_duration_time=N/A
size=117069
pos=1423
flags=K
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=512
pts_time=0.040000
dts=N/A
dts_time=N/A
duration=512
duration_time=0.040000
convergence_duration=N/A
convergence_duration_time=N/A
size=27559
pos=118492
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=-512
pts_time=-0.040000
dts=-512
dts_time=-0.040000
duration=512
duration_time=0.040000
convergence_duration=N/A
convergence_duration_time=N/A
size=6715
pos=146051
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=1024
pts_time=0.080000
dts=-512
dts_time=-0.040000
duration=512
duration_time=0.040000
convergence_duration=N/A
convergence_duration_time=N/A
size=26454
pos=152766
flags=_
[/PACKET]
Notes about this MP4 metadata:
  - The first three frames have DTS values separated by 0.00008 s. Most tools show them as all having DTS = 0.
  - PTS values look reasonable, separated by 0.04s each, but after the first three frames the rounding is all wrong.
  - The first decoded frame is not the first displayed frame.
  - The edit list shifts the first decoded frame to PTS 0. (This shifts the third PTS to -0.04 s.)

It looks to me like something tried to shift the first displayed frame (third decoded frame) to time zero by editing the DTS values, but then corrected for negative DTS values by shifting the first three frames to start at zero and be separated by 1 time unit each.

The edit list makes the same edit, resulting in negative PTS values.
Actually, the PTS values after the first three frames are wonky too, presumably also caused by the attempted fix for negative DTS values; the result is that there is a frame at 0.0399s (frame 4) and also one at 0.04s (frame 2). This is playable but probably not the intended display order, and although I didn't check, probably does not match the encoded ordering.
remuxing without re-encoding results in these errors:

[mp4 @ 0x7f8db2817c00] Non-monotonous DTS in output stream 0:0; previous: -456, current: -512; changing to -455. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7f8db2817c00] Non-monotonous DTS in output stream 0:0; previous: -455, current: -512; changing to -454. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7f8db2817c00] Non-monotonous DTS in output stream 0:0; previous: 512, current: 512; changing to 513. This may result in incorrect timestamps in the output file.

I'd recommend just re-encoding the file with proper timestamps, I'm fairly confident it's busted, so it's mostly luck that it plays without stuttering or other issues.
This command will fix without a re-encode, it just shifts the start time to be 0.08 and the remuxing fixes up the odd ordering.

ffmpeg -i short.mp4 -vcodec copy -ss -0.08 short_fixed.mp4

[PACKET]
codec_type=video
stream_index=0
pts=1024
pts_time=0.080000
dts=0
dts_time=0.000000
duration=512
duration_time=0.040000
convergence_duration=N/A
convergence_duration_time=N/A
size=117069
pos=48
flags=K_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=1536
pts_time=0.120000
dts=1
dts_time=0.000078
duration=512
duration_time=0.040000
convergence_duration=N/A
convergence_duration_time=N/A
size=27559
pos=117117
flags=__
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=512
pts_time=0.040000
dts=2
dts_time=0.000156
duration=512
duration_time=0.040000
convergence_duration=N/A
convergence_duration_time=N/A
size=6715
pos=144676
flags=_D
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=2048
pts_time=0.160000
dts=3
dts_time=0.000234
duration=512
duration_time=0.040000
convergence_duration=N/A
convergence_duration_time=N/A
size=26454
pos=151391
flags=__
[/PACKET]

Status: WontFix (was: Assigned)
Marking as WontFix given the issues with the clip. I realize it plays elsewhere, but we can't make guarantees about clips that have invalid muxing and it's better to fail fast then let silent or less clear issues linger.
Just want to be clear that it also played in previous versions of Chrome. Providing a depreciation warning (in the console) for one or two versions would be helpful in providing content owners some time to re-transcode [potentially huge] existing libraries.
For anyone else who runs into this problem, we are creating slices of videos on the fly (without the cost of transcoding). Adding the -avoid_negative_ts make_zero to ffmpeg resolves the issue. One of our developers found this relevant thread:
https://github.com/mifi/lossless-cut/pull/13
Thanks for the note on how to fix clips. Sorry this was part of a security fix and was invalid behavior which we didn't see any usage of, so we didn't provide a notice for it.
Cc: dalecur...@chromium.org
 Issue 721451  has been merged into this issue.

Comment 15 by phistuck@gmail.com, May 15 2017

#14 - but if other browsers accept them, perhaps Chrome should, too.

Sign in to add a comment