VideoHelp Forum
+ Reply to Thread
Results 1 to 20 of 20
Thread
  1. Hi cats,

    I have a example.mp4 that have the video track but no audio.
    Simply I need to generate with ffmpeg a example.wav mute audio track that have the same lenght of the example.mp4

    is it pobbile? thanks
    Quote Quote  
  2. Did you try Audacity?
    Extraordinary claims require extraordinary evidence -Carl Sagan
    Quote Quote  
  3. This works for me.
    I had to remove the audio track from the .mp4 first.
    I'm not sure how top do it with a .wav but this works with aac:
    ffmpeg -f lavfi -i aevalsrc=0 -i input.mp4 -c:v copy -c:a aac -map 0 -map 1:v -shortest output.mp4
    Quote Quote  
  4. Member
    Join Date
    Jul 2009
    Location
    United States
    Search Comp PM
    use -c:a pcm_s16le for .wav
    Quote Quote  
  5. Originally Posted by zing269 View Post
    use -c:a pcm_s16le for .wav
    That is fine for .mkv & some other formats but not for the .MP4 format.
    Quote Quote  
  6. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Originally Posted by cholla View Post
    Originally Posted by zing269 View Post
    use -c:a pcm_s16le for .wav
    That is fine for .mkv & some other formats but not for the .MP4 format.
    That's because LPCM is not normally a supported stream type in mp4. I wouldn't expect it to work, for you or for the OP.

    Scott
    Quote Quote  
  7. That's why I gave the command line for aac audio.

    AFAIK ffmpeg would convert a .wav audio track to .aac or .mp3 automatically by removing-c:a copy .

    Like this:
    Code:
    ffmpeg -i input.wav -c:v copy output.mp4
    This creates an AAC (LC) audio track in a .mp4 container.
    Last edited by cholla; 20th Jul 2022 at 08:32.
    Quote Quote  
  8. Member
    Join Date
    Jul 2009
    Location
    United States
    Search Comp PM
    Code:
    ffmpeg -f lavfi -i anullsrc -t 300 -c:a pcm_s16le out.wav
    will create a 5 minute long .wav @ 44,100 Hz, 16 bit, stereo.

    Adjust the -t parameter to the needed length in seconds and replace pcm_s16le with the required type of sample format. See https://trac.ffmpeg.org/wiki/audio%20types for a list.
    Last edited by zing269; 20th Jul 2022 at 05:46. Reason: Fix code tags, spelling
    Quote Quote  
  9. maybe I have do a mess but in some way I think to have get the target, but exactly I don't know why. This is the subroutine

    Code:
    IF NOT "%OnlyOneTrackMonoStereo%"=="1" IF NOT "%multipleAudioStreamDetected%"=="1" IF NOT EXIST "%cd%\decisor.mov" If NOT "%isMXF%"=="1" ffmpeg64bitAug2019.exe -loglevel quiet -y -threads auto -y -f concat -safe 0 -i concatList.txt -map 0:? -vcodec copy -acodec copy "%cd%\decisor.mov"
    IF NOT "%OnlyOneTrackMonoStereo%"=="1" IF NOT "%multipleAudioStreamDetected%"=="1" if NOT "%isMXF%"=="1" fart.exe "%cd%\decisor.avs" "###spaceForSource##" "%cd%\decisor.mov"
    IF NOT "%OnlyOneTrackMonoStereo%"=="1" IF NOT "%multipleAudioStreamDetected%"=="1" if NOT "%isMXF%"=="1" ffmpeg64bit2014.exe -y -loglevel quiet -threads auto -i "%cd%\decisor.avs" -acodec copy "%cd%\decisor.wav"
    IF NOT "%OnlyOneTrackMonoStereo%"=="1" IF NOT "%multipleAudioStreamDetected%"=="1" if NOT "%isMXF%"=="1" IF EXIST "%cd%\AllWav\canaleAudio1_2.wav" del "%cd%\AllWav\canaleAudio1_2.wav"
    IF NOT "%OnlyOneTrackMonoStereo%"=="1" IF NOT "%multipleAudioStreamDetected%"=="1" if NOT "%isMXF%"=="1" if NOT "%isMXF%"=="1" copy /y "%cd%\decisor.wav" "%cd%\AllWav\canaleAudio1_2.wav"
    IF NOT "%OnlyOneTrackMonoStereo%"=="1" IF NOT "%multipleAudioStreamDetected%"=="1" if NOT "%isMXF%"=="1" ffmpeg64bit2014.exe -y -threads auto -i "%cd%\decisor3OR4.avs" -acodec copy "%cd%\AllWav\canaleAudio3_4.wav"
    
    
           rem #### check duration of avigen file ####
            if exist aviGenDuration.txt del aviGenDuration.txt
            Set "aviGenDuration=undef"
            FFProbe64bit2014.exe -loglevel fatal -show_entries format=duration -of csv="p=0" -sexagesimal "%cd%\decisor.mov">aviGenDuration.txt   
            set /p aviGenDuration=<aviGenDuration.txt
            if exist aviGenDuration.txt del aviGenDuration.txt
            echo durata pari a %aviGenDuration%
    
    
    IF "%testEsistenzaAudio%"=="0" ffmpeg34_64bit.exe -y -f lavfi -i aevalsrc=0 -i "%cd%\decisor.mov" -af "pan=stereo:c0=c0:c1=c1" -c:a pcm_s16le -ar 48000 -shortest -t %aviGenDuration% decisor.wav
    IF NOT "%OnlyOneTrackMonoStereo%"=="1" if NOT "%isMXF%"=="1" IF NOT "%multipleAudioStreamDetected%"=="1" v:\automazioneclip\core\ffmpeg34_64bit.exe -loglevel quiet -y -threads auto -i "%cd%\decisor.mov" -i "%cd%\decisor.wav" -i "%cd%\decisor.wav" -map 0:v:0 -map 1:a:0 -vcodec copy -c:a pcm_s16le -ar 48000 "%cd%\decisorRemuxed.mov"
    
    IF NOT "%OnlyOneTrackMonoStereo%"=="1" If NOT "%isMXF%"=="1" IF NOT "%multipleAudioStreamDetected%"=="1" IF NOT "%testEsistenzaAudio%"=="0" ren "%cd%\decisorRemuxed.mov" "concatHD.mov" & echo "%cd%\allwav\usataRoutineDecisorCon%numeroCanaliAudio%canaliAudio">"%cd%\allwav\usataRoutineDecisorCon%numeroCanaliAudio%canaliAudio.txt"
    
    IF NOT "%OnlyOneTrackMonoStereo%"=="1" If NOT "%isMXF%"=="1" IF NOT "%multipleAudioStreamDetected%"=="1" IF "%testEsistenzaAudio%"=="0" ren "%cd%\decisorRemuxed.mov" "concatHD.mov" & echo "%cd%\allwav\usataRoutineDecisorCon%numeroCanaliAudio%canaliAudio">"%cd%\allwav\AudioAssenteInOrigineVieneGeneratoAudioMuto.txt"
    
    IF NOT "%OnlyOneTrackMonoStereo%"=="1" If NOT "%isMXF%"=="1" IF NOT "%multipleAudioStreamDetected%"=="1" IF "%testEsistenzaAudio%"=="0" copy /y "%cd%\decisor.wav" "%cd%\AllWav\canaleAudio1_2.wav"
    maybe the correct way is to generate a intermediate .mov with only the video, and test the duration. And then create an empty .wav of the same duration. The wav achieved is ready to be remuxed in a new file with video and audio (but audio in silence, with 2 audio channels)
    Quote Quote  
  10. Originally Posted by marcorocchini View Post
    maybe I have do a mess but in some way I think to have get the target, but exactly I don't know why. This is the subroutine

    maybe the correct way is to generate a intermediate .mov with only the video, and test the duration. And then create an empty .wav of the same duration. The wav achieved is ready to be remuxed in a new file with video and audio (but audio in silence, with 2 audio channels)
    Yes a mess.
    I believe you will end up with a .MOV file.
    Is this correct?

    Did you try this as it worked for me:
    Code:
    ffmpeg -f lavfi -i aevalsrc=0 -i input.mp4 -c:v copy -c:a aac -map 0 -map 1:v -shortest output.mp4
    This will create a video with a silent aac (lc) audio track of the same length as the video.

    A valid audio MP4 must contain an MPEG audio track (mp3 or aac).
    This means you can not have a .WAV audio track in a .MP4 container.
    Or a PCM audio track.
    Quote Quote  
  11. Originally Posted by marcorocchini View Post
    Hi cats,
    I have a example.mp4 that have the video track but no audio.
    Simply I need to generate with ffmpeg a example.wav mute audio track that have the same lenght of the example.mp4
    is it pobbile? thanks
    What is the purpose of a silent stereo audio track?
    Quote Quote  
  12. Originally Posted by ProWo View Post
    Originally Posted by marcorocchini View Post
    Hi cats,
    I have a example.mp4 that have the video track but no audio.
    Simply I need to generate with ffmpeg a example.wav mute audio track that have the same lenght of the example.mp4
    is it pobbile? thanks
    What is the purpose of a silent stereo audio track?
    I wondered the same thing.
    There must be a reason.
    Quote Quote  
  13. Originally Posted by cholla View Post

    Did you try this as it worked for me:
    Code:
    ffmpeg -f lavfi -i aevalsrc=0 -i input.mp4 -c:v copy -c:a aac -map 0 -map 1:v -shortest output.mp4
    Image
    [Attachment 65959 - Click to enlarge]


    mmm it maybe good, but I don't know exactly if it works also for conCat input (ffmpeg.exe -loglevel quiet -y -threads auto -y -f concat -safe 0 -i concatList.txt ...)
    Quote Quote  
  14. What is the purpose of using concat ?

    Also why is the silent audio track needed?
    Quote Quote  
  15. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    He will probably give the "excuse" that he's a "cat", as if that solves anything.


    Scott
    Quote Quote  
  16. Originally Posted by cholla View Post
    What is the purpose of using concat ?

    Also why is the silent audio track needed?
    because I need to concatenate all the .mp4 of the drone dji footage, and I need to put all in avisynth. But avisynth parse all with a necessary audio track (also if mute). Dji osmo for example does have audio inside each .mp4 but the drone does not have any audio track
    Quote Quote  
  17. First is the acc in the ffmpeg code I posted acceptable for the silent audio track ?

    What is the codec of the audio tracks in the Dji Osmo .MP4s ?

    Someone else is going to need to help with this.
    I haven't used avisynth by itself only as part of other software.
    I'm not good at creating batch files.
    I have only used concat with a few DVDs.

    I take it you are trying to put several drone videos together into one?
    Quote Quote  
  18. osmo seems to me have aac audio. Drone dji don't have any audio track
    Quote Quote  
  19. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Concatenation only works reliably when all elements have the same stream configuration. So either drop the audio of the osmo files prior to concat, and then do a video stream only concat, or do what cholla said and add an aac tracks to the drone files - prior to the concat - and then concat with video and audio streams.
    Or, do separate concats for video-only streams vs v+a streams.

    Avisynth scripts can be designed to work with audio, or ignore audio. If must have audio, avisynth can also generate a silent track for use with silent clips in combination along with tracks WITH audio.
    But you must be consistent, as neither AVISynth nor ffmpeg, nor most other editing/processing apps I can think of will be happy with a checkerboard of audio-noaudio-audio-noaudio.

    My recommendation to you is that you use fprobe to assist with script-based ffmpeg generation of an aac track for video-only clips, then remux, then when they are all consistent do the concat.


    Scott
    Quote Quote  
  20. This was the original post & what was asked for:

    Originally Posted by marcorocchini View Post
    Simply I need to generate with ffmpeg a example.wav mute audio track that have the same lenght of the example.mp4
    is it pobbile? thanks
    Since the .MP4 contaier can't have a .wav or PCM audio track I used aac.
    The code I posted produces a silent audio track the same length as the video track.

    It was afterwards all the concat or other joining came up.

    If I was doing this I would join all the videos with silent & sound audio track with MKVToolNix.
    Into one .mkv . Problem solved.

    I might even try ProWo's Cleaver but I have only used it a little bit.
    So I can't say that it would work for sure.
    It would use FFMPEG though.
    Quote Quote  



Similar Threads

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