[FFmpeg-user] output truncation - 1/2 length of soundtrack's length

Robert Rowntree rowntreerob at gmail.com
Fri Jul 1 11:46:24 CEST 2011


ffmpeg use case to merge slides(jpg) and a sound track (3gpp) from a phone
with the output suitable for Youtube uploads  (mp4 or wmv)

ffmpeg pattern from how to's :

      ffmpeg -loop_input -vframes <number_of_frames> -i <input_file>
<output_file>   - Make a Video File from a Single Frame

my CLI for wmv output format -

* ./ffmpeg  -loop_input -f image2  -i Optimized-DSC01459.JPG -i
rec_1459.3gpp -acodec wmav2 -vcodec wmv2    myoutfile.wmv*
*
*
sound track info:

Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'rec_1459.3gpp':

  *Duration: 00:02:33.62*, start: 0.000000, bitrate: 5 kb/s

output ( note the time belo of 1:17 instead of 2:33 that would properly
reflect the input track for audio ):

    Stream #0.0: Video: wmv2, yuv420p, 1200x798 [PAR 96:96 DAR 200:133],
q=2-31, 200 kb/s, 1k tbn, 25 tbc
    Stream #0.1(eng): Audio: wmav2, 8000 Hz, 1 channels, s16, 64 kb/s

     frame= 1926 fps= 48 q=31.0 Lsize=   11714kB*
time=00:01:17.04*bitrate=1245.6kbits/s

Discussion: prior to using 'ffmpeg'  i used the Picasa client tools for
making movies from slides and mp3 files and got the identical result ( 50%
truncation of the audio track ).

What i want :

to get the full 2:33 of the audio included in the output. Using -vframes as
in the pattern at the top does not help in fmt=wmv scenarios. I tried many
iterations using  fmt=mp4 and libx264 for encoding and none of those
attempts produced good output with both good audio and good video.

What i get:  good video audio merge for 1/2 the necessary length. Truncation
occurs at the 50% segment of the audio INPUT file. I dont know how to get
the encoding to proceed thru the end of the input audio.


full stdout below:


$  ./ffmpeg -y -loop_input -f image2  -i Optimized-DSC01459.JPG -i
rec_1459.3gpp -acodec wmav2 -vcodec wmv2
 e:/movies/dev/r2_640x480_vid_only_1459.wmv
ffmpeg version N-30956-g81ef892, Copyright (c) 2000-2011 the FFmpeg
developers
  built on Jun 22 2011 17:37:00 with gcc 4.5.3
  configuration: --enable-gpl --enable-version3 --enable-memalign-hack
--enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r
--enable-libo
pencore-amrnb --enable-libopencore-amrwb --enable-libfreetype
--enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp
--enable-libschroedinger
 --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx
--enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil    51.  9. 1 / 51.  9. 1
  libavcodec   53.  7. 0 / 53.  7. 0
  libavformat  53.  4. 0 / 53.  4. 0
  libavdevice  53.  1. 1 / 53.  1. 1
  libavfilter   2. 23. 0 /  2. 23. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, image2, from 'Optimized-DSC01459.JPG':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mjpeg, yuvj420p, 1200x798 [PAR 96:96 DAR 200:133],
25 fps, 25 tbr, 25 tbn, 25 tbc
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'rec_1459.3gpp':
  Metadata:
    major_brand     : 3gp4
    minor_version   : 0
    compatible_brands: isom3gp4
  Duration: 00:02:33.62, start: 0.000000, bitrate: 5 kb/s
    Stream #1.0(eng): Audio: amrnb, 8000 Hz, 1 channels, flt, 5 kb/s
Incompatible sample format 'flt' for codec 'wmav2', auto-selecting format
's16'
Incompatible pixel format 'yuvj420p' for codec 'wmv2', auto-selecting format
'yuv420p'
[buffer @ 000000000034EAA0] w:1200 h:798 pixfmt:yuvj420p tb:1/1000000
sar:96/96 sws_param:
[buffersink @ 0000000004165F00] auto-inserting filter 'auto-inserted scaler
0' between the filter 'src' and the filter 'out'
[scale @ 00000000041A6EA0] w:1200 h:798 fmt:yuvj420p -> w:1200 h:798
fmt:yuv420p flags:0x4
Output #0, asf, to 'e:/movies/dev/r2_640x480_vid_only_1459.wmv':
  Metadata:
    WM/EncodingSettings: Lavf53.4.0
    Stream #0.0: Video: wmv2, yuv420p, 1200x798 [PAR 96:96 DAR 200:133],
q=2-31, 200 kb/s, 1k tbn, 25 tbc
    Stream #0.1(eng): Audio: wmav2, 8000 Hz, 1 channels, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #1.0 -> #0.1
Press [q] to stop, [?] for help
frame= 1926 fps= 48 q=31.0 Lsize=   11714kB time=00:01:17.04
bitrate=1245.6kbits/s
video:10918kB audio:603kB global headers:0kB muxing overhead 1.675240%

*
*
*
*


More information about the ffmpeg-user mailing list