VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker or buy PlayOn and record Netflix! :)
+ Reply to Thread
Page 5 of 5
FirstFirst ... 3 4 5
Results 121 to 148 of 148
Thread
  1. Originally Posted by badogblue View Post
    Originally Posted by jagabo View Post
    This worked for me:
    Code:
    for %%F in (*.mp4) do ("G:\Program Files\ffmpeg\bin\ffmpeg.exe" -v error -i "%%F" -f null - >error.log 2>&1)
    But I don't have any mp4 files with errors so error.log was empty.
    Thanks, but again I get the same error as with Baldrick's command. (%%F was unexpected at this time.)

    I tried updating ffmpeg to lastest build: f41e37b (2016-07-14), though still can't get it to work.
    Did you copy and paste directly from our post? Obviously, you'll have to change the path to ffmpeg.exe. I tested the batch file on XP, Win7, and Win10. It worked on all of them.

    Ah, I see what your problem is. You're running from the command line, not from a batch file. From the command line use single % signs rather than two.
    Last edited by jagabo; 14th Jul 2016 at 17:38.
    Quote Quote  
  2. Originally Posted by jagabo View Post
    Originally Posted by badogblue View Post
    Originally Posted by jagabo View Post
    This worked for me:
    Code:
    for %%F in (*.mp4) do ("G:\Program Files\ffmpeg\bin\ffmpeg.exe" -v error -i "%%F" -f null - >error.log 2>&1)
    But I don't have any mp4 files with errors so error.log was empty.
    Thanks, but again I get the same error as with Baldrick's command. (%%F was unexpected at this time.)

    I tried updating ffmpeg to lastest build: f41e37b (2016-07-14), though still can't get it to work.
    Did you copy and paste directly from our post? Obviously, you'll have to change the path to ffmpeg.exe. I tested the batch file on XP, Win7, and Win10. It worked on all of them.

    Ah, I see what your problem is. You're running from the command line, not from a batch file. From the command line use single % signs rather than two.

    Yes your correct, it was just me being stupid. Both commands work great. Thanks
    Quote Quote  
  3. Member
    Join Date
    Jun 2008
    Location
    United Kingdom
    Search Comp PM
    Dear all

    I need some help in using an uncommon ffmpeg command -metadata, trying to change the metadata title to the same as the file name.

    The reason is that my stand alone video player insists on showing strange clips titles rather than the actual files names from clips folders on my PC.

    I can change the metadata title of an MP4 clip using:

    ffmpeg -i clip_001.mp4 -metadata title="clip_001" -acodec copy -vcodec copy clip_001_new.mp4

    Now I need to do that for several hundred clips to be titled clip_002..clip_003 etc and named sequentially as clip_002_new.mp4...clip_003_new.mp4 etc.

    I have played with (for %%a in ".mp4") without success as I didn't know how to use a counter to produce the required sequential numbers in a batch file.

    Any help would be greatly appreciated.
    Quote Quote  
  4. Member
    Join Date
    Jun 2008
    Location
    United Kingdom
    Search Comp PM
    It seemed that no one had expressed any interest in solving my little problem.

    Never mind.

    I have been reading and discovering something about batch files.

    So far, I have managed to change metadata titles in all of my clips by using

    for %%x in ("*.mp4") do (ffmpeg -i "%%x" -metadata title=%%x -acodec copy -vcodec copy "newclips\%%x")

    It took my awhile to understand this %% in batch files. This will change the clip title to the same as the file name and saved in a different folder.

    The outcome was not pleasing to the eye or neat, all I had was non sequential files with names between 5 and 40 characters long

    Now I need to figure out a neat way to rename my original clips to something like clip_0001.mp4, clip_0001.mp4 etc. then to apply my newly discovered batch file!

    Perhaps someone will be interested this time?
    Quote Quote  
  5. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    removed
    Last edited by hydra3333; 20th Jul 2016 at 05:16. Reason: already answered
    Quote Quote  
  6. If you highlight a bunch of files with explorer and rename the they will come out with names like file (1).ext, file (2).ext, file (3).ext... And there are lots of file renaming utilities that work on batches.
    Quote Quote  
  7. Member
    Join Date
    Jun 2008
    Location
    United Kingdom
    Search Comp PM
    Thanks J

    I am aware of these renaming utilities. The problem is none of them could output padding zeros like Clip_0001, 0002, 0003 etc.

    The reason I want these padding zeros is that my video player doesn't order the files sequentially, first it shows clip_1, then clip_10 instead of clip_2, then clip_100 instead of clip_3 as detailed below:

    clip_1.mp4
    clip_10.mp4
    clip_11.mp4
    clip_12.mp4
    clip_13.mp4
    clip_14.mp4
    clip_15.mp4
    clip_16.mp4
    clip_17.mp4
    clip_18.mp4
    clip_19.mp4
    clip_2.mp4
    clip_20.mp4
    clip_21.mp4
    clip_22.mp4 etc

    Just wondering now if there is a number_to_string manipulating function or a call within a batch file which can use an incremental counter within for %%x in ("*.mp4") do ?

    Many thanks for any helping hands
    Quote Quote  
  8. Originally Posted by shaema View Post
    Thanks J

    I am aware of these renaming utilities. The problem is none of them could output padding zeros like Clip_0001, 0002, 0003 etc.

    Check Total Commander - it is equipped with very neat mutli-rename tool.
    Quote Quote  
  9. Member
    Join Date
    Jun 2008
    Location
    United Kingdom
    Search Comp PM
    Thanks Pandy for your suggestion. I will have a go at it.
    Quote Quote  
  10. Member
    Join Date
    Jun 2008
    Location
    United Kingdom
    Search Comp PM
    Yes it did work for me. Thanks again
    Quote Quote  
  11. for %%a in ("*.mkv") do ffmpeg -i "%%a" -map 0:0 -c:v libx264 -b:v 500k -pass 1 -passlogfile "%%a" -f null /dev/null && \
    for %%a in ("*.mkv") do ffmpeg -i "%%a" -map 0:0 -map 0:1 -c:v libx264 -b:v 500k -pass 2 -passlogfile "%%a" -c:a libopus -ac 2 -b:a 64k "New\%%~na.mkv"
    PAUSE

    Would this work for 2 pass?
    Quote Quote  
  12. I'm not sure if the construction with the && works. It would work if you did a new line, though then it would first do the first passes of all input files and afterwards do all the second passes. The end result would be the same.
    Quote Quote  
  13. Sometimes it hangs while doing the first passes for some reason. Second pass is fine.
    Any way I can improve it?
    Quote Quote  
  14. Does it just hang or is there an error message?
    Quote Quote  
  15. Just hangs with last update in the CMD window: "frame=55206 fps=156 q=36.0 size= 110558kB time=00:10:40.07 bitrate= 492.2kbits/"
    That was an example, it's random, sometimes the 1st file hangs and sometimes the 3rd or 4th (if there were 10 video files in the same folder as the ffmpeg.exe and .bat)
    Quote Quote  
  16. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    also, these flags are handy:

    -map_metadata -1
    put just after the input file, prevents any unfortunate metadata being copied to the output file.

    -movflags +faststart
    put just before the output .mp4 file (only useful for .mp4 files) it ensures the moov atom is placed at the front of the .mp4 file for "better sharing it via casting or the internet". or something like that.
    Quote Quote  
  17. -map_metadata -1 Did the trick, wow, it would have taken me forever to figure this out, had no idea metadata could have a negative influence. Thank you .
    Quote Quote  
  18. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    Well, strike me pink, I mentioned it only as a potentially handy side-issue rather than as a fix.
    Never know your luck in the big world, eh ?
    Quote Quote  
  19. How to batch multiplex video and multiples subtitles track files with ffmpeg?

    There is a ffmpeg code to Multiplex (one by one) the video & subtitles tracks into one .mkv container

    Here's the Code:

    Code:
    ffmpeg -i "D:\Mux\Episode_06-010101.mkv" -i "D:\Mux\Episode_06-010101.ger.ass" -i "D:\Mux\Episode_06-010101.eng.ass" -i "D:\Mux\Episode_06-010101.spa.ass" -i "D:\Mux\Episode_06-010101.spala.ass" -i "D:\Mux\Episode_06-010101.fre.ass" -i "D:\Mux\Episode_06-010101.por.ass" -map 0:0 -map 0:1 -map 1:0 -map 2:0 -map 3:0 -map 4:0 -map 5:0 -map 6:0 -c:v copy -c:a copy -c:s copy -y "G:\Mux\convert\Episode_06-010101.mkv"
    Each video and its respective subtitles have the same name, differing only by 6 numbers and letters indicating the language of each subtitles.

    There are 30 videos files and each one has 6 subtitles, each subtitle is of different languages.

    But how to batch mux many .mkv & subtitles files, there is a way do not need to input file names manually.?

    Thanks in advance.
    Quote Quote  
  20. for %%a in (*.mkv) do ffmpeg -i "%%a" -i "%%~na.ger.ass" -i "%%~na.eng.ass" -i "%%~na.spa.ass" -i "%%~na.spala.ass" -i "%%~na.fre.ass" -i "%%~na.por.ass" -map 0:0 -map 0:1 -map 1:0 -map 2:0 -map 3:0 -map 4:0 -map 5:0 -map 6:0 -c:v copy -c:a copy -c:s copy -y "convert\%%~na.mkv"
    Quote Quote  
  21. Thank you, sorry not to have answered before, worked perfectly.

    I tried to include other information, but it does not work, could you tell me what I'm doing wrong?

    Code:
    for %%a in (*.mkv) do ffmpeg -i "%%a" -metadata:s:v:0 title="%%na" -metadata:s:a:0 language=jpn -i "%%~na.por.ass" -metadata:s:s:0 language=por -i "%%~na.eng.ass" -metadata:s:s:1 language=eng -i "%%~na.spa.ass" -metadata:s:s:2 language=spa -i "%%~na.spa-mx.ass" -metadata:s:s:3 language=spa-mx -i "%%~na.fre.ass" -metadata:s:s:4 language=fre -i "%%~na.ger.ass" -metadata:s:s:5 language=ger -map 0:0 -map 0:1 -map 1:0 -map 2:0 -map 3:0 -map 4:0 -map 5:0 -map 6:0 -c:v copy -c:a copy -c:s copy  -y "convert\%%~na.mkv?
    Quote Quote  
  22. "It does not work" is not a good error description. Post the log with the error message and/or say what is wrong with the output.
    On first glance:
    - "?" at the end instead of quote.
    - you totally changed the command order of the other example. Your older example was ffmpeg [all input files] [all output options] [output file]. Why did you change the order?
    Quote Quote  
  23. Originally Posted by sneaker View Post
    "It does not work" is not a good error description. Post the log with the error message and/or say what is wrong with the output.
    On first glance:
    - "?" at the end instead of quote.
    - you totally changed the command order of the other example. Your older example was ffmpeg [all input files] [all output options] [output file]. Why did you change the order?
    Just an error when posting the code in the message, I put the tag code and accidentally deleted the quote marks, The original code had no "?" in the end.

    I was just testing to see if the position of the commands interfered, but at any position I had the same error, So I ended up not posting the original command but one of the tests.

    Code:
    for 'is not recognized as an internal or external command, an operable program, or a batch file
    Code:
    for %%a in (*.mkv) do ffmpeg -i "%%a" -metadata:s:v:0 title="%%a" -i "%%~na.ger.ass" -i "%%~na.eng.ass" -i "%%~na.spa.ass" -i "%%~na.spa-mx.ass" -i "%%~na.fre.ass" -i "%%~na.por.ass" -map 0:0 -map 0:1 -map 1:0 -map 2:0 -map 3:0 -map 4:0 -map 5:0 -map 6:0 -c:v copy -c:a copy -c:s copy -metadata:s:s:0 language=ger -metadata:s:s:1 language=eng -metadata:s:s:2 language=spa -metadata:s:s:3 language=spa-mx -metadata:s:s:4 language=fre -metadata:s:s:5 language=por -y "convert\%%~na.mkv"
    I already solved the problem using another method, But wanted to understand where I'm going wrong.


    Thanks for your help.

    Edit: I discovered what was the problem, the program I used to save the bat file, was inserting strange characters at the beginning of the file, these characters were not visible, I could only see them when using Dr. Batch.
    Last edited by AlvoErrado2; 15th Nov 2016 at 09:42. Reason: Add Info
    Quote Quote  
  24. Member
    Join Date
    Apr 2017
    Location
    United States
    Search Comp PM
    I am new to using ffmpeg and I am trying to figure how to batch multiplex mkv files to avi. I am also trying to figure how I can keep my existing filenames. Can anyone help me, because I have no idea how to use ffmpeg or what batch file commands I need to use?
    Quote Quote  
  25. Hi carlrandall72 ,

    read :
    https://forum.videohelp.com/threads/383481-Stream-and-join-lots-of-m2ts-files#post2485297

    Maybe it can help (?) .

    Cheers .
    JE SUIS CHARLIE !!!
    Quote Quote  
  26. *nvm
    Last edited by Restricted; 21st Jun 2017 at 04:50.
    Quote Quote  
  27. i use plex so mp4 with h264 video and aac audio is great for me,but how do i make it to scan through all sub-folders and put the .mp4 file in the same folder as it was from as well as keep my existing filenames? also how do i make it produce a text log so i know what all it could/ couldnt do?
    thanks for any help!
    Quote Quote  
  28. Last edited by Baldrick; 29th May 2013 at 02:54.
    I registered an account just to thank you Baldrick. You've saved me hours, days.. maybe even months of converting with your initial post (300-400 movies to convert).

    Thanks a bunch!

    Edit: The MKV converting went A-Ok, but I did have a problem when converting my AVI though; kept getting the error " Unknown encoder 'libvo_aacenc' ". I read on another message board that you could simply switch out "libvo_aacenc" to "aac" in the given command line w/o any problems. To be honest though, I'm not an FFMPEG super user and in the past only used it to rip "Red vs. Blue" episodes from their website. And the files i'm converting are movies I watch off a computer using a 32" TV using computer speakers, so I haven't seen any real loss of quality with my simple change.

    Edit 2: I might've spoken too soon on the time it'll take me to convert my movies.. the AVI take forever, not a few minutes like MKV files, but rather a few hours. At least the automation will cut down on time. But I suspect it'll take a month running my conversion 24/7.
    Last edited by Anacron69; 28th Sep 2017 at 22:34.
    Quote Quote  



Similar Threads