1

I'm trying to add a video and audio fade in and fade out to my video using the fade and afade filters. I'm using the following command:

ffmpeg -i trimmed.mp4 -vf 'fade=in:0:60,fade=out:2940:300' -af 'afade=in:st=0:d=1,afade=out:st=53:d=2' -c:a aac -c:v libx264 -crf 18 -preset veryfast fadeInOut.mp4

The resulting audio sound like TV static was overlayed. I've tried specifying audio quality by adding -b:a 128k, but that didn't help either. Any ideas what might be wrong?

Here's the output of ffmpeg -i if that's helpful:

  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: 
isomiso2avc1mp41
    encoder         : Lavf58.20.10
0
  Duration: 00:00:54.54, start: 0.000000
, bitrate: 9964 kb/s
    Stream #0:
0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 9589 kb/s, 
60 fps, 60 tbr, 
15360 tbn, 
120 tbc
 (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:
1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 364 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
5
  • 2
    You removed the most important info, ffmpeg version.
    – user12174
    Apr 10, 2019 at 15:04
  • @PaulB.Mahol Whoops, here it is: ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 8.2.1 (GCC) 20190212 Apr 11, 2019 at 12:07
  • What you use to play output audio?
    – user12174
    Apr 11, 2019 at 20:50
  • @PaulB.Mahol Oh shoot good point, it might be my player's fault. I'm using VLC. I also just tested it with Windows's Photos app, and the same still happens. Apr 12, 2019 at 2:51
  • I'm out of ideas, I can not reproduce this. Perhaps your input have edit lists? How it was created?
    – user12174
    Apr 12, 2019 at 20:17

1 Answer 1

0

For me the best option is to convert audio files first to lossless .wav, do all things that I need to do and then covert them back to .mp3 or other lossy formats. This is the way that is used in audio editing apps and the most gentle way to work with audio or video files

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.