0

When I run the following Ffmpeg command it produces empty mp4 files as an output.

The command takes segments of a video as inputs, crops each input at particular locations, and then concatenates them :

ffmpeg -ss 551.389000 -t 47.292417 -i ./testo.mp4 -ss 598.681417 -t 34.217583 -i ./testo.mp4 -vcodec libx264 -r 59.94005994005994 -b:v 6890k -movflags faststart ./out.mp4

I have used this command for thousands of videos, but for this particular video it causes this empty mp4 files. Depending on the specific regions of the video that I specify as inputs, sometimes the command works without issues. The inputs supplied for this video are valid, as the video is 15mins or so.

Here are the relevant output logs for the video (see appendices for all other input/output):

[vost#0:0/libx264 @ 0xfae9410] No filtered frames for output stream, trying to initialize anyway.
[aost#0:1/aac @ 0xfaeab60] No filtered frames for output stream, trying to initialize anyway.
frame=    0 fps=0.0 q=0.0 size=       0kB time=N/A bitrate=N/A speed=N/A    
[mp4 @ 0xfae88d0] Starting second pass: moving the moov atom to the beginning of the file
[out#0/mp4 @ 0xfae87d0] video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[out#0/mp4 @ 0xfae87d0] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used)
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=N/A bitrate=N/A speed=N/A    
[libx264 @ 0xfae9790] final ratefactor: 17.79
[aac @ 0xfaeaee0] Qavg: nan

Main insights from outputs:

  • The output tbn is 1000k (usually 60k)
  • "No filtered frames for output stream" for both video and audio outputs.

Things I have tried:

  • I have a feeling its to do with the video frame-rate, so I tried using several permutations of commands like fps_mode, video_track_timescale, copytb, and enc_time_base.
  • Unsetting output fps
  • Changing input locations (this works)

Appendices

Here is the ffprobe input for the video, which was downloaded from YouTube:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './testo.mp4':
Metadata:
  major_brand     : isom
  minor_version   : 512
  compatible_brands: isomiso2avc1mp41
  encoder         : Lavf60.16.100
Duration: 00:14:31.44, start: 0.000000, bitrate: 939 kb/s
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 6848 kb/s, 59.94 fps, 59.94 tbr, 60k tbn (default)
  Metadata:
    handler_name    : ISO Media file produced by Google Inc.
    vendor_id       : [0][0][0][0]
Stream #0:1[0x2](eng): Audio: opus (Opus / 0x7375704F), 48000 Hz, stereo, fltp, 105 kb/s (default)
  Metadata:
    handler_name    : SoundHandler
    vendor_id       : [0][0][0][0]

Ffmpeg output format, note the very high tbn value (usually this is 60k):

Output #0, mp4, to './out.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.16.100
  Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(progressive), 608x1080 [SAR 1:1 DAR 76:135], 
  q=2-31, 6890 kb/s, 59.94 fps, 1000k tbn
    Metadata:
      encoder         : Lavc60.31.102 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/6890000 buffer size: 0 vbv_delay: N/A
  Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc60.31.102 aac

Full command log can be found here: https://pastebin.com/5CpnaUvg

0

Your Answer

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

Browse other questions tagged or ask your own question.