@@ -48,9 +48,6 @@ VideoProperties::VideoProperties( const AVFormatContext* formatContext, const si
48
48
if ( _codecContext )
49
49
_pixelProperties = PixelProperties ( _codecContext->pix_fmt );
50
50
51
- // Skip decoding for selected frames
52
- _codecContext->skip_frame = AVDISCARD_NONE;
53
-
54
51
if ( level == eAnalyseLevelFirstGop )
55
52
analyseGopStructure ( progress );
56
53
}
@@ -493,15 +490,24 @@ bool VideoProperties::hasBFrames() const
493
490
return (bool ) _codecContext->has_b_frames ;
494
491
}
495
492
493
+ // CODEC_FLAG_CLOSED_GOP is superior of INT_MAX, and _codecContext->flags is an int
494
+ // => Need a patch from FFmpeg
495
+ // bool VideoProperties::isClosedGop() const
496
+ // {
497
+ // if( ! _codecContext )
498
+ // throw std::runtime_error( "unknown codec context" );
499
+ // return ( _codecContext->flags & CODEC_FLAG_CLOSED_GOP ) == CODEC_FLAG_CLOSED_GOP;
500
+ // }
501
+
496
502
void VideoProperties::analyseGopStructure ( IProgress& progress )
497
503
{
498
504
if ( _formatContext && _codecContext && _codec )
499
505
{
500
- if ( _codec->capabilities & CODEC_CAP_TRUNCATED )
501
- _codecContext->flags |= CODEC_FLAG_TRUNCATED;
502
-
503
506
if ( _codecContext->width && _codecContext->height )
504
507
{
508
+ // Discard no frame type when decode
509
+ _codecContext->skip_frame = AVDISCARD_NONE;
510
+
505
511
AVPacket pkt;
506
512
507
513
#if LIBAVCODEC_VERSION_MAJOR > 54
@@ -595,9 +601,10 @@ PropertiesMap VideoProperties::getPropertiesAsMap() const
595
601
for ( size_t frameIndex = 0 ; frameIndex < _gopStructure.size (); ++frameIndex )
596
602
{
597
603
gop += _gopStructure.at ( frameIndex ).first ;
598
- gop += ( _gopStructure. at ( frameIndex ). second ? " * " : " " ) ;
604
+ gop += " " ;
599
605
}
600
606
detail::add ( dataMap, " gop" , gop );
607
+ // detail::add( dataMap, "isClosedGop", isClosedGop() );
601
608
602
609
detail::add ( dataMap, " hasBFrames" , hasBFrames () );
603
610
detail::add ( dataMap, " referencesFrames" , getReferencesFrames () );
0 commit comments