Opened 8 years ago

Last modified 8 years ago

#5033 open defect

Incorrect duration when converting WAV/MP3 files to AAC with -shortest

Reported by: ausjjtkd Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: aac, shortest
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
Incorrect duration of encoded audio files when converting WAV/MP3 (MP3 created with the same WAV file) to AAC.
I assume that this is affecting the duration of MP4 videos created with an still image and audio (which is the reason I'm reporting this bug).

How to reproduce:
(espeak is a TTS engine. -w in espeak will save the output speech to a wav file)

$ espeak -s 80 -w /tmp/in.wav 'This product is meant for educational purposes only. Any resemblance to real persons, living or dead is purely coincidental. Void where prohibited. Some assembly required. List each check separately by bank number. Batteries not included. Contents may settle during shipment. Use only as directed. No other warranty expressed or implied. Do not use while operating a motor vehicle or heavy equipment. Postage will be paid by addressee. Subject to CARB approval.'


$ ffmpeg -y -i /tmp/in.wav -vn -c:a aac -strict -2 -ab 24k -ar 16000 /tmp/out.aac
ffmpeg version 2.8.2-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, wav, from '/tmp/in.wav':
  Duration: 00:01:00.33, bitrate: 352 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, s16, 352 kb/s
Output #0, adts, to '/tmp/out.aac':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Audio: aac, 16000 Hz, mono, fltp, 24 kb/s
    Metadata:
      encoder         : Lavc56.60.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
size=     195kB time=00:01:00.35 bitrate=  26.5kbits/s    
video:0kB audio:189kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.422557%


$ for i in /tmp/in.wav /tmp/out.aac; do ffprobe -i $i 2>&1 | grep Duration; done
  Duration: 00:01:00.33, bitrate: 352 kb/s
  Duration: 00:03:19.68, bitrate: 8 kb/s

If you encode the WAV files to MP3 and then to AAC, once again, you get different, longer audio streams:

$ ffmpeg -y -i /tmp/in.wav -vn -strict -2 -ab 24k -ar 16000 -f mp3 /tmp/out.mp3
...
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> mp3 (libmp3lame))
...
size=     177kB time=00:01:00.33 bitrate=  24.1kbits/s


$ ffmpeg -y -i /tmp/out.mp3 -vn -c:a aac -strict -2 -ab 24k -ar 16000 /tmp/out.aac


$ for i in /tmp/out.mp3 /tmp/out.aac; do ffprobe -i $i 2>&1 | grep Duration; done
  Duration: 00:01:00.41, start: 0.069063, bitrate: 24 kb/s
  Duration: 00:01:06.31, bitrate: 23 kb/s

Interestingly, I ran espeak with a different input ('This is some sample text to test audio encoding. ' repeated 10 times) and it gave me a shorter difference between the duration of the encoded output files.

I tried this with OGG/libvorbis files, the duration of output AAC file didn't seem to be affected.

For MP4s:

$ ffprobe -i /tmp/in.wav 2>&1 | grep Duration
  Duration: 00:01:00.33, bitrate: 352 kb/s


$ ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -i /tmp/in.wav -c:v libx264 -preset veryfast -tune stillimage -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4                                
ffmpeg version 2.8.2-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[mjpeg @ 0x4b1daa0] Changeing bps to 8
Input #0, image2, from '/tmp/in.jpg':
  Duration: 00:00:01.00, start: 0.000000, bitrate: 272 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 300x300 [SAR 1:1 DAR 1:1], 1 fps, 1 tbr, 1 tbn, 1 tbc
Guessed Channel Layout for  Input Stream #1.0 : mono
Input #1, wav, from '/tmp/in.wav':
  Duration: 00:01:00.33, bitrate: 352 kb/s
    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, s16, 352 kb/s
[swscaler @ 0x4b59e20] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x4b7eba0] using SAR=1/1
[libx264 @ 0x4b7eba0] using cpu capabilities: MMX2 SSE2Fast LZCNT
[libx264 @ 0x4b7eba0] profile High, level 1.2
[libx264 @ 0x4b7eba0] 264 - core 148 r209 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:-3:-3 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=2.00:0.70 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.20
Output #0, mp4, to '/tmp/out.mp4':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 300x300 [SAR 1:1 DAR 1:1], q=-1--1, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc56.60.100 libx264
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 16000 Hz, mono, fltp, 32 kb/s
    Metadata:
      encoder         : Lavc56.60.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[mp4 @ 0x4b38d40] Starting second pass: moving the moov atom to the beginning of the file
frame=   84 fps=0.0 q=-1.0 Lsize=     298kB time=00:01:22.00 bitrate=  29.8kbits/s    
video:48kB audio:243kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.420870%
[libx264 @ 0x4b7eba0] frame I:1     Avg QP:13.91  size: 46896
[libx264 @ 0x4b7eba0] frame P:21    Avg QP:11.16  size:    31
[libx264 @ 0x4b7eba0] frame B:62    Avg QP:16.35  size:    15
[libx264 @ 0x4b7eba0] consecutive B-frames:  1.2%  0.0%  3.6% 95.2%
[libx264 @ 0x4b7eba0] mb I  I16..4:  0.6%  5.5% 93.9%
[libx264 @ 0x4b7eba0] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.7%  0.0%  0.0%  0.0%  0.0%    skip:99.3%
[libx264 @ 0x4b7eba0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%
[libx264 @ 0x4b7eba0] 8x8 transform intra:5.5% inter:6.7%
[libx264 @ 0x4b7eba0] coded y,uvDC,uvAC intra: 97.9% 97.5% 94.7% inter: 0.0% 0.1% 0.0%
[libx264 @ 0x4b7eba0] i16 v,h,dc,p:  0%  0% 50% 50%
[libx264 @ 0x4b7eba0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  8% 51% 14%  4%  2%  1%  9%  5%  6%
[libx264 @ 0x4b7eba0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 22% 16%  6%  8%  5%  8%  7% 13%
[libx264 @ 0x4b7eba0] i8c dc,h,v,p: 41% 27% 18% 14%
[libx264 @ 0x4b7eba0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x4b7eba0] kb/s:4.62


$ ffprobe -i /tmp/out.mp4 2>&1 | grep Duration
  Duration: 00:01:24.00, start: 0.064000, bitrate: 29 kb/s

I talked in #ffmpeg @ freenode with another user who has the same problem with MP4s:

<user> llogan: http://sprunge.us/JYOS
<user> when i run that with a 4m45s audio stream, the first one has a duration of 4:50, the second one 4:56
<user> s/4:56/4:46/
<user> it's also not specific to aac or mp4
<user> and also according to mediainfo it's the video stream which is too long, not the audio stream
<user> and finally, increasing -r reduces the offset
<user> i assume it's an issue with the image2 muxer, but i don't know for sure
<user> and by for sure i of course mean at all

Change History (13)

comment:1 by Carl Eugen Hoyos, 8 years ago

Is this issue not reproducible with current FFmpeg git head?
Is this not reproducible with -f lavfi -i sine or -f s16le -i /dev/zero as input?

comment:2 by ausjjtkd, 8 years ago

I ran the previous commands with ffmpeg git (g8eadabf built on 20151120, from http://johnvansickle.com/ffmpeg/). I still get longer MP4 files, and this time, the output AAC file is shorter than it should:

$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -i /tmp/in.wav -vn -c:a aac -strict -2 -ab 24k -ar 16000 /tmp/out.aac
$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -i /tmp/in.wav -vn -strict -2 -ab 24k -ar 16000 -f mp3 /tmp/out.mp3


$ for i in /tmp/in.wav /tmp/out.aac /tmp/out.mp3; do ffprobe -i $i 2>&1 | grep Duration; done                                  
  Duration: 00:01:00.33, bitrate: 352 kb/s
  Duration: 00:00:59.51, bitrate: 27 kb/s
  Duration: 00:01:00.41, start: 0.069063, bitrate: 24 kb/s


$ mpv /tmp/out.aac 
A: 00:01:00 / 00:00:56 (100%) Cache:  0s+0KB

For MP4

$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -i /tmp/in.wav -c:v libx264 -preset veryfast -tune stillimage -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4


$ ffprobe -i /tmp/out.mp4 2>&1 | grep Duration
  Duration: 00:01:24.00, start: 0.064000, bitrate: 29 kb/s

For sine and /dev/zero:
In 2.8.2:

$ ffmpeg -y -f lavfi -i sine=duration=60 -vn -c:a aac -strict -2 -ab 24k -ar 16000 /tmp/out.aac

$ mpv /tmp/out.aac
...
A: 00:00:59 / 00:01:00 (98%) Cache:  0s+0KB


$ ffmpeg -y -f s16le -t 60 -i /dev/zero  -vn -c:a aac -strict -2 -ab 24k -ar 16000 /tmp/out.aac

$ mpv /tmp/out.aac
...
A: 00:00:59 / 00:01:00 (98%) Cache:  0s+0KB

In the git version:

$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -f lavfi -i sine=duration=60 -vn -c:a aac -strict -2 -ab 24k -ar 16000 /tmp/out.aac

$ ffprobe -i /tmp/out.aac 2>&1 | grep Duration
  Duration: 00:01:01.19, bitrate: 24 kb/s

$ mpv /tmp/out.aac
...
A: 00:00:59 / 00:01:01 (97%) Cache:  0s+0KB


$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -f s16le -t 60 -i /dev/zero  -vn -c:a aac -strict -2 -ab 24k -ar 16000 /tmp/out.aac

$ ffprobe -i /tmp/out.aac 2>&1 | grep Duration
  Duration: 00:01:00.49, bitrate: 1 kb/s

$ mpv /tmp/out.aac
...
A: 00:00:59 / 00:01:00 (98%) Cache:  0s+0KB
Last edited 8 years ago by ausjjtkd (previous) (diff)

comment:3 by Carl Eugen Hoyos, 8 years ago

Keywords: aac added
Version: 2.8.1git-master

(Command line and complete, uncut console output missing.)
I just tested faac and it produces an output file of 1:00.18, nero's output file is 1:00.22, aacplus encoded 1:00.09 for 44100Hz. Why do you think FFmpeg's output can be improved?

comment:4 by ausjjtkd, 8 years ago

I should have tested the git version before reporting... I don't think it's a problem for AAC anymore.

Still, I have problems with MP4 files being longer than they should. As I said, I assumed that AAC was the cause for this problem. Should I open a new bug report?

Last edited 8 years ago by ausjjtkd (previous) (diff)

comment:5 by ausjjtkd, 8 years ago

Here is my testing of MP4:

# -f lavfi -i sine, 60 secs
$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f lavfi -i sine=duration=60 -c:v libx264 -preset veryfast -tune stillimage -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4

# 60 seconds of audio, then only image
$ mpv /tmp/out.mp4 
...
AV: 00:01:22 / 00:01:23 (98%) A-V:  0.000 Cache:  0s+0KB


# -f s16le -i /dev/zero, 60 secs
$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f s16le -t 60 -i /dev/zero -c:v libx264 -preset veryfast -tune stillimage -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4

$ mpv /tmp/out.mp4 
...
AV: 00:01:22 / 00:01:23 (98%) A-V:  0.000 Cache:  0s+0KB


# -f lavfi -i sine=duration=60
$ ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f lavfi -i sine=duration=60 -c:v libx264 -preset veryfast -tune stillimage -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4

#same as above, 60 seconds of audio, then only image
$ mpv /tmp/out.mp4
...
AV: 00:01:22 / 00:01:23 (98%) A-V:  0.000 Cache:  0s+0KB


# -f s16le -t 60 -i /dev/zero
$ ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f s16le -t 60 -i /dev/zero -c:v libx264 -preset veryfast -tune stillimage -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4

$ mpv /tmp/out.mp4
...
AV: 00:01:22 / 00:01:23 (98%) A-V:  0.000 Cache:  0s+0KB

comment:6 by Carl Eugen Hoyos, 8 years ago

Please provide one (complete) command line that allows to reproduce the issue together with its complete, uncut console output to make this a valid ticket. If an input file is required, please provide it, if the issue is reproducible with -f lavfi -i testsrc please use it.

comment:7 by Carl Eugen Hoyos, 8 years ago

If an issue is reproducible without using an external library (like x264), please don't use it.

comment:8 by ausjjtkd, 8 years ago

OK, sorry.
60 seconds of -f lavfi -i sine, for ffmpeg 2.8.2 and git:

$ ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f lavfi -i sine=duration=60 -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4                                               
ffmpeg version 2.8.2-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[mjpeg @ 0x42ca880] Changeing bps to 8
Input #0, image2, from '/tmp/in.jpg':
  Duration: 00:00:01.00, start: 0.000000, bitrate: 272 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 300x300 [SAR 1:1 DAR 1:1], 1 fps, 1 tbr, 1 tbn, 1 tbc
Input #1, lavfi, from 'sine=duration=60':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
[swscaler @ 0x430cae0] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x42d07a0] using SAR=1/1
[libx264 @ 0x42d07a0] using cpu capabilities: MMX2 SSE2Fast LZCNT
[libx264 @ 0x42d07a0] profile High, level 1.2
[libx264 @ 0x42d07a0] 264 - core 148 r209 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/tmp/out.mp4':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 300x300 [SAR 1:1 DAR 1:1], q=-1--1, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc56.60.100 libx264
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 16000 Hz, mono, fltp, 32 kb/s
    Metadata:
      encoder         : Lavc56.60.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[mp4 @ 0x42cfb00] Starting second pass: moving the moov atom to the beginning of the file
frame=  113 fps= 97 q=-1.0 Lsize=     300kB time=00:01:51.00 bitrate=  22.2kbits/s    
video:58kB audio:235kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.508192%
[libx264 @ 0x42d07a0] frame I:1     Avg QP: 9.62  size: 55989
[libx264 @ 0x42d07a0] frame P:28    Avg QP: 7.62  size:    42
[libx264 @ 0x42d07a0] frame B:84    Avg QP:16.33  size:    15
[libx264 @ 0x42d07a0] consecutive B-frames:  0.9%  0.0%  0.0% 99.1%
[libx264 @ 0x42d07a0] mb I  I16..4:  2.8% 70.4% 26.9%
[libx264 @ 0x42d07a0] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.8%  0.0%  0.1%  0.0%  0.0%    skip:99.2%
[libx264 @ 0x42d07a0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%  L0: 0.0% L1:100.0% BI: 0.0%
[libx264 @ 0x42d07a0] 8x8 transform intra:70.4% inter:43.3%
[libx264 @ 0x42d07a0] coded y,uvDC,uvAC intra: 98.3% 97.2% 95.8% inter: 0.1% 0.1% 0.0%
[libx264 @ 0x42d07a0] i16 v,h,dc,p: 10%  0% 40% 50%
[libx264 @ 0x42d07a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 28% 13%  5%  5%  5%  9%  8% 15%
[libx264 @ 0x42d07a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 17% 14% 10%  6%  6% 11%  9% 13%
[libx264 @ 0x42d07a0] i8c dc,h,v,p: 43% 28% 18% 12%
[libx264 @ 0x42d07a0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x42d07a0] ref P L0: 97.6%  0.0%  2.4%
[libx264 @ 0x42d07a0] kb/s:4.13


$ mpv /tmp/out.mp4 
Auto-loading profile 'vo.vdpau'
Playing: /tmp/out.mp4
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=und (*) (aac)
AO: [pulse] 16000Hz mono 1ch float
Using hardware decoding (vdpau).
VO: [vdpau] 300x300 vdpau
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
AV: 00:01:52 / 00:01:53 (99%) A-V:  0.000 Cache:  0s+0KB




$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f lavfi -i sine=duration=60 -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4  
ffmpeg version N-51228-g8eadabf-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
  libavutil      55.  7.100 / 55.  7.100
  libavcodec     57. 15.100 / 57. 15.100
  libavformat    57. 16.100 / 57. 16.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 15.100 /  6. 15.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mjpeg @ 0x3fc2940] Changeing bps to 8
Input #0, image2, from '/tmp/in.jpg':
  Duration: 00:00:01.00, start: 0.000000, bitrate: 272 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 300x300 [SAR 1:1 DAR 1:1], 1 fps, 1 tbr, 1 tbn, 1 tbc
Input #1, lavfi, from 'sine=duration=60':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
[swscaler @ 0x3ffa2e0] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x3fc8860] using SAR=1/1
[libx264 @ 0x3fc8860] using cpu capabilities: MMX2 SSE2Fast LZCNT
[libx264 @ 0x3fc8860] profile High, level 1.2
[libx264 @ 0x3fc8860] 264 - core 148 r209 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/tmp/out.mp4':
  Metadata:
    encoder         : Lavf57.16.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 300x300 [SAR 1:1 DAR 1:1], q=-1--1, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc57.15.100 libx264
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 16000 Hz, mono, fltp, 32 kb/s
    Metadata:
      encoder         : Lavc57.15.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[mp4 @ 0x3fc7b20] Starting second pass: moving the moov atom to the beginning of the file
frame=  113 fps= 55 q=-1.0 Lsize=     300kB time=00:01:51.00 bitrate=  22.2kbits/s    
video:58kB audio:235kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.509380%
[libx264 @ 0x3fc8860] frame I:1     Avg QP: 9.62  size: 55989
[libx264 @ 0x3fc8860] frame P:28    Avg QP: 7.62  size:    42
[libx264 @ 0x3fc8860] frame B:84    Avg QP:16.33  size:    15
[libx264 @ 0x3fc8860] consecutive B-frames:  0.9%  0.0%  0.0% 99.1%
[libx264 @ 0x3fc8860] mb I  I16..4:  2.8% 70.4% 26.9%
[libx264 @ 0x3fc8860] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.8%  0.0%  0.1%  0.0%  0.0%    skip:99.2%
[libx264 @ 0x3fc8860] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%  L0: 0.0% L1:100.0% BI: 0.0%
[libx264 @ 0x3fc8860] 8x8 transform intra:70.4% inter:43.3%
[libx264 @ 0x3fc8860] coded y,uvDC,uvAC intra: 98.3% 97.2% 95.8% inter: 0.1% 0.1% 0.0%
[libx264 @ 0x3fc8860] i16 v,h,dc,p: 10%  0% 40% 50%
[libx264 @ 0x3fc8860] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 28% 13%  5%  5%  5%  9%  8% 15%
[libx264 @ 0x3fc8860] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 17% 14% 10%  6%  6% 11%  9% 13%
[libx264 @ 0x3fc8860] i8c dc,h,v,p: 43% 28% 18% 12%
[libx264 @ 0x3fc8860] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x3fc8860] ref P L0: 97.6%  0.0%  2.4%
[libx264 @ 0x3fc8860] kb/s:4.13
[aac @ 0x3fc9280] Qavg: 221.762


$ mpv /tmp/out.mp4 
Auto-loading profile 'vo.vdpau'
Playing: /tmp/out.mp4
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=und (*) (aac)
AO: [pulse] 16000Hz mono 1ch float
Using hardware decoding (vdpau).
VO: [vdpau] 300x300 vdpau
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
AV: 00:01:52 / 00:01:53 (99%) A-V:  0.000 Cache:  0s+0KB

60 seconds of -f s16le -i /dev/zero, for ffmpeg 2.8.2 and git:

$ ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f s16le -t 60 -i /dev/zero -c:v libx264 -preset veryfast -tune stillimage -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4
ffmpeg version 2.8.2-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[mjpeg @ 0x441eae0] Changeing bps to 8
Input #0, image2, from '/tmp/in.jpg':
  Duration: 00:00:01.00, start: 0.000000, bitrate: 272 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 300x300 [SAR 1:1 DAR 1:1], 1 fps, 1 tbr, 1 tbn, 1 tbc
Guessed Channel Layout for  Input Stream #1.0 : mono
Input #1, s16le, from '/dev/zero':
  Duration: N/A, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
[swscaler @ 0x4458a20] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x44bd660] using SAR=1/1
[libx264 @ 0x44bd660] using cpu capabilities: MMX2 SSE2Fast LZCNT
[libx264 @ 0x44bd660] profile High, level 1.2
[libx264 @ 0x44bd660] 264 - core 148 r209 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:-3:-3 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=2.00:0.70 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.20
Output #0, mp4, to '/tmp/out.mp4':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 300x300 [SAR 1:1 DAR 1:1], q=-1--1, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc56.60.100 libx264
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 16000 Hz, mono, fltp, 32 kb/s
    Metadata:
      encoder         : Lavc56.60.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[mp4 @ 0x44bc540] Starting second pass: moving the moov atom to the beginning of the file
frame=   83 fps=0.0 q=-1.0 Lsize=      59kB time=00:01:21.00 bitrate=   5.9kbits/s    
video:48kB audio:4kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 13.519329%
[libx264 @ 0x44bd660] frame I:1     Avg QP:13.91  size: 46896
[libx264 @ 0x44bd660] frame P:21    Avg QP:11.25  size:    31
[libx264 @ 0x44bd660] frame B:61    Avg QP:16.34  size:    15
[libx264 @ 0x44bd660] consecutive B-frames:  1.2%  2.4%  0.0% 96.4%
[libx264 @ 0x44bd660] mb I  I16..4:  0.6%  5.5% 93.9%
[libx264 @ 0x44bd660] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.7%  0.0%  0.0%  0.0%  0.0%    skip:99.3%
[libx264 @ 0x44bd660] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%
[libx264 @ 0x44bd660] 8x8 transform intra:5.5% inter:10.3%
[libx264 @ 0x44bd660] coded y,uvDC,uvAC intra: 97.9% 97.5% 94.7% inter: 0.0% 0.1% 0.0%
[libx264 @ 0x44bd660] i16 v,h,dc,p:  0%  0% 50% 50%
[libx264 @ 0x44bd660] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  8% 51% 14%  4%  2%  1%  9%  5%  6%
[libx264 @ 0x44bd660] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 22% 16%  6%  8%  5%  8%  7% 13%
[libx264 @ 0x44bd660] i8c dc,h,v,p: 41% 27% 18% 14%
[libx264 @ 0x44bd660] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x44bd660] kb/s:4.67


$ mpv /tmp/out.mp4
Auto-loading profile 'vo.vdpau'
Playing: /tmp/out.mp4
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=und (*) (aac)
AO: [pulse] 16000Hz mono 1ch float
Using hardware decoding (vdpau).
VO: [vdpau] 300x300 vdpau
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
AV: 00:01:22 / 00:01:23 (98%) A-V:  0.000 Cache:  0s+0KB


$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f s16le -t 60 -i /dev/zero -c:v libx264 -preset veryfast -tune stillimage -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4
ffmpeg version N-51228-g8eadabf-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
  libavutil      55.  7.100 / 55.  7.100
  libavcodec     57. 15.100 / 57. 15.100
  libavformat    57. 16.100 / 57. 16.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 15.100 /  6. 15.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mjpeg @ 0x4134980] Changeing bps to 8
Input #0, image2, from '/tmp/in.jpg':
  Duration: 00:00:01.00, start: 0.000000, bitrate: 272 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 300x300 [SAR 1:1 DAR 1:1], 1 fps, 1 tbr, 1 tbn, 1 tbc
Guessed Channel Layout for  Input Stream #1.0 : mono
Input #1, s16le, from '/dev/zero':
  Duration: N/A, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
[swscaler @ 0x4164320] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x41d3520] using SAR=1/1
[libx264 @ 0x41d3520] using cpu capabilities: MMX2 SSE2Fast LZCNT
[libx264 @ 0x41d3520] profile High, level 1.2
[libx264 @ 0x41d3520] 264 - core 148 r209 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:-3:-3 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=2.00:0.70 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.20
Output #0, mp4, to '/tmp/out.mp4':
  Metadata:
    encoder         : Lavf57.16.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 300x300 [SAR 1:1 DAR 1:1], q=-1--1, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc57.15.100 libx264
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 16000 Hz, mono, fltp, 32 kb/s
    Metadata:
      encoder         : Lavc57.15.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[mp4 @ 0x41d2640] Starting second pass: moving the moov atom to the beginning of the file
frame=   83 fps=0.0 q=-1.0 Lsize=      59kB time=00:01:21.00 bitrate=   5.9kbits/s    
video:48kB audio:4kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 13.519329%
[libx264 @ 0x41d3520] frame I:1     Avg QP:13.91  size: 46896
[libx264 @ 0x41d3520] frame P:21    Avg QP:11.25  size:    31
[libx264 @ 0x41d3520] frame B:61    Avg QP:16.34  size:    15
[libx264 @ 0x41d3520] consecutive B-frames:  1.2%  2.4%  0.0% 96.4%
[libx264 @ 0x41d3520] mb I  I16..4:  0.6%  5.5% 93.9%
[libx264 @ 0x41d3520] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.7%  0.0%  0.0%  0.0%  0.0%    skip:99.3%
[libx264 @ 0x41d3520] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%
[libx264 @ 0x41d3520] 8x8 transform intra:5.5% inter:10.3%
[libx264 @ 0x41d3520] coded y,uvDC,uvAC intra: 97.9% 97.5% 94.7% inter: 0.0% 0.1% 0.0%
[libx264 @ 0x41d3520] i16 v,h,dc,p:  0%  0% 50% 50%
[libx264 @ 0x41d3520] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  8% 51% 14%  4%  2%  1%  9%  5%  6%
[libx264 @ 0x41d3520] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 22% 16%  6%  8%  5%  8%  7% 13%
[libx264 @ 0x41d3520] i8c dc,h,v,p: 41% 27% 18% 14%
[libx264 @ 0x41d3520] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x41d3520] kb/s:4.67
[aac @ 0x41d6be0] Qavg: 65362.762


$ mpv /tmp/out.mp4 
Auto-loading profile 'vo.vdpau'
Playing: /tmp/out.mp4
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=und (*) (aac)
AO: [pulse] 16000Hz mono 1ch float
Using hardware decoding (vdpau).
VO: [vdpau] 300x300 vdpau
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
AV: 00:01:22 / 00:01:23 (98%) A-V:  0.000 Cache:  0s+0KB

comment:9 by ausjjtkd, 8 years ago

Without either -c:v or -c:a:

$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f lavfi -i sine=duration=60 -shortest -f mp4 /tmp/out.mp4                                                                       
ffmpeg version N-51228-g8eadabf-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
  libavutil      55.  7.100 / 55.  7.100
  libavcodec     57. 15.100 / 57. 15.100
  libavformat    57. 16.100 / 57. 16.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 15.100 /  6. 15.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mjpeg @ 0x4cc0920] Changeing bps to 8
Input #0, image2, from '/tmp/in.jpg':
  Duration: 00:00:01.00, start: 0.000000, bitrate: 272 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 300x300 [SAR 1:1 DAR 1:1], 1 fps, 1 tbr, 1 tbn, 1 tbc
Input #1, lavfi, from 'sine=duration=60':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.                                                                                             
[libx264 @ 0x4cda380] using SAR=1/1
[libx264 @ 0x4cda380] using cpu capabilities: MMX2 SSE2Fast LZCNT
[libx264 @ 0x4cda380] profile High, level 1.2
[libx264 @ 0x4cda380] 264 - core 148 r209 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/tmp/out.mp4':
  Metadata:
    encoder         : Lavf57.16.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p(pc), 300x300 [SAR 1:1 DAR 1:1], q=-1--1, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc57.15.100 libx264
    Stream #0:1: Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100 Hz, mono, s16, 128 kb/s
    Metadata:
      encoder         : Lavc57.15.100 libvo_aacenc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
frame=  113 fps=0.0 q=-1.0 Lsize=    1011kB time=00:01:51.00 bitrate=  74.6kbits/s    
video:59kB audio:938kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.340588%
[libx264 @ 0x4cda380] frame I:1     Avg QP: 9.99  size: 57599
[libx264 @ 0x4cda380] frame P:28    Avg QP: 8.26  size:    34
[libx264 @ 0x4cda380] frame B:84    Avg QP:17.33  size:    14
[libx264 @ 0x4cda380] consecutive B-frames:  0.9%  0.0%  0.0% 99.1%
[libx264 @ 0x4cda380] mb I  I16..4:  2.8% 69.3% 28.0%
[libx264 @ 0x4cda380] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.4%  0.0%  0.0%  0.0%  0.0%    skip:99.6%
[libx264 @ 0x4cda380] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%  L0: 0.0% L1:100.0% BI: 0.0%
[libx264 @ 0x4cda380] 8x8 transform intra:69.3% inter:33.3%
[libx264 @ 0x4cda380] coded y,uvDC,uvAC intra: 98.3% 97.8% 95.6% inter: 0.0% 0.0% 0.0%
[libx264 @ 0x4cda380] i16 v,h,dc,p: 20% 20% 30% 30%
[libx264 @ 0x4cda380] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 30% 13%  6%  4%  5%  8%  8% 15%
[libx264 @ 0x4cda380] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 15% 13%  9%  7%  7% 11% 10% 12%
[libx264 @ 0x4cda380] i8c dc,h,v,p: 42% 27% 18% 13%
[libx264 @ 0x4cda380] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x4cda380] ref P L0: 93.3%  0.0%  6.7%
[libx264 @ 0x4cda380] kb/s:4.23


$ mpv /tmp/out.mp4 
Auto-loading profile 'vo.vdpau'
Playing: /tmp/out.mp4
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=und (*) (aac)
AO: [pulse] 44100Hz mono 1ch float
[ffmpeg/video] h264: get_buffer() failed
[ffmpeg/video] h264: thread_get_buffer() failed
[ffmpeg/video] h264: decode_slice_header error
[ffmpeg/video] h264: no frame!
Error while decoding frame!
Using software decoding.
VO: [vdpau] 300x300 yuv420p
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
AV: 00:01:52 / 00:01:53 (99%) A-V:  0.000 Cache:  0s+0KB

Tested libx265, still longer duration:

$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f lavfi -i sine=duration=60 -c:v libx265 -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4
ffmpeg version N-51228-g8eadabf-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
  libavutil      55.  7.100 / 55.  7.100
  libavcodec     57. 15.100 / 57. 15.100
  libavformat    57. 16.100 / 57. 16.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 15.100 /  6. 15.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mjpeg @ 0x4431a00] Changeing bps to 8
Input #0, image2, from '/tmp/in.jpg':
  Duration: 00:00:01.00, start: 0.000000, bitrate: 272 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 300x300 [SAR 1:1 DAR 1:1], 1 fps, 1 tbr, 1 tbn, 1 tbc
Input #1, lavfi, from 'sine=duration=60':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
[swscaler @ 0x44691a0] deprecated pixel format used, make sure you did set range correctly
x265 [info]: HEVC encoder version 1.8+109-f722fb55404b
x265 [info]: build info [Linux][GCC 5.2.1][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT
x265 [info]: Main profile, Level-2 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: frame threads / pool features       : 2 / wpp(5 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut       : 1 / 250 / 40
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / 0 / 0
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=0.30 signhide tmvp strong-intra-smoothing
x265 [info]: tools: deblock sao
Output #0, mp4, to '/tmp/out.mp4':
  Metadata:
    encoder         : Lavf57.16.100
    Stream #0:0: Video: hevc (libx265) ([35][0][0][0] / 0x0023), yuv420p, 300x300 [SAR 1:1 DAR 1:1], q=2-31, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc57.15.100 libx265
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 16000 Hz, mono, fltp, 32 kb/s
    Metadata:
      encoder         : Lavc57.15.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> hevc (libx265))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[mp4 @ 0x4435500] Starting second pass: moving the moov atom to the beginning of the file
frame=   91 fps= 34 q=-0.0 Lsize=     281kB time=00:01:29.00 bitrate=  25.9kbits/s    
video:38kB audio:235kB subtitle:0kB other streams:0kB global headers:1kB muxing overhead: 2.925182%
x265 [info]: frame I:      1, Avg QP:16.43  kb/s: 285.49  
x265 [info]: frame P:     28, Avg QP:21.99  kb/s: 0.40    
x265 [info]: frame B:     62, Avg QP:24.42  kb/s: 0.22    
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 27.6% 10.3% 20.7% 3.4% 37.9% 

encoded 91 frames in 2.67s (34.05 fps), 3.41 kb/s, Avg QP:23.59
[aac @ 0x444a580] Qavg: 221.762


$ mpv /tmp/out.mp4 
Auto-loading profile 'vo.vdpau'
Playing: /tmp/out.mp4
 (+) Video --vid=1 (*) (hevc)
 (+) Audio --aid=1 --alang=und (*) (aac)
AO: [pulse] 16000Hz mono 1ch float
Using software decoding.
VO: [vdpau] 300x300 yuv420p
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
AV: 00:01:30 / 00:01:31 (98%) A-V:  0.000 Cache:  0s+0KB



$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f s16le -t 60 -i /dev/zero -c:v libx265 -c:a aac -ab 32k -ar 16000 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4                     ffmpeg version N-51228-g8eadabf-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
  libavutil      55.  7.100 / 55.  7.100
  libavcodec     57. 15.100 / 57. 15.100
  libavformat    57. 16.100 / 57. 16.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 15.100 /  6. 15.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mjpeg @ 0x3718a40] Changeing bps to 8
Input #0, image2, from '/tmp/in.jpg':
  Duration: 00:00:01.00, start: 0.000000, bitrate: 272 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 300x300 [SAR 1:1 DAR 1:1], 1 fps, 1 tbr, 1 tbn, 1 tbc
Guessed Channel Layout for  Input Stream #1.0 : mono
Input #1, s16le, from '/dev/zero':
  Duration: N/A, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
[swscaler @ 0x37481e0] deprecated pixel format used, make sure you did set range correctly
x265 [info]: HEVC encoder version 1.8+109-f722fb55404b
x265 [info]: build info [Linux][GCC 5.2.1][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT
x265 [info]: Main profile, Level-2 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: frame threads / pool features       : 2 / wpp(5 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut       : 1 / 250 / 40
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / 0 / 0
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=0.30 signhide tmvp strong-intra-smoothing
x265 [info]: tools: deblock sao
Output #0, mp4, to '/tmp/out.mp4':
  Metadata:
    encoder         : Lavf57.16.100
    Stream #0:0: Video: hevc (libx265) ([35][0][0][0] / 0x0023), yuv420p, 300x300 [SAR 1:1 DAR 1:1], q=2-31, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc57.15.100 libx265
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 16000 Hz, mono, fltp, 32 kb/s
    Metadata:
      encoder         : Lavc57.15.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> hevc (libx265))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[mp4 @ 0x37a5fa0] Starting second pass: moving the moov atom to the beginning of the file
frame=   91 fps= 43 q=-0.0 Lsize=      50kB time=00:01:29.00 bitrate=   4.6kbits/s    
video:38kB audio:4kB subtitle:0kB other streams:0kB global headers:1kB muxing overhead: 19.056820%
x265 [info]: frame I:      1, Avg QP:16.43  kb/s: 285.49  
x265 [info]: frame P:     28, Avg QP:21.99  kb/s: 0.40    
x265 [info]: frame B:     62, Avg QP:24.42  kb/s: 0.22    
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 27.6% 10.3% 20.7% 3.4% 37.9% 

encoded 91 frames in 2.14s (42.43 fps), 3.41 kb/s, Avg QP:23.59
[aac @ 0x37a8240] Qavg: 65362.762


$ mpv /tmp/out.mp4 
Auto-loading profile 'vo.vdpau'
Playing: /tmp/out.mp4
 (+) Video --vid=1 (*) (hevc)
 (+) Audio --aid=1 --alang=und (*) (aac)
AO: [pulse] 16000Hz mono 1ch float
Using software decoding.
VO: [vdpau] 300x300 yuv420p
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
AV: 00:01:30 / 00:01:31 (98%) A-V:  0.000 Cache:  0s+0KB

libx265, after removing -c:a aac

$ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -framerate 1 -r 1 -loop 1 -i /tmp/in.jpg -f lavfi -i sine=duration=60 -c:v libx265 -strict experimental -shortest -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4                                               
ffmpeg version N-51228-g8eadabf-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
  libavutil      55.  7.100 / 55.  7.100
  libavcodec     57. 15.100 / 57. 15.100
  libavformat    57. 16.100 / 57. 16.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 15.100 /  6. 15.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mjpeg @ 0x4a4c9e0] Changeing bps to 8
Input #0, image2, from '/tmp/in.jpg':
  Duration: 00:00:01.00, start: 0.000000, bitrate: 272 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 300x300 [SAR 1:1 DAR 1:1], 1 fps, 1 tbr, 1 tbn, 1 tbc
Input #1, lavfi, from 'sine=duration=60':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
[swscaler @ 0x4a84180] deprecated pixel format used, make sure you did set range correctly
x265 [info]: HEVC encoder version 1.8+109-f722fb55404b
x265 [info]: build info [Linux][GCC 5.2.1][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT
x265 [info]: Main profile, Level-2 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: frame threads / pool features       : 2 / wpp(5 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut       : 1 / 250 / 40
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / 0 / 0
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=0.30 signhide tmvp strong-intra-smoothing
x265 [info]: tools: deblock sao
Output #0, mp4, to '/tmp/out.mp4':
  Metadata:
    encoder         : Lavf57.16.100
    Stream #0:0: Video: hevc (libx265) ([35][0][0][0] / 0x0023), yuv420p, 300x300 [SAR 1:1 DAR 1:1], q=2-31, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc57.15.100 libx265
    Stream #0:1: Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100 Hz, mono, s16, 128 kb/s
    Metadata:
      encoder         : Lavc57.15.100 libvo_aacenc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> hevc (libx265))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
[mp4 @ 0x4a655c0] Starting second pass: moving the moov atom to the beginning of the file
frame=   91 fps= 39 q=-0.0 Lsize=     990kB time=00:01:29.00 bitrate=  91.2kbits/s    
video:38kB audio:938kB subtitle:0kB other streams:0kB global headers:1kB muxing overhead: 1.435365%
x265 [info]: frame I:      1, Avg QP:16.43  kb/s: 285.49  
x265 [info]: frame P:     28, Avg QP:21.99  kb/s: 0.40    
x265 [info]: frame B:     62, Avg QP:24.42  kb/s: 0.22    
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 27.6% 10.3% 20.7% 3.4% 37.9% 

encoded 91 frames in 2.42s (37.58 fps), 3.41 kb/s, Avg QP:23.59


$ mpv /tmp/out.mp4 
Auto-loading profile 'vo.vdpau'
Playing: /tmp/out.mp4
 (+) Video --vid=1 (*) (hevc)
 (+) Audio --aid=1 --alang=und (*) (aac)
AO: [pulse] 44100Hz mono 1ch float
Using software decoding.
VO: [vdpau] 300x300 yuv420p
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
AV: 00:01:30 / 00:01:31 (98%) A-V:  0.000 Cache:  0s+0KB

comment:10 by ausjjtkd, 8 years ago

Hmm, it's not just MP4s, WEBMs and MKVs are longer than the input audio files, too.
Just guessing, but I wonder if the problem is -shortest.

comment:11 by Michael Niedermayer, 8 years ago

Keywords: shortest added
Summary: Incorrect duration when converting WAV/MP3 files to AACIncorrect duration when converting WAV/MP3 files to AAC with -shortest

related tickets: #3433, #3789, #5456

comment:12 by Michael Niedermayer, 8 years ago

Reproduced by developer: set

this is also reproduceable still

 ./ffmpeg -y -framerate 1 -r 1 -loop 1 -i lena.pnm -f lavfi -i sine=duration=60   -shortest  -f mp4 /tmp/out.mp4

resulting file is 2min long

comment:13 by Michael Niedermayer, 8 years ago

Status: newopen

Not sure this is a duplicate of the other 3 referenced tickets, but as its reproduceable new->open

Note: See TracTickets for help on using tickets.