VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. Member
    Join Date
    Sep 2018
    Location
    North America
    Search Comp PM
    I am looking to create a batch file that will create individual nfo files that provide a listing for the file name, video resolution, video length & video bitrate for each mp4/mkv file I have in a specific folder. I am familiar with ffmpeg/ffplay/ffprobe and learning about python as well as the mediainfo cli. I also have some familiarity with c++. I found a batch command that uses xml and creates a new folder named after each video file in the directory. It then moves the video file into the folder that matches the name and creates an nfo file with the same label as the video file. I would like to do something similar that creates an .nfo file with some constant data I want in all the .nfo files as well as the 4 variables above (file name, video resolution, video length & video bitrate). A single batch file that can do all of the above would be preferred, but I'd be happy using multiple batch files as well, if necessary. After a lifetime of using the GUI interface, I'm still becoming accustomed to the command line interface, so any assistance would be greatly appreciated, no matter how minor it may seem to you. Thank you
    Quote Quote  
  2. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    If you are looking for NFO file such as :
    <movie>
    <title></title>
    <originaltitle></originaltitle>
    <sorttitle></sorttitle>
    <rating></rating> <!-- 0 - 10 rating, can be decimal -->
    <ratings>
    <rating moviedb="imdb"></rating>
    <rating moviedb="allocine"></rating>t
    It should theoretically be possible to build a CMD file that utilizes MediaInfo command line and save info to a text file. :

    "Count Up.txt"
    one
    two
    three
    four

    Then call these lines assigning each to a variable:
    "Test of variables"
    < "Count Up.txt" (
    set /p line1=
    set /p line2=
    )
    echo line1 %line1%
    echo line2 %line2%
    set line
    Then echo each variable in a predetermined way:
    @echo off
    for /r %%a in (*.mp4) do (
    (
    < "Count Up.txt" (
    set /p line1=
    set /p line2=
    )
    echo ^<?xml version="1.0" encoding="UTF-8" standalone="yes"?^>
    echo ^<movie^>
    echo ^<title^> %Line1% ^</title^>
    echo ^<runtime^> %Line2%^</runtime^>
    echo ^</movie^>
    )>"%%~dpna.nfo"
    )
    Which will result in NFO files:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <movie>
    <title> one </title>
    <runtime> two</runtime>
    </movie>

    I would test more but it is 03:30 AM here and I have rehab at 07:00 AM. Hope this helps.
    Quote Quote  
  3. Member
    Join Date
    Sep 2018
    Location
    North America
    Search Comp PM
    Thank you! I'll give this a try and I hope rehab goes well.
    Quote Quote  



Similar Threads