[FFmpeg-user] Frame number repeats and time resets when encoding
Jason Palmer
jpalmer at worldnow.com
Mon Jul 22 18:01:50 CEST 2013
Hi
I am attempting to create a .mp4 file from an AJA Capture Source and I am seeing the following that I cannot explain:
1. The audio is out of sync with the video. I have tried the -async, -itsoffset, -ss flags and they did not work.
2. The frame number starts at frame 167 (instead of 0) and it repeats itself towards the end of the recorded video. In the output below, note how frame 871 is repeated multiple times.
3. The time of the output of ffmpeg starts at 5.75 seconds (instead of 0 seconds) and starts over. In the output below, note how once the output reaches 30 seconds (as specified by the -t flag), it starts over for about the same amount of time that ffmpeg takes to start the recording (~5.75 seconds). It is also at this time when the frame number repeats itself.
Interestingly, the 5.75 seconds that ffmpeg takes to start recording is approximately how long the audio/video is out of sync. Note that I am copying the video stream (which is in h264 format) and the audio stream (which is in aac format). Any help/explanation would be greatly appreciated.
Here is the command I am using:
FFMPEG.EXE -y -rtbufsize 100M -f dshow -i video="Virtual Capture Source" -acodec aac -f dshow -i audio="Virtual Capture Source" -map 0:0 -map 1:0 -absf aac_adtstoasc -acodec copy -vcodec copy -vsync drop -r 29 -copyinkf -aspect 16:9 -t 00:00:30 out.mp4
Here is my output:
FFMPEG.EXE -y -rtbufsize 100M -f dshow -i video="Virtual Capture Sour
ce" -acodec aac -f dshow -i audio="Virtual Capture Source" -map 0:0 -map 1:0 -ab
sf aac_adtstoasc -acodec copy -vcodec copy -vsync drop -r 29 -copyinkf -aspect 1
6:9 -t 00:00:30 out.mp4
ffmpeg started on 2013-07-22 at 11:37:50
Report written to "log.txt"
ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers
built on Jul 15 2013 16:04:21 with gcc 4.8.0 (rubenvb-4.8.0)
configuration: --enable-static --disable-shared --prefix=/mingw/i686-w64-mingw
32 --arch=x86 --target-os=mingw32 --enable-gpl --enable-nonfree --enable-runtime
-cpudetect --enable-openssl --enable-libfreetype --enable-fontconfig --enable-li
bass --enable-zlib --enable-librtmp --enable-w32threads --enable-libx264 --enabl
e-libfdk-aac --enable-debug --disable-optimizations --disable-stripping
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
[h264 @ 05e8e5e0] non-existing SPS 32 referenced in buffering period
[h264 @ 05e8e5e0] non-existing PPS 0 referenced
[h264 @ 05e8e5e0] decode_slice_header error
[h264 @ 05e8e5e0] no frame!
[h264 @ 05e8e5e0] non-existing SPS 0 referenced in buffering period
[h264 @ 05e8e5e0] non-existing PPS 0 referenced
[h264 @ 05e8e5e0] decode_slice_header error
[h264 @ 05e8e5e0] no frame!
[h264 @ 05e8e5e0] non-existing SPS 32 referenced in buffering period
[h264 @ 05e8e5e0] non-existing PPS 0 referenced
[h264 @ 05e8e5e0] decode_slice_header error
[h264 @ 05e8e5e0] no frame!
[h264 @ 05e8e5e0] non-existing SPS 0 referenced in buffering period
[h264 @ 05e8e5e0] non-existing PPS 0 referenced
[h264 @ 05e8e5e0] decode_slice_header error
[h264 @ 05e8e5e0] no frame!
[h264 @ 05e8e5e0] non-existing SPS 32 referenced in buffering period
[h264 @ 05e8e5e0] non-existing PPS 0 referenced
[h264 @ 05e8e5e0] decode_slice_header error
[h264 @ 05e8e5e0] no frame!
[h264 @ 05e8e5e0] non-existing SPS 0 referenced in buffering period
[h264 @ 05e8e5e0] non-existing PPS 0 referenced
[h264 @ 05e8e5e0] decode_slice_header error
[h264 @ 05e8e5e0] no frame!
[h264 @ 05e8e5e0] non-existing SPS 32 referenced in buffering period
[h264 @ 05e8e5e0] non-existing PPS 0 referenced
[h264 @ 05e8e5e0] decode_slice_header error
[h264 @ 05e8e5e0] no frame!
Input #0, dshow, from 'video=Virtual Capture Source':
Duration: N/A, start: 2341547.916000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p, 854x480 [SAR 1:1 DAR 427:240], 4 t
br, 10000k tbn, 58 tbc
Input #1, dshow, from 'audio=Virtual Capture Source':
Duration: N/A, start: 2341552.949000, bitrate: N/A
Stream #1:0: Audio: aac, 48000 Hz, stereo, fltp
Overriding aspect ratio with stream copy may produce invalid files
Output #0, mp4, to out.mp4':
Metadata:
encoder : Lavf55.12.100
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 854x480 [SAR 128
0:1281 DAR 16:9], q=2-31, 14848 tbn, 29 tbc
Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0767f040] Encoder did not produce proper pts, making some up.
frame= 167 fps=0.0 q=-1.0 size= 154kB time=00:00:05.75 bitrate= 219.6kbits/
frame= 182 fps=182 q=-1.0 size= 245kB time=00:00:06.27 bitrate= 319.9kbits/
frame= 196 fps=130 q=-1.0 size= 326kB time=00:00:06.75 bitrate= 395.6kbits/
frame= 211 fps=105 q=-1.0 size= 430kB time=00:00:07.27 bitrate= 483.7kbits/
frame= 225 fps= 90 q=-1.0 size= 559kB time=00:00:07.75 bitrate= 590.0kbits/
frame= 240 fps= 80 q=-1.0 size= 697kB time=00:00:08.27 bitrate= 689.8kbits/
frame= 254 fps= 72 q=-1.0 size= 776kB time=00:00:08.75 bitrate= 725.6kbits/
frame= 269 fps= 67 q=-1.0 size= 849kB time=00:00:09.27 bitrate= 750.0kbits/
frame= 283 fps= 63 q=-1.0 size= 910kB time=00:00:09.75 bitrate= 763.9kbits/
frame= 298 fps= 59 q=-1.0 size= 983kB time=00:00:10.27 bitrate= 784.0kbits/
frame= 312 fps= 57 q=-1.0 size= 1074kB time=00:00:10.75 bitrate= 818.0kbits/
frame= 327 fps= 54 q=-1.0 size= 1175kB time=00:00:11.27 bitrate= 854.0kbits/
frame= 341 fps= 52 q=-1.0 size= 1272kB time=00:00:11.75 bitrate= 886.3kbits/
frame= 356 fps= 51 q=-1.0 size= 1358kB time=00:00:12.27 bitrate= 905.9kbits/
frame= 371 fps= 49 q=-1.0 size= 1470kB time=00:00:12.79 bitrate= 941.4kbits/
frame= 385 fps= 48 q=-1.0 size= 1577kB time=00:00:13.27 bitrate= 973.1kbits/
frame= 400 fps= 47 q=-1.0 size= 1677kB time=00:00:13.79 bitrate= 996.0kbits/
frame= 414 fps= 46 q=-1.0 size= 1788kB time=00:00:14.27 bitrate=1026.2kbits/
frame= 429 fps= 45 q=-1.0 size= 1907kB time=00:00:14.79 bitrate=1055.8kbits/
frame= 443 fps= 44 q=-1.0 size= 2020kB time=00:00:15.27 bitrate=1083.3kbits/
frame= 458 fps= 43 q=-1.0 size= 2152kB time=00:00:15.79 bitrate=1116.2kbits/
frame= 472 fps= 43 q=-1.0 size= 2278kB time=00:00:16.27 bitrate=1146.6kbits/
frame= 487 fps= 42 q=-1.0 size= 2338kB time=00:00:16.79 bitrate=1140.3kbits/
frame= 501 fps= 42 q=-1.0 size= 2429kB time=00:00:17.27 bitrate=1152.0kbits/
frame= 516 fps= 41 q=-1.0 size= 2543kB time=00:00:17.79 bitrate=1171.0kbits/
frame= 530 fps= 41 q=-1.0 size= 2626kB time=00:00:18.27 bitrate=1177.2kbits/
frame= 545 fps= 40 q=-1.0 size= 2725kB time=00:00:18.79 bitrate=1187.9kbits/
frame= 559 fps= 40 q=-1.0 size= 2840kB time=00:00:19.27 bitrate=1207.1kbits/
frame= 574 fps= 39 q=-1.0 size= 2941kB time=00:00:19.79 bitrate=1217.1kbits/
frame= 588 fps= 39 q=-1.0 size= 3058kB time=00:00:20.27 bitrate=1235.4kbits/
frame= 603 fps= 39 q=-1.0 size= 3170kB time=00:00:20.79 bitrate=1249.1kbits/
frame= 617 fps= 38 q=-1.0 size= 3299kB time=00:00:21.27 bitrate=1270.2kbits/
frame= 632 fps= 38 q=-1.0 size= 3335kB time=00:00:21.79 bitrate=1253.6kbits/
frame= 646 fps= 38 q=-1.0 size= 3424kB time=00:00:22.27 bitrate=1259.1kbits/
frame= 661 fps= 38 q=-1.0 size= 3554kB time=00:00:22.79 bitrate=1277.4kbits/
frame= 675 fps= 37 q=-1.0 size= 3633kB time=00:00:23.27 bitrate=1278.6kbits/
frame= 690 fps= 37 q=-1.0 size= 3724kB time=00:00:23.79 bitrate=1282.1kbits/
frame= 704 fps= 37 q=-1.0 size= 3830kB time=00:00:24.27 bitrate=1292.4kbits/
frame= 719 fps= 37 q=-1.0 size= 3942kB time=00:00:24.79 bitrate=1302.4kbits/
frame= 733 fps= 37 q=-1.0 size= 4051kB time=00:00:25.27 bitrate=1312.9kbits/
frame= 748 fps= 36 q=-1.0 size= 4131kB time=00:00:25.79 bitrate=1312.0kbits/
frame= 762 fps= 36 q=-1.0 size= 4223kB time=00:00:26.27 bitrate=1316.6kbits/
frame= 777 fps= 36 q=-1.0 size= 4317kB time=00:00:26.79 bitrate=1320.1kbits/
frame= 791 fps= 36 q=-1.0 size= 4436kB time=00:00:27.27 bitrate=1332.4kbits/
frame= 806 fps= 36 q=-1.0 size= 4556kB time=00:00:27.79 bitrate=1342.8kbits/
frame= 820 fps= 36 q=-1.0 size= 4626kB time=00:00:28.27 bitrate=1340.2kbits/
frame= 835 fps= 35 q=-1.0 size= 4731kB time=00:00:28.79 bitrate=1346.1kbits/
frame= 849 fps= 35 q=-1.0 size= 4813kB time=00:00:29.27 bitrate=1346.8kbits/
frame= 864 fps= 35 q=-1.0 size= 4904kB time=00:00:29.79 bitrate=1348.4kbits/
frame= 871 fps= 35 q=-1.0 size= 4963kB time=00:00:25.28 bitrate=1608.3kbits/
frame= 871 fps= 34 q=-1.0 size= 5067kB time=00:00:25.79 bitrate=1609.5kbits/
frame= 871 fps= 33 q=-1.0 size= 5197kB time=00:00:26.28 bitrate=1619.9kbits/
frame= 871 fps= 33 q=-1.0 size= 5315kB time=00:00:26.77 bitrate=1626.1kbits/
frame= 871 fps= 32 q=-1.0 size= 5400kB time=00:00:27.28 bitrate=1621.2kbits/
frame= 871 fps= 32 q=-1.0 size= 5512kB time=00:00:27.77 bitrate=1625.7kbits/
frame= 871 fps= 31 q=-1.0 size= 5633kB time=00:00:28.28 bitrate=1631.4kbits/
frame= 871 fps= 30 q=-1.0 size= 5771kB time=00:00:28.77 bitrate=1642.7kbits/
frame= 871 fps= 30 q=-1.0 size= 5908kB time=00:00:29.29 bitrate=1652.3kbits/
frame= 871 fps= 29 q=-1.0 size= 6033kB time=00:00:29.78 bitrate=1659.5kbits/
frame= 871 fps= 29 q=-1.0 Lsize= 6094kB time=00:00:30.03 bitrate=1662.3kbits
/s
video:5493kB audio:586kB subtitle:0 global headers:0kB muxing overhead 0.249619%
More information about the ffmpeg-user
mailing list