[Libav-user] Frames are not visually lining up between my code and ffmpeg.exe

Simon Daniels simondaniels23 at gmail.com
Tue Jun 26 21:09:10 CEST 2012


Sorry Carl -- here you go:


C:\Users\Simon>ffmpeg.exe -i "sample video.mp4" -vframes 1 -f image2 -sameq
-vcodec mjpeg "frame-%05d.jpg"
ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jun 12 2012 21:10:06 with gcc 4.6.3
  configuration: --enable-version3 --disable-w32threads
--enable-runtime-cpudete
ct --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass
--enable-lib
celt --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libfreetype
--enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg
--enabl
e-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora
--enable
-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enabl
e-zlib
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 01bbc940] multiple edit list entries, a/v desync
migh
t occur, patch welcome
    Last message repeated 1 times
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'PATHHIDDEN\sample video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf53.4.0
  Duration: 00:00:17.00, start: 0.013000, bitrate: 10128 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
1280x960
[SAR 1:1 DAR 4:3], 10609 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo,
s16, 128
 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : SoundHandler
[buffer @ 01bb8a40] w:1280 h:960 pixfmt:yuv420p tb:1/30000 sar:1/1
sws_param:fla
gs=2
[buffersink @ 01bb8ca0] No opaque field provided
[format @ 01bb8de0] auto-inserting filter 'auto-inserted scaler 0' between
the f
ilter 'src' and the filter 'format'
[scale @ 01bb9080] w:1280 h:960 fmt:yuv420p sar:1/1 -> w:1280 h:960
fmt:yuvj420p
 sar:1/1 flags:0x4
[buffer @ 0379ce60] w:1280 h:960 pixfmt:yuv420p tb:1/30000 sar:1/1
sws_param:fla
gs=2
[buffersink @ 037ad3a0] No opaque field provided
[format @ 037ad400] auto-inserting filter 'auto-inserted scaler 0' between
the f
ilter 'src' and the filter 'format'
[scale @ 037ad460] w:1280 h:960 fmt:yuv420p sar:1/1 -> w:1280 h:960
fmt:yuvj420p
 sar:1/1 flags:0x4
Output #0, image2, to 'ΓÇôsameq':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf54.6.100
    Stream #0:0(eng): Video: mjpeg, yuvj420p, 1280x960 [SAR 1:1 DAR 4:3],
q=2-31
, 200 kb/s, 90k tbn, 29.97 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
Output #1, image2, to 'PATHHIDDEN\frame-%05d.jpg':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf54.6.100
    Stream #1:0(eng): Video: mjpeg, yuvj420p, 1280x960 [SAR 1:1 DAR 4:3],
q=2-31
, 200 kb/s, 90k tbn, 29.97 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
  Stream #0:0 -> #1:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=1.0 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.7 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.5 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.4 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.3 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.3 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.2 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.2 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.2 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.2 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.2 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.2 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.1 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.1 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.1 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.1 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.1 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.1 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.1 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.1 q=6.4 q=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.0
frame=    1 fps=0.1 q=6.4 Lq=24.8 size=       0kB time=00:00:00.03 bitrate=
  0.
0kbits/s dup=30 drop=0
video:18652kB audio:0kB global headers:0kB muxing overhead -100.000000%



On Tue, Jun 26, 2012 at 11:44 AM, Michael Bradshaw <
mbradshaw at sorensonmedia.com> wrote:

> On Tue, Jun 26, 2012 at 12:34 PM, Simon Daniels
> <simondaniels23 at gmail.com> wrote:
> > // Is this a packet from the video stream?
> > if (packet.stream_index == videoStreamIndex && frameLocation++ %
> frameSkip
> > == 0)
> > {
> > // Decode video frame
> > avcodec_decode_video2(pCodecCtx, pFrameYUV, &isFrameFinished, &packet);
>
> You don't want to be doing it like this, I don't think. If there are B
> frames in the video, this could really mess things up (because frame 2
> could depend on decoding frame 1 just before it, but you skipped
> decoding frame 1, so now frame 2 is junk/gets decoded wrong (and now
> all the ones decoded after it will be junk frames too until you hit a
> keyframe)).
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120626/a62ae3d4/attachment.html>


More information about the Libav-user mailing list