GNOME Bugzilla – Bug 796467
msdk: the dumped file has garbage in every frame when decode the mpeg2 encoded file
Last modified: 2018-06-06 05:39:20 UTC
Test Env: ============================================ Platform: APL/KBL Arch: x86_64 Linux release 16.04 Kernel: 4.12.0-rc2 libva https://github.com/01org/libva.gitb commit 3be72a5a110880f70626d7c3bed953cdde124b2 media_driver https://github.com/intel/media-driver commit 1c2b0615d749c45c07f9aee6586774816989c5b3 MediaSDK: https://github.com/Intel-Media-SDK/MediaSDK commit 7c2b069dce7bed268806f680412a2f3b09a52ce9 gst-bad master branch 0bdcf51baf77926b4f29c01a2fdf133c13aad62e Reproduce Steps: ============================================ take one case for example 1. build enc as above lists 2. gst-launch-1.0 -f filesrc location=/media/encoderbitstreams//720p5994_parkrun_ter.yuv '!' videoparse format=i420 width=1280 height=720 framerate=30 '!' videoconvert '!' video/x-raw,format=NV12 '!' msdkmpeg2enc rate-control=cqp qpi=26 qpp=26 qpb=26 gop-size=30 b-frames=0 '!' mpegvideoparse '!' mpegtsmux '!' filesink location=./720p5994_parkrun_i420_profilemain_rc0_ip_qp26_slice1_gop30_fps30.mpg 3. gst-launch-1.0 -f -q filesrc location=./720p5994_parkrun_i420_profilemain_rc0_ip_qp26_slice1_gop30_fps30.mpg '!' mpegvideoparse '!' msdkmpeg2dec '!' videoconvert '!' ximagesink
1. gst-launch-1.0 -f filesrc location=/media/encoderbitstreams//720p5994_parkrun_ter.yuv '!' videoparse format=i420 width=1280 height=720 framerate=30 '!' videoconvert '!' video/x-raw,format=NV12 '!' msdkmpeg2enc rate-control=cqp qpi=26 qpp=26 qpb=26 gop-size=30 b-frames=0 '!' mpegvideoparse '!' mpegtsmux '!' filesink location=./720p5994_parkrun_i420_profilemain_rc0_ip_qp26_slice1_gop30_fps30.mpg 2. gst-launch-1.0 -f -q filesrc location=./720p5994_parkrun_i420_profilemain_rc0_ip_qp26_slice1_gop30_fps30.mpg '!' mpegvideoparse '!' mfxmpeg2dec '!' videoconvert '!' ximagesink mplayer ./720p5994_parkrun_i420_profilemain_rc0_ip_qp26_slice1_gop30_fps30.mpg use mfx instead of msdk, it also has garbage use mplayer to play the encoded file, the file can be palyed clearly.
If using mpegtsmux during encode, you need to use tsdemux before mpegvideoparse in decode pipeline.
Or just remove mpegtsmux from encode pipeline
The option "mpegtsmux" should using conjunction with "tsdemux", after remove "mpegtsmux" from encode pipeline, this issue can not be duplicated, so close it.