[FFmpeg-user] Start time/duration question when transcoding to WMV/WMA

Robert Krüger krueger at lesspain.de
Tue Oct 14 14:03:45 CEST 2014


I observed that start times and durations changed when transcoding
whatever input (tried a few) to wmv/wma in a wmv container.

Here's a sample command line with output:

ffmpeg -f lavfi -i testsrc=s=640x480:d=1 -f lavfi -i
sine=frequency=1000:sample_rate=48000:duration=1 -c:v wmv2 -c:a wmav2
~/tmp/out.wmv
ffmpeg version N-66701-g33db995 Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct  8 2014 21:12:12 with Apple LLVM version 6.0
(clang-600.0.51) (based on LLVM 3.5svn)
  configuration: --enable-gpl --enable-libx264
--extra-cflags=-I/Users/krueger/src/x264
--extra-ldflags=-L/Users/krueger/src/x264
  libavutil      54.  9.100 / 54.  9.100
  libavcodec     56.  3.101 / 56.  3.101
  libavformat    56.  7.104 / 56.  7.104
  libavdevice    56.  1.100 / 56.  1.100
  libavfilter     5.  1.103 /  5.  1.103
  libswscale      3.  1.100 /  3.  1.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  1.100 / 53.  1.100
Input #0, lavfi, from 'testsrc=s=640x480:d=1':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24,
640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #1, lavfi, from 'sine=frequency=1000:sample_rate=48000:duration=1':
  Duration: N/A, start: 0.000000, bitrate: 768 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s
Output #0, asf, to '/Users/krueger/tmp/out.wmv':
  Metadata:
    WM/EncodingSettings: Lavf56.7.104
    Stream #0:0: Video: wmv2 (WMV2 / 0x32564D57), yuv420p, 640x480
[SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.3.101 wmv2
    Stream #0:1: Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, mono,
fltp, 128 kb/s
    Metadata:
      encoder         : Lavc56.3.101 wmav2
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> wmv2 (native))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> wmav2 (native))
Press [q] to stop, [?] for help
frame=   25 fps=0.0 q=1.7 Lsize=     107kB time=00:00:01.00 bitrate=
877.6kbits/s
video:85kB audio:16kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 6.368599%

This should result in a file of one second length but this is what
ffprobe tells me:

see ffprobe output:

ffprobe -show_streams -i ~/tmp/out.wmv
ffprobe version N-66701-g33db995 Copyright (c) 2007-2014 the FFmpeg developers
  built on Oct  8 2014 21:12:12 with Apple LLVM version 6.0
(clang-600.0.51) (based on LLVM 3.5svn)
  configuration: --enable-gpl --enable-libx264
--extra-cflags=-I/Users/krueger/src/x264
--extra-ldflags=-L/Users/krueger/src/x264
  libavutil      54.  9.100 / 54.  9.100
  libavcodec     56.  3.101 / 56.  3.101
  libavformat    56.  7.104 / 56.  7.104
  libavdevice    56.  1.100 / 56.  1.100
  libavfilter     5.  1.103 /  5.  1.103
  libswscale      3.  1.100 /  3.  1.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  1.100 / 53.  1.100
Input #0, asf, from '/Users/krueger/tmp/out.wmv':
  Metadata:
    encoder         : Lavf56.7.104
  Duration: 00:00:01.09, start: 0.000000, bitrate: 808 kb/s
    Stream #0:0: Video: wmv2 (WMV2 / 0x32564D57), yuv420p, 640x480,
SAR 1:1 DAR 4:3, 25 fps, 25 tbr, 1k tbn, 1k tbc
    Stream #0:1: Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, 1
channels, fltp, 128 kb/s
[STREAM]
index=0
codec_name=wmv2
codec_long_name=Windows Media Video 8
profile=unknown
codec_type=video
codec_time_base=1/1000
codec_tag_string=WMV2
codec_tag=0x32564d57
width=640
height=480
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=4:3
pix_fmt=yuv420p
level=-99
color_range=N/A
color_space=unknown
timecode=N/A
id=N/A
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/1000
start_pts=43

start_time=0.043000
^^^^^^^^^^^^^^^^^^^^^
duration_ts=1043
duration=1.043000
^^^^^^^^^^^^^^^^^^^

bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
[/STREAM]
[STREAM]
index=1
codec_name=wmav2
codec_long_name=Windows Media Audio 2
profile=unknown
codec_type=audio
codec_time_base=1/48000
codec_tag_string=a[1][0][0]
codec_tag=0x0161
sample_fmt=fltp
sample_rate=48000
channels=1
channel_layout=unknown
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=1043
duration=1.043000
^^^^^^^^^^^^^^^^^^^^
bit_rate=128000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
[/STREAM]

Is this due to encoder delay of WMA (2064 samples?) and is OK in principle?


More information about the ffmpeg-user mailing list