ORB-HD / deface

Video anonymization by face detection
MIT License
578 stars 80 forks source link

video length changed #5

Open frankenstein91 opened 3 years ago

frankenstein91 commented 3 years ago

Hello I have run one of my videos through the program over several days to make faces unrecognizable. I have already expected that there will also be false detections. These I wanted to overlay with the original video, because in my opinion it should be the same video only with faces pixelated. Unfortunately, I noticed today after several days that the source movie and destination movie are no longer the same length.

grafik

The word Laufzeit is German for playback length. I am currently trying to adjust the frame rate of the two videos.

source video:

General
Complete name                            : *.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/mp41)
File size                                : 152 GiB
Duration                                 : 55 min 15 s
Overall bit rate                         : 393 Mb/s
Writing application                      : Lavf58.45.100

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L5@Main
Codec ID                                 : hev1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 55 min 15 s
Bit rate                                 : 393 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               :  30.015008 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 1.578
Stream size                              : 152 GiB (100%)
Title                                    : Hisilicon VIDEO
Language                                 : English
Codec configuration box                  : hvcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 55 min 15 s
Bit rate mode                            : Constant
Bit rate                                 : 125 kb/s
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 49.6 MiB (0%)
Title                                    : Hisilicon AUDIO
Language                                 : English
Default                                  : Yes
Alternate group                          : 1

the defaced video:

General
Complete name                            : *_anonymized.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 28.0 GiB
Duration                                 : 55 min 14 s
Overall bit rate                         : 72.6 Mb/s
Writing application                      : Lavf58.29.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L5.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 55 min 14 s
Bit rate                                 : 72.6 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               :  30.020000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.292
Stream size                              : 28.0 GiB (100%)
Writing library                          : x264 core 159 r2991 1771b55
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=25.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Codec configuration box                  : avcC
frankenstein91 commented 3 years ago
user@MasterSystem ..ideos % ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 *_stab.mp4
99509
user@MasterSystem ..ideos % ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 *_stab_anonymized.mp4
99509
mdraw commented 3 years ago

Sorry for the late reply. Have you managed to solve this issue? I don't have any idea why the result has a different frame rate (30.015008 FPS vs. 30.020000 FPS). The frame rate of the original video is read from its metadata and is used to render the resulting video (see https://github.com/ORB-HD/deface/blob/4fd379c5/deface/deface.py#L130).

frankenstein91 commented 3 years ago

no, issue is still there. only found a workaround