Sometimes I accidentaly download VR (Virtual reality) videos. I can't view VR videos on my Linux box (even on macOS its not working).
How to identify VR videos (mediainfo
or similar tool) and delete them in a folder like /torrents/complete
?
Here example video meta data:
$ mediainfo example.mp4
General
Complete name : example.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 83.1 MiB
Duration : 9 min 40 s
Overall bit rate : 1 201 kb/s
Writing application : Lavf58.0.100
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 9 min 40 s
Bit rate : 1 067 kb/s
Width : 1 440 pixels
Height : 720 pixels
Display aspect ratio : 2.000
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.041
Stream size : 73.8 MiB (89%)
Writing library : x264 core 152 r19 ba24899
Encoding settings : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x3 / me=dia / subme=1 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / 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=1 / keyint=125 / keyint_min=12 / scenecut=0 / intra_refresh=0 / rc=crf / mbtree=0 / crf=26.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
Codec configuration box : avcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 9 min 40 s
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 6 channels
Channel layout : C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 8.86 MiB (11%)
Default : Yes
Alternate group : 1
Thanks:
I used
find . -type f -name '[^.]*.mp4' -exec bash -c 'ratio=$(ffprobe -loglevel error -select_streams v:0 -show_entries stream=display_aspect_ratio -of csv=p=0 "$1"); if [[ "$ratio" == 2:1 ]]; then echo "$1"; fi' _ {} \;
It seems rtorrent
created dot files.
I only go one false positive output:
mediainfo xxx.mp4
General
Complete name : xxx.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 613 MiB
Duration : 27 min 38 s
Overall bit rate mode : Variable
Overall bit rate : 3 099 kb/s
Encoded date : UTC 2013-06-12 05:00:00
Tagged date : UTC 2013-06-12 05:00:00
Writing application : Lavf53.6.0
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 27 min 38 s
Bit rate : 3 000 kb/s
Width : 640 pixels
Height : 320 pixels
Display aspect ratio : 2.000
Frame rate mode : Constant
Frame rate : 24.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.610
Stream size : 590 MiB (96%)
Writing library : x264 core 116
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=1 / 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=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language : English
Encoded date : UTC 2013-06-12 05:00:00
Tagged date : UTC 2013-06-12 05:00:00
Codec configuration box : avcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 27 min 38 s
Bit rate mode : Variable
Bit rate : 107 kb/s
Maximum bit rate : 128 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 21.1 MiB (3%)
Language : English
Encoded date : UTC 2013-06-12 05:00:00
Tagged date : UTC 2013-06-12 05:00:00
There is no foolproof way based on the info you provided because there is nothing listed that is unique to a VR video.
However, perhaps you can assume that any video with a 2:1 Display Aspect Ratio is probably VR:
The above script will simply print the names of the files to be deleted. If these match properly you can change
echo "$f"
torm -f "$f"
.Or a recursive version using
find
:The above command will simply print the names of the files to be deleted. If these match properly you can change
echo "$1"
torm -f "$1"
.