VideoHelp Forum
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. Hi but please be patient because I'ma ***


    I wonder if, using ffprobe or mediainfo, is there a way in batch to determine if an audio source file have or not any audio.

    And possible if it have one or multiple audio mono track or stereo tracks. Thanks
    Quote Quote  
  2. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    Deleted
    Quote Quote  
  3. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    http://skwire.dcmembers.com/fp/?page=playtime
    Try it if it works for you.
    But it only shows you if there is audio or not in file. And bitrate and number of channels. Nothing more.

    Bernix
    Quote Quote  
  4. thank you but seems don't load .mxf video files. And if possible I need to change a state of a variable directly inside a batch: e.g.

    HasAudioOrNot=YES

    HasAudioOrNot=NOT
    Quote Quote  
  5. for example
    Code:
    @ffprobe -v -8 -i "%1" -show_format -show_streams > "%~n1_format_streams.txt"
    Quote Quote  
  6. Originally Posted by marcorocchini View Post
    thank you but seems don't load .mxf video files. And if possible I need to change a state of a variable directly inside a batch: e.g.

    HasAudioOrNot=YES

    HasAudioOrNot=NOT
    Then perhaps https://trac.ffmpeg.org/wiki/FFprobeTips ?
    Code:
    @ffprobe -v error -select_streams a:? -show_entries stream=codec_type,channel_layout -of default=noprint_wrappers=1:nokey=1 "%1"
    Basically you searching something able to create dynamical script - perhaps you should investigate some scripting language? Python? Ruby?
    Quote Quote  
  7. Why don't you look through your dozen other batch files that do something similar and modify one of them?
    Quote Quote  
  8. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    That would take effort.
    Quote Quote  
  9. It takes more effort to write a post asking someone to do it for you.
    Quote Quote  
  10. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Is it some coincidence that the word 'batch' has the letters c.a.t. inside ?
    Quote Quote  
  11. thank you pandy, your batch working and return for example:

    Code:
    Audio
    Stereo
    everytime ffprobe find any Audio stream.
    But now I have do some some prooof in partucular cases in witch unfortunately ffprobe may be unsuccessful because it fails totally the audio "seen" into the source file.

    For example in the case of this P2 camera source:

    https://www.dropbox.com/s/lzeesqc3kpgi0ko/PanasonicP2.MXF?dl=0

    in witch I cannot extract any audio because both ffmpeg (and ffprobe) and avisynth (with FFMS2 and LSmashSource) can not read any audio tracks.

    Meanwhile a vulgar way to determine if anyAudio is present or not, it might be to find any phrase called:

    Code:
    Sampling rate                            :
    by using the

    Code:
            findstr /c:"Sampling rate                            :" "mediainfo.txt"
            IF NOT ERRORLEVEL 1 (set "ProbableAudio=1")
    inside the medianfo.txt response

    In this case however I can know that any Audio is present, but I still did not find the way to extract it in a .wav at least Audio Channel 1 and 2
    Quote Quote  
  12. this will make stereo from two channels in mxf file:
    Code:
    ffmpeg -i video.mxf -map 0:1 -map 0:2 -c:a:0 pcm_s16le -c:a:1 pcm_s16le -filter_complex amerge audio.wav
    so you can run this to get mkv:
    Code:
    ffmpeg -i video.mxf -c:v copy -an -sn video.m2v
    ffmpeg -i video.mxf -map 0:1 -map 0:2 -c:a:0 pcm_s16le -c:a:1 pcm_s16le -filter_complex amerge audio.wav
    mkvmerge -o video.mkv video.m2v audio.wav
    Or just use mp4box to get MP4, not sure what you need or if Wav is ok in MP4, or just encode that wav into AAC
    Quote Quote  
  13. using
    Code:
    ffmpeg -i video.mxf -map 0:1 -map 0:2 -c:a:0 pcm_s16le -c:a:1 pcm_s16le -filter_complex amerge audio.wav
    I get an error

    [mxf @ 028b7500] material track 2: no corresponding source track found

    seems that ffmpeg won't works with panasonic p2 mxf files
    Quote Quote  
  14. That was tested with Canon MXF, so perhaps. Or try other tracks 3, 4 , not sure how it is built.
    Quote Quote  
  15. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    If you are still interested in Mediainfo CLI then it can give you what you wish also. Detailed instructions and functions are included with the zip when you download the CLI. Then pick any of the hundreds of audio attributes and create a template.txt with such as:

    Code:
    Audio;Audio Codec = "%CodecID%" Format = "%Format%"\r\n
    create a batch file with:

    Code:
    mediainfo.exe --Inform=file://C:\Users\Bud\Desktop\mp3video\template.txt C:\Users\Bud\Desktop\mp3video\PanasonicP2.MXF > output.txt
    pause
    You can of course incorporate variables and %%a, etc. for drag and drop, but what you will get is:
    Image
    [Attachment 43620 - Click to enlarge]

    Image
    [Attachment 43621 - Click to enlarge]


    You can parse and import this information into batch variables. (https://stackoverflow.com/questions/3068929/how-to-read-file-contents-into-a-variable-...n-a-batch-file)

    This is only a rough outline but you should be able to adapt for what you want to do.
    Last edited by Budman1; 5th Nov 2017 at 00:30.
    Quote Quote  
  16. thank you
    Quote Quote  



Similar Threads

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