VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Hi all

    I have this command:
    ffmpeg -i C:\Users\HP-620\Desktop\Eventi\59\444.mov -af astats=metadata=1:reset=1,ametadata=print:key=lavf i.astats.Overall.RMS_level:file=log.txt -f null -

    the result is a log.txt file.

    In the command prompt there are a lot of good info:

    [Parsed_astats_0 @ 00000000028d98a0] Channel: 1
    [Parsed_astats_0 @ 00000000028d98a0] DC offset: -0.003863
    [Parsed_astats_0 @ 00000000028d98a0] Min level: -0.070119
    [Parsed_astats_0 @ 00000000028d98a0] Max level: 0.009016
    [Parsed_astats_0 @ 00000000028d98a0] Min difference: 0.000000
    [Parsed_astats_0 @ 00000000028d98a0] Max difference: 0.042524
    [Parsed_astats_0 @ 00000000028d98a0] Mean difference: 0.000214
    [Parsed_astats_0 @ 00000000028d98a0] Peak level dB: -23.083313
    [Parsed_astats_0 @ 00000000028d98a0] RMS level dB: -36.112468
    [Parsed_astats_0 @ 00000000028d98a0] RMS peak dB: -36.112468
    [Parsed_astats_0 @ 00000000028d98a0] RMS trough dB: -36.112468
    [Parsed_astats_0 @ 00000000028d98a0] Crest factor: 4.481854
    [Parsed_astats_0 @ 00000000028d98a0] Flat factor: 0.000000
    [Parsed_astats_0 @ 00000000028d98a0] Peak count: 2
    [Parsed_astats_0 @ 00000000028d98a0] Bit depth: 40
    [Parsed_astats_0 @ 00000000028d98a0] Channel: 2
    [Parsed_astats_0 @ 00000000028d98a0] DC offset: -0.003863
    [Parsed_astats_0 @ 00000000028d98a0] Min level: -0.070119
    [Parsed_astats_0 @ 00000000028d98a0] Max level: 0.009016
    [Parsed_astats_0 @ 00000000028d98a0] Min difference: 0.000000
    [Parsed_astats_0 @ 00000000028d98a0] Max difference: 0.042524
    [Parsed_astats_0 @ 00000000028d98a0] Mean difference: 0.000214
    [Parsed_astats_0 @ 00000000028d98a0] Peak level dB: -23.083313
    [Parsed_astats_0 @ 00000000028d98a0] RMS level dB: -36.112468
    [Parsed_astats_0 @ 00000000028d98a0] RMS peak dB: -36.112468
    [Parsed_astats_0 @ 00000000028d98a0] RMS trough dB: -36.112468
    [Parsed_astats_0 @ 00000000028d98a0] Crest factor: 4.481854
    [Parsed_astats_0 @ 00000000028d98a0] Flat factor: 0.000000
    [Parsed_astats_0 @ 00000000028d98a0] Peak count: 2
    [Parsed_astats_0 @ 00000000028d98a0] Bit depth: 40
    [Parsed_astats_0 @ 00000000028d98a0] Overall
    [Parsed_astats_0 @ 00000000028d98a0] DC offset: -0.003863
    [Parsed_astats_0 @ 00000000028d98a0] Min level: -0.070119
    [Parsed_astats_0 @ 00000000028d98a0] Max level: 0.009016
    [Parsed_astats_0 @ 00000000028d98a0] Min difference: 0.000000
    [Parsed_astats_0 @ 00000000028d98a0] Max difference: 0.042524
    [Parsed_astats_0 @ 00000000028d98a0] Mean difference: 0.000214
    [Parsed_astats_0 @ 00000000028d98a0] Peak level dB: -23.083313
    [Parsed_astats_0 @ 00000000028d98a0] RMS level dB: -36.112468
    [Parsed_astats_0 @ 00000000028d98a0] RMS peak dB: -36.112468
    [Parsed_astats_0 @ 00000000028d98a0] RMS trough dB: -36.112468
    [Parsed_astats_0 @ 00000000028d98a0] Flat factor: 0.000000
    [Parsed_astats_0 @ 00000000028d98a0] Peak count: 2.000000
    [Parsed_astats_0 @ 00000000028d98a0] Bit depth: 40
    [Parsed_astats_0 @ 00000000028d98a0] Number of samples: 1024

    I would write it into the same txt file.


    Thanks in advance.
    Quote Quote  
  2. Redirect with "2>" (without qoutation marks"

    Code:
    ffmpeg -i C:\Users\HP-620\Desktop\Eventi\59\444.mov -af astats=metadata=1:reset=1,ametadata=print:key=lavf i.astats.Overall.RMS_level:file=log.txt -f null - 2> logfile.txt
    Quote Quote  
  3. Works fine.
    Thanks a lot
    Quote Quote  
  4. you can get all the values into real variables:
    Code:
    @echo off
    SETLOCAL
    ffmpeg -i C:\Users\HP-620\Desktop\Eventi\59\444.mov -af astats=metadata=1:reset=1,ametadata=print:key=lavf i.astats.Overall.RMS_level:file=log.txt -f null - 2> logfile.txt
    
    for /f "tokens=*" %%a in (logfile.txt) do call :parse "%%a"
    ENDLOCAL
    pause
    exit
    
    
    
    :parse <a line from txt file>
    set line=%~1
    set line=%line:*]=%
    set line=%line: =%
    for /f "tokens=1,2 delims=:" %%x in ("%line%") do call :channel_or_overall %%x %%y
    goto :eof
    
    :channel_or_overall <name of variable> <its value>
    if /i "%1"=="channel" set "prefix=channel_%2"&goto :eof
    if /i "%1"=="overall" set "prefix=overall"&goto :eof
    echo %prefix%_%1=%2
    set %prefix%_%1=%2
    goto :eof
    so command prompt will print:
    Code:
    channel_1_DCoffset=-0.003863
    channel_1_Minlevel=-0.070119
    channel_1_Maxlevel=0.009016
    channel_1_Mindifference=0.000000
    channel_1_Maxdifference=0.042524
    channel_1_Meandifference=0.000214
    channel_1_PeakleveldB=-23.083313
    channel_1_RMSleveldB=-36.112468
    channel_1_RMSpeakdB=-36.112468
    channel_1_RMStroughdB=-36.112468
    channel_1_Crestfactor=4.481854
    channel_1_Flatfactor=0.000000
    channel_1_Peakcount=2
    channel_1_Bitdepth=40
    channel_2_DCoffset=-0.003863
    channel_2_Minlevel=-0.070119
    channel_2_Maxlevel=0.009016
    channel_2_Mindifference=0.000000
    channel_2_Maxdifference=0.042524
    channel_2_Meandifference=0.000214
    channel_2_PeakleveldB=-23.083313
    channel_2_RMSleveldB=-36.112468
    channel_2_RMSpeakdB=-36.112468
    channel_2_RMStroughdB=-36.112468
    channel_2_Crestfactor=4.481854
    channel_2_Flatfactor=0.000000
    channel_2_Peakcount=2
    channel_2_Bitdepth=40
    overall_DCoffset=-0.003863
    overall_Minlevel=-0.070119
    overall_Maxlevel=0.009016
    overall_Mindifference=0.000000
    overall_Maxdifference=0.042524
    overall_Meandifference=0.000214
    overall_PeakleveldB=-23.083313
    overall_RMSleveldB=-36.112468
    overall_RMSpeakdB=-36.112468
    overall_RMStroughdB=-36.112468
    overall_Flatfactor=0.000000
    overall_Peakcount=2.000000
    overall_Bitdepth=40
    overall_Numberofsamples=1024
    Press any key to continue . . .
    but you still have that txt file
    Last edited by _Al_; 24th Oct 2017 at 16:18.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!