For those who want to scriptwise and at free will, Single Pass, play some with ffmpeg and x264.
Code:Enjoy your own.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 17 of 17
Thread
-
Last edited by M.Shiver; 4th Nov 2023 at 20:39. Reason: Update
-
(Addendum to ffmpeg/x264 conversion script)
For those who want to scriptwise and at free will play some with purifying the names of their files first from spaces, dots and special characters (except underscore and hyphen) and certain accentuated letters.
Code:Enjoy your own.
Last edited by M.Shiver; 4th Nov 2023 at 20:39.
-
ffx264: https://sourceforge.net/projects/ffx264/
ffhevc: https://sourceforge.net/projects/ffhevc/
might be interesting.users currently on my ignore list: deadrats, Stears555 -
-
-
that's what I was thinking. Why not just use Handbrake? Isn't the whole point of doing encoding using CLI programs like ffmpeg to be able to use features unavailable in something like Handbrake? IMHO this is just pseudo console jockey rubbish, and I first learned Unix stuff in the 80s. CLI was the only option then.
-
-
Don't mind them, yes, you can automatize custom processes, that's the point and fun as well. Everyone has to start somehow, small steps. I recommend peeking at python also, I have it even preinstalled on Ubuntu. If that is a fun for you, with python, you can actually end up using custom apps with ui etc.
-
-
What you are doing is amateur hour, and frankly has existed for decades, you have contributed nothing of value.
If you really want to do something of note, install Lazarus and Free Pascal and create a nice cross platform GUI.
Another option is Pure Basic, which works much like the old Visual Basic did.
You can also go the Python route, since Python is a language that is in big demand, so practicing it may actually lead you to one day landing a good paying job.
Here is a simple Python GUI to get you started:
import tkinter as tk
from tkinter import messagebox
from tkinter import font
def on_button_click():
messagebox.showinfo("Sophisticles", "WHATEVER")
# Create the main application window
root = tk.Tk()
root.title("FFMPEG Batch Converter")
# Set the window size to a predefined width and height
root.geometry("800x600")
# Create a font with a larger size
custom_font = font.nametofont("TkDefaultFont")
custom_font.configure(size=18)
# Create a button
button = tk.Button(root, text="Punch ME!", command=on_button_click, width=20, height=6, font=custom_font)
button.pack()
# Run the application
root.mainloop()
This will run on both Linux and Windows.
As a general rule of thumb, I do not recommend on coding anything only for one specific OS, you always want to make it as cross platform as possible. -
Last edited by M.Shiver; 7th Nov 2023 at 05:11.
-
Dont take some responses too much, public forum gives you hard responses, I know you just start, small steps, you are just fine.
Regarding python script, it can have a lots of different approaches and degrees of difficulty, which means more user comfort.
To start with basics, to run a command with bunch of defaults set beforehand, you can run something like this:
Code:import multiprocessing from subprocess import Popen, PIPE from pathlib import Path import sys import shlex import shutil FFMPEG = shutil.which("ffmpeg") if not FFMPEG: raise ValueError("Executable ffmpeg is not in the PATH") THREADS = multiprocessing.cpu_count() VID_IN = "" EXT_OUT = "mkv" FFMPEG_X264_VID = "-x264-params crf=18" FFMPEG_X264_VIDFIXED = "" FFMPEG_X264_AUD = "aac -b:a 80k -ac 2 -ar 44100 " def main(filepaths): for VID_IN in filepaths: VID_IN = Path(VID_IN) if not VID_IN.is_file(): raise ValueError(f"Not a file: {VID_IN}") output = VID_IN.parent / f"{VID_IN.stem}_converted.{EXT_OUT}" cmd = f'"{FFMPEG}" -y -i "{VID_IN}" -c:v libx264 {FFMPEG_X264_VID} {FFMPEG_X264_VIDFIXED} -c:a {FFMPEG_X264_AUD} "{output}"' print(cmd) p = Popen(shlex.split(cmd), stdout=PIPE, stderr=PIPE, universal_newlines=True) line = 1 while line: line = p.stderr.readline() print(line.strip()) if __name__ == '__main__': if len(sys.argv) > 1: main(sys.argv[1:]) else: raise ValueError("No filepath arguments")
Or it can be called :
python3 basic_encoder.py file1.mp4 file2.mp4 etc.
or you can call encoding from another python file:
import basic_encoder
file = "/home/files/video.mp4" #windows: "D:/video.mp4" or r"D:\video.mp4"
basic_encoder.main([file])
you can do all kind of wizardry with python scripts, printing could be changed or just log things instead of printing it, or as was suggested, those defaults could be in a UI and just pushing a button would start things ...
EDIT:
Just tested it on Ubuntu and dropping files does not work, or I do not know how to do it in linux.
But calling from other python scripts work or running cmd in terminal works (use full paths, those could be dropped there on terminal, manually punch spaces in between):
python3 basic_encoder.py file1.mp4Last edited by _Al_; 4th Nov 2023 at 23:07.
-
-
Fair enough. Im sorry for that insulting tone. I thought you are a kid, starting to launch automatized scripts for a custom procedures.
-
Similar Threads
-
Merge video, audio and subtitles in one folder using ffmpeg + bash script?
By oknchm in forum Newbie / General discussionsReplies: 1Last Post: 16th Nov 2022, 01:58 -
ffmpeg fade out beginning & end of video without re-encoding middle part ?
By DonSeenu in forum Video ConversionReplies: 4Last Post: 28th Sep 2021, 04:00 -
Merge .srt & .mp4 without encoding video & audio?
By alexeliasson in forum SubtitleReplies: 9Last Post: 11th Jan 2021, 11:42 -
x264 & FFmpeg: "64-bit dictatorship"?
By bulgom in forum Video ConversionReplies: 39Last Post: 5th Oct 2018, 01:13 -
x264 benchmark? what mobile chipset to do more fast encoding x264 encoding?
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 22nd Sep 2018, 00:06