Opened 7 years ago

Last modified 7 years ago

#6730 new defect

Intel QSV segment problem

Reported by: Rashad Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: zhong.li@intel.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

When try to use segment option of ffmpeg with hevc_qsv ffmpeg can not split files and continue writing to first created file. Also we tested it with x265 it works very well:
Command line:

./ffmpeg -v 9 -loglevel 40 -i udp://227.0.1.1:1001 -c:v hevc_qsv -load_plugin hevc_hw -pix_fmt nv12 -q 20 -profile:v 1 -preset medium -level:v 51 -b:v 2600k -g 90 -f segment -segment_time 5 -segment_list_type flat -segment_list stream.m3u8 -y -segment_format mpegts stream%05d.ts

[mpegts @ 0x3a638a0] max_analyze_duration 5000000 reached at 5016000 microseconds st:1
Input #0, mpegts, from 'udp://227.0.1.1:1001':

Duration: N/A, start: 84695.942489, bitrate: N/A
Program 23150

Metadata:

service_name : ▒▒▒ӧ▒▒ߧ▒ӧ▒▒
service_provider: noprovider

Stream #0:0[0x2ef]: Video: h264 (Main), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first, left), 720x576 [SAR 16:11 DAR 20:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x2f0](rus): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s

[graph 0 input from stream 0:0 @ 0x3acdb00] w:720 h:576 pixfmt:yuv420p tb:1/90000 fr:25/1 sar:16/11 sws_param:flags=2
[auto-inserted scaler 0 @ 0x3d5b040] w:iw h:ih flags:'bicubic' interl:0
[format @ 0x3ae5ca0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[auto-inserted scaler 0 @ 0x3d5b040] w:720 h:576 fmt:yuv420p sar:16/11 -> w:720 h:576 fmt:nv12 sar:16/11 flags:0x4
[graph 1 input from stream 0:1 @ 0x3b467a0] tb:1/48000 samplefmt:s16p samplerate:48000 chlayout:0x3
[audio format for output stream 0:1 @ 0x3b3c700] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:1'
[auto-inserted resampler 0 @ 0x3d92100] ch:2 chl:stereo fmt:s16p r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[h264 @ 0x3b3c920] Ignoring NAL type 9 in extradata
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function vaDriverInit_0_32
libva info: va_openDriver() returns 0
[hevc_qsv @ 0x3adda20] mfx initialization: /dev/dri/renderD128 vaInitialize successful
[hevc_qsv @ 0x3adda20] Initialized an internal MFX session using hardware accelerated implementation
[hevc_qsv @ 0x3adda20] Using the constant quantization parameter (CQP) ratecontrol method
[hevc_qsv @ 0x3adda20] profile: simple; level: 51
[hevc_qsv @ 0x3adda20] GopPicSize: 90; GopRefDist: 9; GopOptFlag: closed ; IdrInterval: 0
[hevc_qsv @ 0x3adda20] TargetUsage: 4; RateControlMethod: CQP
[hevc_qsv @ 0x3adda20] QPI: 16; QPP: 20; QPB: 26
[hevc_qsv @ 0x3adda20] NumSlice: 1; NumRefFrame: 5
[hevc_qsv @ 0x3adda20] RateDistortionOpt: unknown
[hevc_qsv @ 0x3adda20] RecoveryPointSEI: unknown IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0
[hevc_qsv @ 0x3adda20] MaxFrameSize: 0; MaxSliceSize: 0;
[hevc_qsv @ 0x3adda20] BitrateLimit: unknown; MBBRC: OFF; ExtBRC: unknown
[hevc_qsv @ 0x3adda20] Trellis: auto
[hevc_qsv @ 0x3adda20] RepeatPPS: OFF; NumMbPerSlice: 0; LookAheadDS: unknown
[hevc_qsv @ 0x3adda20] AdaptiveI: unknown; AdaptiveB: unknown; BRefType: pyramid
[hevc_qsv @ 0x3adda20] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0
[segment @ 0x3b3e640] Opening 'stream.m3u8' for writing
[segment @ 0x3b3e640] Selected stream id:0 type:video
[segment @ 0x3b3e640] Opening 'stream00000.ts' for writing
[mpegts @ 0x3d37780] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
Output #0, segment, to 'stream%05d.ts':

Metadata:

encoder : Lavf57.56.101
Stream #0:0: Video: hevc (hevc_qsv), 1 reference frame, nv12(left), 720x576 [SAR 16:11 DAR 20:11], q=2-31, 2600 kb/s, 25 fps, 90k tbn, 25 tbc
Metadata:

encoder : Lavc57.64.101 hevc_qsv

Side data:

cpb: bitrate max/min/avg: 0/0/2600000 buffer size: 0 vbv_delay: -1

Stream #0:1(rus): Audio: mp2, 48000 Hz, stereo, s16, delay 481, 384 kb/s
Metadata:

encoder : Lavc57.64.101 mp2

Stream mapping:

Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_qsv))
Stream #0:1 -> #0:1 (mp2 (native) -> mp2 (native))

Press [q] to stop, ? for help
[h264 @ 0x3b3c920] Reinit context to 720x576, pix_fmt: yuv420p
[h264 @ 0x3b3c920] reference picture missing during reorder
[h264 @ 0x3b3c920] Missing reference picture, default is 2147483647
[h264 @ 0x3aad0a0] mmco: unref short failure

Last message repeated 1 times

[h264 @ 0x3aad0a0] number of reference frames (0+5) exceeds max (4; probably corrupt input), discarding one
[h264 @ 0x3f59b60] reference picture missing during reorder
[h264 @ 0x3f59b60] Missing reference picture, default is 65332
[h264 @ 0x3f2d9a0] mmco: unref short failure
[h264 @ 0x3ab8e40] mmco: unref short failure
[h264 @ 0x3b3c920] mmco: unref short failure
* 42 dup!
[segment @ 0x3b3e640] segment:'stream00000.ts' starts with packet stream:0 pts:14400 pts_time:0.16 frame:0
[segment @ 0x3b3e640] segment:'stream00000.ts' count:0 ended=N/A dup=42 drop=0 speed=1.03x
frame= 4086 fps= 26 q=-0.0 Lsize=N/A time=00:02:43.24 bitrate=N/A dup=42 drop=0 speed=1.03x
video:44270kB audio:7628kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (udp://227.0.1.1:1001):

Input stream #0:0 (video): 8049 packets read (44301179 bytes); 4045 frames decoded;
Input stream #0:1 (audio): 6780 packets read (3921100 bytes); 6780 frames decoded (7810560 samples);
Total: 14829 packets (48222279 bytes) demuxed

Output file #0 (stream%05d.ts):

Output stream #0:0 (video): 4086 frames encoded; 4086 packets muxed (45332511 bytes);
Output stream #0:1 (audio): 6780 frames encoded (7810560 samples); 6780 packets muxed (7810560 bytes);
Total: 10866 packets (53143071 bytes) muxed

Exiting normally, received signal 2.

Change History (2)

comment:1 by Rashad, 7 years ago

Tested with all last versions of ffmpeg

comment:2 by Zhong,Li, 7 years ago

Cc: zhong.li@intel.com added
Reproduced by developer: set

Reproduced.
Looks h264_qsv also works well (./ffmpeg -v 9 -loglevel 40 -f rawvideo -pix_fmt yuv420p -s:v 176x144 -i /mnt/Videos/cif_400k.yuv -c:v hevc_qsv -b:v 2600k -g 50 -f segment -segment_time 5 -segment_list_type flat -segment_list h264_stream.m3u8 -y -segment_format mpegts h264_stream%05d.ts) but hevc_qsv failed.

Note: See TracTickets for help on using tickets.