Page 1 of 1

Sort and move hevc videos

Posted: 15 Jun 2021, 21:47
by rsmehdi
Hi all
I have a folder under Ubuntu server with hundreds of videos (mkv, mp4) which are in h264 and h265 (hevc) format.
I would like to find 1 solution to sort and move all the hevc videos to a separate folder and leave the h264 in the same place.

Each video is placed in 1 separate folder, this way:

Code: Select all

/home/files/videos/charlie2020/charlie2020.mkv
thank you

Re: Sort and move hevc videos

Posted: 16 Jun 2021, 03:28
by rednoah
e.g. you can use Plain File Mode for organizing files based on MediaInfo properties:

Code: Select all

filebot -rename -r /home/files/videos --db file --output /home/files/by/codec --format "{video[0].Format}/{fn}"

:idea: You can add the --filter option to select HEVC files only:

Code: Select all

--filter "video[0].Format =~ /HEVC/"

:idea: Use --action TEST for testing.

Re: Sort and move hevc videos

Posted: 16 Jun 2021, 11:51
by rsmehdi
Thanks for your help
I'm a beginner and don't know where to start.
Can you give me the steps to use this command.
My files are on an ubuntu 20.10 server without gui.
I installed filebot as well .
But I don't know where to start moving the hevc movies to 1 other folder.
Thank you in advance for your help

Re: Sort and move hevc videos

Posted: 16 Jun 2021, 11:59
by rednoah
  1. Log-in via SSH
  2. Copy and paste the command above:

    Code: Select all

    filebot -rename -r /home/files/videos --db file --output /home/files/by/codec --format "{video[0].Format}/{fn}" --filter "video[0].Format =~ /HEVC/" --action TEST
  3. (optionally) Adjust input / output path as desired

Re: Sort and move hevc videos

Posted: 16 Jun 2021, 12:57
by rsmehdi

Code: Select all

root@ubuntu:~# filebot -rename -r /raid5data/testHEVC/HEVCH264/ --db file --output /raid5data/testHEVC/HEVCMOVED/ --format "{video[0].Format}/{fn}" --filter "video[0].Format =~ /HEVC/" --action TEST
Initialize UserHome folder: /root/snap/filebot/42/data
Initialize Cache folder: /root/snap/filebot/42/data/cache
Initialize Logs folder: /root/snap/filebot/42/data/logs
Initialize TemporaryFiles folder: /root/snap/filebot/42/data/tmp
Initialize new disk cache: /root/snap/filebot/42/data/cache/0
Bad system encoding: ISO-8859-1
* Please configure your locale with LANG=C.UTF-8
* Consider using --mode interactive to enable interactive mode
File does not exist: /raid5data/testHEVC/HEVCH264/
No files selected: [/raid5data/testHEVC/HEVCH264/]
* This process is running within a confined sandbox. Access to the host file system may be restricted.
Rename files using [Plain File]
Failed to identify or process any files
Failure (×_×)⌒☆

Re: Sort and move hevc videos

Posted: 16 Jun 2021, 13:57
by rednoah
The input folder path you have passed in does not exist:

Code: Select all

File does not exist: /raid5data/testHEVC/HEVCH264/
or appears to not exist due to permissions or sandboxing:

Code: Select all

* This process is running within a confined sandbox. Access to the host file system may be restricted.

:arrow: If you are using snap to install and run software, then you must follow the instructions, otherwise snap confinement will default to restricting file system access:
https://www.filebot.net/linux/snap.html

Re: Sort and move hevc videos

Posted: 16 Jun 2021, 14:11
by rsmehdi
my videos are in subfolders.
1 video per folder, which gives this:

Code: Select all

/ raid5data / testHEVC / HEVCH264 / Godzilla HEVC / Godzilla.HEVC.mkv
Image

Image

Re: Sort and move hevc videos

Posted: 16 Jun 2021, 14:17
by rednoah
rednoah wrote: 16 Jun 2021, 13:57 If you are using snap to install and run software, then you must follow the instructions, otherwise snap confinement will default to restricting file system access:
https://www.filebot.net/linux/snap.html
Please click on the link, and then read the page. If you install filebot via snap install filebot (i.e. without --devmode) then filebot cannot access /raid5data. That's just how snap works.

Re: Sort and move hevc videos

Posted: 16 Jun 2021, 20:54
by rsmehdi
Thank you very much it works perfectly.
I was able to move everything to 1 new folder.
Now I find myself with hevc 4k and hevc 1080p movies in the same folder.
I would like to separate them in 1 different folder.
Is that possible?
Thank you

Re: Sort and move hevc videos

Posted: 17 Jun 2021, 02:48
by rednoah
Yes, same thing, with --format adjusted slightly for your new use case:

Code: Select all

filebot -rename -r /home/files/videos --db file --output /home/files/by/codec --format "{video[0].Format}/{vf}/{fn}" --filter "video[0].Format =~ /HEVC/" --action TEST

Re: Sort and move hevc videos

Posted: 17 Jun 2021, 11:44
by rsmehdi
you are a genius, it works perfectly.
I am missing one last thing to sort out and everything will be fine.

All the Series hevc files are mixed up and I wish I had found a way to organize everything neatly.
Each series and movies must be renamed with "year" "codec video" "resolution""codec audio",(series classified by folder and by season)

Code: Select all

Example serie :

"/ Lost / season1 / lost (2004) s01e01 1080p hevc ac3.mkv" 
"/ Lost / season1 / lost (2004) s01e01 1080p h264 aac.mkv" 
etc....

Example movie :

terminator (1984) 1080p Hevc ac3.mkv
terminator (1984) 1080p H264 aac.mkv
terminator (1984) 2160p Hevc aac.mkv
etc..
Thank you for what you are doing to help me make this great software work.

Re: Sort and move hevc videos

Posted: 17 Jun 2021, 13:23
by rednoah
Please read the manual, and experiment with all the concepts you have learned:
* https://www.filebot.net/cli.html
* https://www.filebot.net/naming.html


e.g. match movie files and move / rename with custom format:

Code: Select all

filebot -rename -r /input/movies --db TheMovieDB --output /output/movies --format "{ny}/{ny} {vf} {vc} {ac}"

:!: Note that adding "movie / series identification" into the mix changes the original topic significantly, so previous advice may only be applicable partially.

Re: Sort and move hevc videos

Posted: 18 Jun 2021, 14:36
by rsmehdi
it works perfectly.

Thank you bro

Re: Sort and move hevc videos

Posted: 13 Jul 2022, 22:39
by rednoah