Motion blur in re-encoded AVC sources
Posted: Wed Jan 22, 2014 9:09 pm
I would like to re-encode some AVC encoded videos -- mostly 1280x720p TV recordings using 'PCTV's satellite receiver USB stick software -- in order to reduce their file sizes, e.g. from 10 GB to about 2-3GB.
First attempts encoding to H264 yielded the desired file size and were 'watchable', but output videos showed significant image blur even for slow movements.
Question: How can I set up the H264 encoder in a way to reduce or get rid of motion blurs?
The sample code is abridged, the original log file is 8 MB large, due to a constantly repeated line such as "sync: video time didn't advance - dropped 2 frames (delta 60 ms, current 23004, next 30204, dur 7200)"). Encoding time appr. 5 hrs:
First attempts encoding to H264 yielded the desired file size and were 'watchable', but output videos showed significant image blur even for slow movements.
Question: How can I set up the H264 encoder in a way to reduce or get rid of motion blurs?
The sample code is abridged, the original log file is 8 MB large, due to a constantly repeated line such as "sync: video time didn't advance - dropped 2 frames (delta 60 ms, current 23004, next 30204, dur 7200)"). Encoding time appr. 5 hrs:
Code: Select all
HandBrake 0.9.9.5470 - 32bit Version
OS: Microsoft Windows NT 6.0.6002 Service Pack 2
CPU: AMD Turion(tm) 64 X2 Mobile Technology TL-56
Ram: 2813 MB, Screen: 1280x800
Temp Dir: C:\Users\Privat\AppData\Local\Temp\
Install Dir: C:\Program Files\Handbrake
Data Dir: C:\Users\Privat\AppData\Roaming\HandBrake\HandBrake\0.9.9.5470
-------------------------------------------
CLI Query: -i "F:\TV Recs\[sw] Die rote Herberge (FR 1951).mpg" -t 1 --angle 1 -c 1 -o "C:\- DVDs\[sw] Die rote Herberge (FR 1951), hDTV.mkv" -f mkv --decomb -w 960 -l 640 --crop 40:40:164:164 --modulus 16 -e x264 -q 21 -r 25 --pfr -a 1,3 -E copy,copy -6 auto,auto -R Auto,Auto -B 0,0 -D 0,0 --gain 0,0 --audio-copy-mask none --audio-fallback ffac3 -x ref=1:weightp=1:subq=2:rc-lookahead=10:trellis=0:8x8dct=0 --verbose=1
User Query: False
[12:51:21] hb_init: starting libhb thread
HandBrake 0.9.9 (2013051800) - MinGW i686 - http://handbrake.fr
2 CPUs detected
Opening F:\TV Recs\[sw] Die rote Herberge (FR 1951).mpg...
[12:51:21] hb_scan: path=F:\TV Recs\[sw] Die rote Herberge (FR 1951).mpg, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening F:\TV Recs\[sw] Die rote Herberge (FR 1951).mpg/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening F:\TV Recs\[sw] Die rote Herberge (FR 1951).mpg/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:1725: nav_get_title_list(F:\TV Recs\[sw] Die rote Herberge (FR 1951).mpg) failed (002C3180)
[12:51:21] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[12:51:21] dvd: not a dvd - trying as a stream/file instead
[12:51:21] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[12:51:21] Found the following PIDS
[12:51:21] Video PIDS :
[12:51:21] 0x100 type H.264 (0x1b) (PCR)
[12:51:21] Audio PIDS :
[12:51:21] 0x101 type MPEG1 (0x3)
[12:51:21] 0x102 type MPEG1 (0x3)
[12:51:21] 0x103 type AC3 (0x81)
[12:51:21] 0x104 type MPEG1 (0x3)
[12:51:21] Subtitle PIDS :
[12:51:21] Other PIDS :
[12:51:21] stream id 0x101 (type 0x3 substream 0x0) audio 0x101
[12:51:21] stream id 0x102 (type 0x3 substream 0x0) audio 0x102
[12:51:21] stream id 0x103 (type 0x81 substream 0x0) audio 0x103
[12:51:21] stream id 0x104 (type 0x3 substream 0x0) audio 0x104
[12:51:23] scan: decoding previews for title 1
Scanning title 1 of 1, preview 1, 10.00 %[12:51:23] scan: audio 0x103: AC-3, rate=48000Hz, bitrate=448000 Unknown (AC3) (5.1 ch)
[12:51:23] scan: audio 0x101: mp2, rate=48000Hz, bitrate=200000 Deutsch (MPEG1) (2.0 ch)
[12:51:23] scan: audio 0x102: mp2, rate=48000Hz, bitrate=200000 Francais (MPEG1) (2.0 ch)
[12:51:23] scan: audio 0x104: mp2, rate=48000Hz, bitrate=200000 Unknown (MPEG1) (2.0 ch)
Scanning title 1 of 1, preview 2, 20.00 %
Scanning title 1 of 1, preview 4, 40.00 %
Scanning title 1 of 1, preview 6, 60.00 %
Scanning title 1 of 1, preview 8, 80.00 %[12:51:24] scan: 10 previews, 1280x720, 50.000 fps, autocrop = 0/0/66/164, aspect 16:9, PAR 1:1
[12:51:24] stream: 17 good frames, 0 errors (0%)
Scanning title 1 of 1, preview 10, 100.00 %[12:51:24] libhb: scan thread found 1 valid title(s)
+ title 1:
+ stream: F:\TV Recs\[sw] Die rote Herberge (FR 1951).mpg
+ duration: 01:40:48
+ size: 1280x720, pixel aspect: 1/1, display aspect: 1.78, 50.000 fps
+ autocrop: 0/0/66/164
+ chapters:
+ 1: cells 0->0, 0 blocks, duration 01:40:48
+ audio tracks:
+ 1, Deutsch (MPEG1) (2.0 ch) (iso639-2: deu)
+ 2, Francais (MPEG1) (2.0 ch) (iso639-2: fra)
+ 3, Unknown (AC3) (5.1 ch) (iso639-2: und), 48000Hz, 448000bps
+ 4, Unknown (MPEG1) (2.0 ch) (iso639-2: und)
+ subtitle tracks:
[12:51:24] 1 job(s) to process
[12:51:24] starting job
[12:51:24] yadif thread started for segment 0
[12:51:24] yadif thread started for segment 1
[12:51:24] decomb filter thread started for segment 0
[12:51:24] decomb check thread started for segment 0
[12:51:24] mask filter thread started for segment 0
[12:51:24] mask erode thread started for segment 0
[12:51:24] mask dilate thread started for segment 0
[12:51:24] Auto Passthru: no codecs allowed
[12:51:24] Auto Passthru: fallback is AC3 (ffmpeg)
[12:51:24] Auto Passthru: passthru not possible for track 1, using fallback
[12:51:24] Auto Passthru: passthru not possible for track 2, using fallback
[12:51:24] sync: expecting 302430 video frames
[12:51:24] decomb filter thread started for segment 1
[12:51:24] job configuration:
[12:51:24] * source
[12:51:24] + F:\TV Recs\[sw] Die rote Herberge (FR 1951).mpg
[12:51:24] + title 1, chapter(s) 1 to 1
[12:51:24] * destination
[12:51:24] + C:\Users\Public\- DVDs\[sw] Die rote Herberge (FR 1951), hDTV.mkv
[12:51:24] + container: Matroska (.mkv)
[12:51:24] * video track
[12:51:24] + decoder: h264
[12:51:24] + bitrate 200 kbps
[12:51:24] + frame rate: 50.000 fps -> peak rate limited to 25.000 fps
[12:51:24] + filters
[12:51:24] + Decomb (default settings)
[12:51:24] + Framerate Shaper (2:27000000:1080000)
[12:51:24] + frame rate: 25.000 fps -> peak rate limited to 25.000 fps
[12:51:24] + Crop and Scale (960:640:40:40:164:164)
[12:51:24] + source: 1280 * 720, crop (40/40/164/164): 952 * 640, scale: 960 * 640
[12:51:24] + dimensions: 960 * 640, mod 16
[12:51:24] + encoder: H.264 (x264)
[12:51:24] + options: ref=1:weightp=1:subq=2:rc-lookahead=10:trellis=0:8x8dct=0
[12:51:24] + quality: 21.00 (RF)
[12:51:24] * audio track 1
[12:51:24] + decoder: Deutsch (MPEG1) (2.0 ch) (track 1, id 0x101)
[12:51:24] + bitrate: 200 kbps, samplerate: 48000 Hz
[12:51:24] + mixdown: Stereo
[12:51:24] + encoder: AC3 (ffmpeg)
[12:51:24] + bitrate: 224 kbps, samplerate: 48000 Hz
[12:51:24] * audio track 2
[12:51:24] + decoder: Unknown (AC3) (5.1 ch) (track 3, id 0x103)
[12:51:24] + bitrate: 448 kbps, samplerate: 48000 Hz
[12:51:24] + mixdown: 5.1 Channels
[12:51:24] + encoder: AC3 (ffmpeg)
[12:51:24] + bitrate: 640 kbps, samplerate: 48000 Hz
[12:51:24] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[12:51:24] decomb check thread started for segment 1
[12:51:24] reader: first SCR 180 id 0x100 DTS 360
[12:51:24] encx264: Encoding at constant RF 21.000000
x264 [warning]: --psnr used with psy on: results will be invalid!
x264 [warning]: --tune psnr should be used if attempting to benchmark psnr!
[12:51:24] mask filter thread started for segment 1
[12:51:24] mask erode thread started for segment 1
[12:51:24] mask dilate thread started for segment 1
x264 [info]: using cpu capabilities: MMX2 SSE2Slow SlowCTZ
x264 [info]: profile Main, level 3.1
[12:51:24] h264: "Chapter 1" (1) at frame 0 time 16200
[12:51:24] sync: first pts is 16200
[12:51:24] sync: video time didn't advance - dropped 2 frames (delta 60 ms, current 23004, next 30204, dur 7200)
<<<<<< This repeats for about 14000 lines !!!>>>>>>>
[15:31:45] sync: video time didn't advance - dropped 2 frames (delta 60 ms, current 541257804, next 541265004, dur 7200)
[15:31:45] hb_ts_stream_decode - eof
[15:31:45] reader: done. 1 scr changes
[15:31:45] sync: video time didn't advance - dropped 4 frames (delta 100 ms, current 541265004, next 541272204, dur 7200)
[15:31:45] sync: video time didn't advance - dropped 2 frames (delta 60 ms, current 541272204, next 541279404, dur 7200)
[15:31:45] sync: video time didn't advance - dropped 4 frames (delta 100 ms, current 541279404, next 541286604, dur 7200)
[15:31:45] sync: video time didn't advance - dropped 2 frames (delta 60 ms, current 541286604, next 541293804, dur 7200)
[15:31:46] sync: video time didn't advance - dropped 4 frames (delta 100 ms, current 541293804, next 541301004, dur 7200)
[15:31:46] sync: video time didn't advance - dropped 2 frames (delta 60 ms, current 541301004, next 541308204, dur 7200)
[h264 @ 002C8D40] missing picture in access unit
[h264 @ 02965FE0] no frame!
[15:31:46] work: average encoding speed for job is 7.427197 fps
[15:31:47] sync: got 71464 frames, 302430 expected
[15:31:47] decomb: deinterlaced 0 | blended 0 | unfiltered 71463 | total 71463
[15:31:47] render: 71463 frames output, 0 dropped and 0 duped for CFR/PFR
[15:31:47] render: lost time: 0 (0 frames)
[15:31:47] render: gained time: 0 (0 frames) (0 not accounted for)
[15:31:47] h264-decoder done: 300719 frames, 0 decoder errors, 0 drops
x264 [info]: frame I:863 Avg QP:17.73 size: 64875 PSNR Mean Y:45.71 U:74.89 V:69.11 Avg:47.45 Global:47.17
x264 [info]: frame P:41191 Avg QP:20.97 size: 34151 PSNR Mean Y:41.58 U:64.61 V:61.37 Avg:43.32 Global:43.13
x264 [info]: frame B:29409 Avg QP:22.70 size: 15334 PSNR Mean Y:40.52 U:62.97 V:60.30 Avg:42.25 Global:41.93
x264 [info]: consecutive B-frames: 20.5% 71.7% 6.8% 1.0%
x264 [info]: mb I I16..4: 19.4% 0.0% 80.6%
x264 [info]: mb P I16..4: 17.6% 0.0% 6.4% P16..4: 34.2% 22.3% 17.6% 0.0% 0.0% skip: 2.0%
x264 [info]: mb B I16..4: 5.7% 0.0% 0.7% B16..8: 27.3% 14.2% 3.1% direct:29.1% skip:19.9% L0:27.0% L1:36.9% BI:36.0%
x264 [info]: coded y,uvDC,uvAC intra: 90.0% 0.9% 0.0% inter: 58.0% 0.6% 0.0%
x264 [info]: i16 v,h,dc,p: 19% 11% 57% 13%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 16% 29% 4% 8% 6% 6% 6% 7%
x264 [info]: i8c dc,h,v,p: 98% 1% 1% 0%
x264 [info]: Weighted P-Frames: Y:26.6% UV:0.3%
x264 [info]: SSIM Mean Y:0.9599421 (13.973db)
x264 [info]: PSNR Mean Y:41.213 U:64.090 V:61.042 Avg:42.943 Global:42.645 kb/s:2545.39
[15:31:47] mp2-decoder done: 0 frames, 0 decoder errors, 0 drops
[15:31:47] mux: track 0, 71463 frames, 1913641871 bytes, 2545.36 kbps, fifo 512
[15:31:47] mux: track 1, 187953 frames, 168405888 bytes, 224.00 kbps, fifo 2048
[15:31:47] mux: track 2, 187954 frames, 481162240 bytes, 640.00 kbps, fifo 2048
[15:31:47] stream: 300726 good frames, 0 errors (0%)
[15:31:47] libhb: work result = 0
Encode done!
HandBrake has exited.