title: Big question of Target size, or video bitrate must be specified when using two-pass
body: <p>I tried to solve the error which is Target size, or video bitrate must be specified when using two-pass.</p>
  <p>But I couldn't find how to solve it and how to find path of video exactly I attached my code below this post</p>
  <p>Please give me some tips of solving the problem!</p>
  <pre><code>@Service
  public class ThumbnailService {
  
      public HashMap&lt;String, Object&gt; exportThumbnail(File file) throws Exception {
          // file is from controller and form-data
          //String inputPath = &quot;Users/hojunna/Download/my/&quot;;
          //String outputPath = &quot;/usr/local/video/thumbnail/&quot;;
  
          String ffmpegBasePath = &quot;/opt/homebrew/bin/&quot;;
          FFmpeg ffmpeg = new FFmpeg(ffmpegBasePath+&quot;ffmpeg&quot;);        
          FFprobe ffprobe = new FFprobe(ffmpegBasePath+&quot;ffprobe&quot;);    
          
          FFmpegBuilder builder = new FFmpegBuilder()
                  .setInput(&quot;/Users/hojunna/Desktop/&quot; + file)                         
                  //.overrideOutputFiles(true)                    
                  //.addExtraArgs(&quot;-ss&quot;, &quot;00:00:01&quot;)          
                  .addOutput(&quot;/Users/hojunna/Desktop/test.jpg&quot;)       
                  .setFrames(1)
                  .setVideoFilter(&quot;select='gte(n\\,10)',scale=200:-1&quot;)
                  .done();
  
          FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);      
          executor.createJob(builder).run();                                  
          executor.createTwoPassJob(builder).run();                           
  
          HashMap&lt;String, Object&gt; resultMap = new HashMap&lt;String, Object&gt;();
          return resultMap;
      }
  }
  </code></pre>