Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th November 2024, 16:27   #1  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 504
Automatic Same Name

When doing any operation in ffmpeg, how do I automatically make the output file have the same name as the input file?

For example, I remux a single mkv file to mp4, and I want the output mp4 to have the same name as the input mkv.

Using a script is not allowed.

Last edited by jay123210599; 5th November 2024 at 18:54.
jay123210599 is offline   Reply With Quote
Old 11th November 2024, 21:13   #2  |  Link
Selur
.
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,860
What OS?
Isn't anything called in a bash (on Windows) or a terminal (Linux/Mac) basically a script?
if you know the name and can use a environment variable probably do something like:
Code:
set p=INPUT_NAME && call ffmpeg -i "YOUR_PATH_TO/%p%.mkv" "OUTPUT_PATH/%p%.mkv"
(INPUT_NAME, YOUR_PATH_TO and OUTPUT_PATH are variables that need to be set)

Cu Selur
__________________
Hybrid here in the forum, homepage, its own forum
Selur is offline   Reply With Quote
Old 13th November 2024, 02:32   #3  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 504
Quote:
Originally Posted by Selur View Post
What OS?
Isn't anything called in a bash (on Windows) or a terminal (Linux/Mac) basically a script?
if you know the name and can use a environment variable probably do something like:
Code:
set p=INPUT_NAME && call ffmpeg -i "YOUR_PATH_TO/%p%.mkv" "OUTPUT_PATH/%p%.mkv"
(INPUT_NAME, YOUR_PATH_TO and OUTPUT_PATH are variables that need to be set)

Cu Selur
I'm in Windows, and I don't want to use scripts. This is for cases like ffmpeg.
jay123210599 is offline   Reply With Quote
Old 13th November 2024, 04:05   #4  |  Link
Z2697
Registered User
 
Join Date: Aug 2024
Location: Between my two ears
Posts: 958
Quote:
Originally Posted by jay123210599 View Post
i'm in windows, and i don't want to use scripts. This is for cases like ffmpeg.
no.


I think the only case where FFmpeg will parse formatted filename is with image2 muxer/demuxer

Last edited by Z2697; 13th November 2024 at 04:11.
Z2697 is offline   Reply With Quote
Old 13th November 2024, 11:59   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,411
Is the OP wanting some kind of ffmpeg GUI ?
(requirement seems a little 'fuzzy')
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 13th November 2024, 18:17   #6  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 5,064
You could try AnotherGUI. https://www.videohelp.com/software/AnotherGUI

Use the Executables menu to tell AnotherGUI where ffmpeg is.
A preset for remuxing a file as an MP4 might look like this (added to the First Pass section of the preset configuration), but of course it can be a preset for performing any type of ffmpeg conversion.

-i "<FullSourceFileName>" -y -threads 1 -vcodec copy -acodec copy "<OutputPath><OutputFileName>.mp4"

Once you've created the preset, select it and drag and drop a file or files onto AnotherGUI (any file type that can be remuxed as an MP4), then click "Go". The default output name is the same as the input.
hello_hello is offline   Reply With Quote
Old 17th November 2024, 15:08   #7  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 504
I don't want a GUI. I want to put in something that will get me the same name for the output from the input, like %d or something.
jay123210599 is offline   Reply With Quote
Old 19th November 2024, 09:31   #8  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 7,368
If you don't want GUI's or scripts you can run that command line in a folder with the mkv's you want convert to mp4:

FOR %I in (*.mkv) DO "YOUR_PATH_TO\ffmpeg.exe" -i "%I" "%~nI.mp4"
tebasuna51 is offline   Reply With Quote
Old 21st November 2024, 14:13   #9  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 504
Quote:
Originally Posted by tebasuna51 View Post
If you don't want GUI's or scripts you can run that command line in a folder with the mkv's you want convert to mp4:

FOR %I in (*.mkv) DO "YOUR_PATH_TO\ffmpeg.exe" -i "%I" "%~nI.mp4"
What if I have only a single mkv I want to convert to mp4?
jay123210599 is offline   Reply With Quote
Old 22nd November 2024, 09:08   #10  |  Link
GeoffreyA
Donor
 
Join Date: Jun 2024
Location: South Africa
Posts: 679
It will work for a single file.
GeoffreyA is online now   Reply With Quote
Reply

Tags
ffmpeg

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.