Green frames at the beggining of rip

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
AntMadeira
Posts: 20
Joined: Tue Feb 28, 2017 4:48 pm

Green frames at the beggining of rip

Post by AntMadeira »

Hi there.
Since a few months ago, 90% of my TVrips (I don't seem to find a pattern to this, but almost all of them suffer from this) get two or three frames with green squares at the beginning.
I believe it is something in my encoding settings, but I don't have a clue which one of them.
Here's a screen of what I mean. This is always in the first 2 seconds of the rip, and only happens once.
Image

I'm using Handbrake 1.0.7 64bit with Windows 10 Home.

Here's the log of my last rip:

Code: Select all

HandBrake 1.0.7 (2017040900) - 64bit
OS: Microsoft Windows NT 10.0.16299.0 - 64bit
CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Ram: 8077 MB, 
GPU Information:
  Intel(R) HD Graphics 620 - 21.20.16.4599
  NVIDIA GeForce 940MX - 23.21.13.8873
Screen: 1366x768
Temp Dir: AppData\Local\Temp\
Install Dir: Program Files\HandBrake
Data Dir: AppData\Roaming\HandBrake Team\HandBrake\1.0.7.0

-------------------------------------------


# Starting Encode ...

[01:01:23] hb_init: starting libhb thread
[01:01:23] 1 job(s) to process
[01:01:23] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 128,
        "DRC": 0.0,
        "Encoder": 512,
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 2048
  },
  "Destination": {
    "ChapterList": [],
    "ChapterMarkers": false,
    "File": "rips TV\\I didnt cross the border - the border crossed me.[0].mp4",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": 131072
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 4,
        "Settings": {
          "mode": "7"
        }
      },
      {
        "ID": 3,
        "Settings": {
          "block-height": "16",
          "block-thresh": "40",
          "block-width": "16",
          "filter-mode": "2",
          "mode": "3",
          "motion-thresh": "1",
          "spatial-metric": "2",
          "spatial-thresh": "1"
        }
      },
      {
        "ID": 11,
        "Settings": {
          "crop-bottom": "2",
          "crop-left": "2",
          "crop-right": "2",
          "crop-top": "0",
          "height": "574",
          "width": "716"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "0"
        }
      }
    ]
  },
  "PAR": {
    "Num": 16,
    "Den": 11
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "rips TV\\[TS]2017-05-30.01.30.25- 7 #\\I didnt cross the border - the border crossed me.[0].ts"
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": false,
      "Forced": false
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": 65536,
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "vbv-maxrate=20000:level=4.0:rc-lookahead=30:vbv-bufsize=25000:ref=6:bframes=5:b-adapt=2:me=umh:subme=9:merange=24",
    "Quality": 18.0,
    "OpenCL": false,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[01:01:23] CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
[01:01:23]  - Intel microarchitecture Kaby Lake
[01:01:23]  - logical processor count: 4
[01:01:23] Intel Quick Sync Video support: yes
[01:01:23]  - Intel Media SDK hardware: API 1.21 (minimum: 1.3)
[01:01:23]  - H.264 encoder: yes
[01:01:23]     - preferred implementation: hardware (any)
[01:01:23]     - capabilities (hardware):  breftype icq+la+i+downs vsinfo opt1 opt2+mbbrc+extbrc+trellis+ib_adapt+nmpslice
[01:01:23]  - H.265 encoder: yes
[01:01:23]     - preferred implementation: hardware (any)
[01:01:23]     - capabilities (hardware):  bpyramid vsinfo opt1
[01:01:23] hb_scan: path=rips TV\[TS]2017-05-30.01.30.25- 7 #\I didnt cross the border - the border crossed me.[0].ts, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:274: failed opening UDF image rips TV\[TS]2017-05-30.01.30.25- 7 #\I didnt cross the border - the border crossed me.[0].ts
src/libbluray/disc/disc.c:352: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:352: error opening file BDMV\BACKUP\index.bdmv
[01:01:23] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[01:01:23] dvd: not a dvd - trying as a stream/file instead
[01:01:23] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[01:01:23] Found the following PIDS
[01:01:23]     Video PIDS :
[01:01:23]       0x800 type H.264 (0x1b) (PCR)
[01:01:23]     Audio PIDS :
[01:01:23]       0x801 type LATM AAC (0x11)
[01:01:23]     Subtitle PIDS :
[01:01:23]     Other PIDS :
[01:01:23]       0x20 type DVB Teletext (0x0)
[01:01:23] stream id 0x801 (type 0x11 substream 0x0) audio 0x801
[01:01:23] scan: decoding previews for title 1
[01:01:23] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[aac_latm @ 000002036af6ca80] audio config changed
[01:01:23] scan: audio 0x801: aac_latm, rate=48000Hz, bitrate=200000 Portugues (aac_latm) (2.0 ch)
[01:01:24] stream: 26 good frames, 0 errors (0%)
[01:01:24] scan: 10 previews, 720x576, 25.000 fps, autocrop = 0/2/2/2, aspect 16:9, PAR 16:11
[01:01:24] scan: supported video decoders: avcodec qsv
[01:01:24] libhb: scan thread found 1 valid title(s)
[01:01:24] starting job
[01:01:24] decomb filter thread started for segment 0
[01:01:24] decomb filter thread started for segment 1
[01:01:24] decomb filter thread started for segment 2
[01:01:24] decomb check thread started for segment 0
[01:01:24] decomb check thread started for segment 1
[01:01:24] decomb filter thread started for segment 3
[01:01:24] decomb check thread started for segment 2
[01:01:24] decomb check thread started for segment 3
[01:01:24] mask filter thread started for segment 0
[01:01:24] mask filter thread started for segment 1
[01:01:24] mask filter thread started for segment 2
[01:01:24] mask filter thread started for segment 3
[01:01:24] mask dilate thread started for segment 0
[01:01:24] mask erode thread started for segment 1
[01:01:24] mask erode thread started for segment 2
[01:01:24] mask erode thread started for segment 3
[01:01:24] mask erode thread started for segment 0
[01:01:24] mask dilate thread started for segment 1
[01:01:24] mask dilate thread started for segment 2
[01:01:24] mask dilate thread started for segment 3
[01:01:24] work: compression level not specified, track 1 setting compression level 2.00
[01:01:24] work: track 1, dithering not supported by codec
[01:01:24] yadif thread started for segment 0
[01:01:24] yadif thread started for segment 1
[01:01:24] job configuration:
[01:01:24]  * source
[01:01:24] yadif thread started for segment 2
[01:01:24]    + rips TV\[TS]2017-05-30.01.30.25 7 #\I didnt cross the border - the border crossed me.[0].ts
[01:01:24]    + title 1, chapter(s) 1 to 1
[01:01:24]  * destination
[01:01:24] yadif thread started for segment 3
[01:01:24]    + rips TV\I didnt cross the border - the border crossed me.[0].mp4
[01:01:24]    + container: MPEG-4 (libavformat)
[01:01:24]  * video track
[01:01:24]    + decoder: h264
[01:01:24]      + bitrate 200 kbps
[01:01:24]    + filters
[01:01:24]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[01:01:24]      + Decomb (mode=39)
[01:01:24]      + Framerate Shaper (mode=0)
[01:01:24]        + frame rate: same as source (around 25.000 fps)
[01:01:24]      + Crop and Scale (width=716:height=574:crop-top=0:crop-bottom=2:crop-left=2:crop-right=2)
[01:01:24]        + source: 720 * 576, crop (0/2/2/2): 716 * 574, scale: 716 * 574
[01:01:24]    + Output geometry
[01:01:24]      + storage dimensions: 716 x 574
[01:01:24]      + pixel aspect ratio: 16 : 11
[01:01:24]      + display dimensions: 1041 x 574
[01:01:24]    + encoder: H.264 (libx264)
[01:01:24]      + options: vbv-maxrate=20000:level=4.0:rc-lookahead=30:vbv-bufsize=25000:ref=6:bframes=5:b-adapt=2:me=umh:subme=9:merange=24
[01:01:24]      + quality: 18.00 (RF)
[01:01:24]  * audio track 1
[01:01:24]    + decoder: Portugues (aac_latm) (2.0 ch) (track 1, id 0x801)
[01:01:24]      + bitrate: 200 kbps, samplerate: 48000 Hz
[01:01:24]    + mixdown: Stereo
[01:01:24]    + encoder: MP3 (libmp3lame)
[01:01:24]      + bitrate: 128 kbps, samplerate: 48000 Hz
[01:01:24]      + compression level: 2.00
[01:01:24] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[01:01:24] sync: expecting 79367 video frames
[01:01:24] encx264: encoding at constant RF 18.000000
[01:01:24] encx264: unparsed options: ref=6:vbv-maxrate=20000:rc-lookahead=30:bframes=5:b-adapt=2:me=umh:subme=9:level=4.0:vbv-bufsize=25000:merange=24
x264 [info]: using SAR=16/11
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
x264 [info]: profile High, level 4.0
[01:01:24] sync: first pts video is 0
[01:01:24] sync: first pts audio 0x801 is 19242
[02:02:11] hb_ts_stream_decode - eof
[02:02:11] reader: done. 2 scr changes
[mp4 @ 000002036b061320] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 153372613 >= 153372613
[02:02:15] work: average encoding speed for job is 21.887392 fps
[02:02:15] comb detect: heavy 733 | light 2065 | uncombed 77082 | total 79880
[02:02:15] decomb: deinterlaced 733 | blended 2065 | unfiltered 77082 | total 79880
[02:02:15] vfr: lost time: 0 (0 frames)
[02:02:15] vfr: gained time: 0 (0 frames) (0 not accounted for)
[02:02:15] stream: 84870 good frames, 0 errors (0%)
[02:02:15] aac_latm-decoder done: 74885 frames, 0 decoder errors
[02:02:15] h264-decoder done: 79880 frames, 0 decoder errors
[02:02:15] sync: got 79880 frames, 79367 expected
[02:02:15] sync: framerate min 12.500 fps, max 25.000 fps, avg 25.000 fps
x264 [info]: frame I:437   Avg QP:14.82  size: 98485
x264 [info]: frame P:21763 Avg QP:17.97  size: 27809
x264 [info]: frame B:57680 Avg QP:22.42  size:  4212
x264 [info]: consecutive B-frames:  2.3%  4.5%  4.1% 82.9%  2.9%  3.3%
x264 [info]: mb I  I16..4:  5.5% 60.3% 34.2%
x264 [info]: mb P  I16..4:  0.7%  4.2%  2.3%  P16..4: 39.4% 25.7% 21.3%  0.0%  0.0%    skip: 6.3%
x264 [info]: mb B  I16..4:  0.0%  0.3%  0.2%  B16..8: 34.1%  5.8%  2.5%  direct: 4.2%  skip:52.8%  L0:34.9% L1:40.9% BI:24.2%
x264 [info]: 8x8 transform intra:57.6% inter:51.3%
x264 [info]: coded y,uvDC,uvAC intra: 89.5% 88.4% 61.0% inter: 25.3% 21.5% 2.6%
x264 [info]: i16 v,h,dc,p: 34% 23% 16% 27%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18%  9% 10%  7% 10% 13%  8% 12% 11%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 11%  6%  7% 10% 14%  8% 12% 11%
x264 [info]: i8c dc,h,v,p: 40% 23% 24% 13%
x264 [info]: Weighted P-Frames: Y:2.8% UV:1.0%
x264 [info]: ref P L0: 62.5% 14.8% 12.1%  4.7%  3.3%  2.4%  0.1%  0.0%
x264 [info]: ref B L0: 90.4%  6.6%  1.7%  0.9%  0.4%
x264 [info]: ref B L1: 98.4%  1.6%
x264 [info]: kb/s:2231.30
[02:02:16] mux: track 0, 79880 frames, 891184722 bytes, 2231.22 kbps, fifo 2048
[02:02:16] mux: track 1, 133130 frames, 51121920 bytes, 127.99 kbps, fifo 4096
[02:02:16] libhb: work result = 4

# Encode Completed ...


Deleted User 13735

Re: Green frames at the beggining of rip

Post by Deleted User 13735 »

They are most likely broadcast stream errors, and can occur randomly or not at all. If yours are at the beginning, you could trim them.
VideoRedo will correct stream and GOP erroring before introduction to Handbrake,, but may drop some bad frames too. Worth a try and a great tool. If you do a lot of this stuff.
AntMadeira
Posts: 20
Joined: Tue Feb 28, 2017 4:48 pm

Re: Green frames at the beggining of rip

Post by AntMadeira »

Hi, musicvid.
Thank you for your reply.

I thought it could be that, but I always fix videos with VideoRedo before trimming. It's strange because I don't notice anything strange after trimming the ts file with VideoRedo. This is only clearly visible after Handbrake. Also, is very strange this happens with several channels and always on the first frames of the video (after trimming commercials).
Yesterday, I tested trimming the ts file with SmartCutter, but the result was the same...
Woodstock
Veteran User
Posts: 4619
Joined: Tue Aug 27, 2013 6:39 am

Re: Green frames at the beggining of rip

Post by Woodstock »

Do the transport streams change resolution at the beginning of the video you're trying to encode?

I ask because some over-the-air broadcasts here in the US switch between resolutions at commercials, and there is a "glitch" when that happens.
Deleted User 13735

Re: Green frames at the beggining of rip

Post by Deleted User 13735 »

You are well ahead of the game if you already use VRD.
Can you post complete source properties using MediaInfo and a screenshot of a bad frame? Might be something with libav or VRD, but it's been a long time since I've seen something similar.
AntMadeira
Posts: 20
Joined: Tue Feb 28, 2017 4:48 pm

Re: Green frames at the beggining of rip

Post by AntMadeira »

Woodstock wrote: Tue Apr 10, 2018 5:37 pm Do the transport streams change resolution at the beginning of the video you're trying to encode?

I ask because some over-the-air broadcasts here in the US switch between resolutions at commercials, and there is a "glitch" when that happens.
Yes, sometimes, but it's a very low percentage of the cases. Besides, this problems doesn't happen right at the beginning and didn't happen with previous versions of Handbrake (I do this for more than 5 years and this didn't happen).


musicvid wrote: Tue Apr 10, 2018 6:23 pm You are well ahead of the game if you already use VRD.
Can you post complete source properties using MediaInfo and a screenshot of a bad frame? Might be something with libav or VRD, but it's been a long time since I've seen something similar.
Here's a rip I've done today:
Original source

Code: Select all

General
ID                          : 1101 (0x44D)
Complete name               : rips TV\[TS]2017-05-30.19.55.24-13\000.ts
Format                      : MPEG-TS
File size                   : 1.36 GiB
Duration                    : 1 h 14 min
Start time                  : UTC 2017-05-30 18:55:27
End time                    : UTC 2017-05-30 20:10:20
Overall bit rate mode       : Variable
Overall bit rate            : 2 598 kb/s
Network name                : TDT Continente
Country                     : PRT (1) / PRT (2)
Timezone                    : +01:00:00 / -00:00:00

Video
ID                          : 2048 (0x800)
Menu ID                     : 1108 (0x454)
Format                      : AVC
Format/Info                 : Advanced Video Codec
Format profile              : Main@L3
Format settings             : CABAC / 4 Ref Frames
Format settings, CABAC      : Yes
Format settings, ReFrames   : 4 frames
Codec ID                    : 27
Duration                    : 1 h 14 min
Width                       : 720 pixels
Height                      : 576 pixels
Display aspect ratio        : 16:9
Frame rate                  : 25.000 FPS
Standard                    : Component
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Interlaced
Scan type, store method     : Separated fields
Scan order                  : Top Field First
Color range                 : Limited
Color primaries             : BT.601 PAL
Transfer characteristics    : BT.470 System B, BT.470 System G
Matrix coefficients         : BT.470 System B, BT.470 System G

Audio
ID                          : 2049 (0x801)
Menu ID                     : 1108 (0x454)
Format                      : AAC
Format/Info                 : Advanced Audio Codec
Format profile              : HE-AAC / LC
Format settings             : NBC
Muxing mode                 : LATM
Codec ID                    : 17-2
Duration                    : 1 h 14 min
Bit rate mode               : Variable
Channel(s)                  : 2 channels
Channel positions           : Front: L R
Sampling rate               : 48.0 kHz / 24.0 kHz
Frame rate                  : 23.438 FPS (1024 SPF)
Compression mode            : Lossy
Delay relative to video     : -1 s 394 ms
Language                    : Portuguese

Other
ID                          : 32 (0x20)-100
Menu ID                     : 1108 (0x454)
Format                      : Teletext
Language                    : Portuguese

Menu
ID                          : 2064 (0x810)
Menu ID                     : 1108 (0x454)
Duration                    : 1 h 14 min
List                        : 32 (0x20)-100 (Teletext, pt) / 2048 (0x800) (AVC) / 2049 (0x801) (AAC, Portuguese)
Language                    : Portuguese /  / Portuguese
Service name                : RTP 3
Service type                : advanced codec SD digital television
Here's the trimmed and fixed file with VideoRedo:

Code: Select all

General
ID                          : 1 (0x1)
Complete name               : rips TV\[TS]2017-05-30.19.55.24-13\video.ts
Format                      : MPEG-TS
File size                   : 849 MiB
Duration                    : 51 min 49 s
Overall bit rate mode       : Variable
Overall bit rate            : 2 292 kb/s

Video
ID                          : 2048 (0x800)
Menu ID                     : 1108 (0x454)
Format                      : AVC
Format/Info                 : Advanced Video Codec
Format profile              : Main@L3
Format settings             : CABAC / 4 Ref Frames
Format settings, CABAC      : Yes
Format settings, ReFrames   : 4 frames
Format settings, GOP        : M=4, N=28
Codec ID                    : 27
Duration                    : 51 min 49 s
Width                       : 720 pixels
Height                      : 576 pixels
Display aspect ratio        : 16:9
Frame rate                  : 25.000 FPS
Standard                    : Component
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Interlaced
Scan type, store method     : Separated fields
Scan order                  : Top Field First
Color range                 : Limited
Color primaries             : BT.601 PAL
Transfer characteristics    : BT.470 System B, BT.470 System G
Matrix coefficients         : BT.470 System B, BT.470 System G

Audio
ID                          : 2049 (0x801)
Menu ID                     : 1108 (0x454)
Format                      : AAC
Format/Info                 : Advanced Audio Codec
Format profile              : HE-AAC / LC
Format settings             : NBC
Muxing mode                 : LATM
Codec ID                    : 17-2
Duration                    : 51 min 49 s
Bit rate mode               : Variable
Channel(s)                  : 2 channels
Channel positions           : Front: L R
Sampling rate               : 48.0 kHz / 24.0 kHz
Frame rate                  : 23.438 FPS (1024 SPF)
Compression mode            : Lossy
Delay relative to video     : -80 ms
Language                    : Portuguese

Other
ID                          : 2050 (0x802)-100
Menu ID                     : 1108 (0x454)
Format                      : Teletext
Language                    : Portuguese
And here's the result after riping with Handbrake:
https://imageshack.com/a/img922/4932/SLVCwV.png
These are 3 frames in the first second.
AntMadeira
Posts: 20
Joined: Tue Feb 28, 2017 4:48 pm

Re: Green frames at the beggining of rip

Post by AntMadeira »

Ok, I made some more tests and I think I found the problem.
It seems it has to do with the ts file.
To avoid this problem, I have to fix the ts file after trimming and not before.
I tested this with VideoRedo and Smart Cutter, and both did the trick fixing the ts after removing the commercials.

Thank you for your input. If this issue comes back again, I'll use this same topic.

Regards.
Deleted User 13735

Re: Green frames at the beggining of rip

Post by Deleted User 13735 »

You are a super sleuth!
Post Reply