1

I have multiple media file to concatenate into a single video file. Composed of different media types including video, audio and image. I use FFMPEG to convert audio and images to a video then finally, will use Elastic Transcoder to stitch/concatenate the video files in a single one. On creating transcoder job, whenever I placed the input video which is originally an image, converted by FFMPEG, to be the last input in order, it shrinks the duration of its exposure in the final output by 5 seconds whenever its original duration is > 5. This happens only with that condition.

Example: (1) video1 - 10s (2) image1 - 10s (3) video2 - 15s (4) image2 - 20s output: video - 40s (image2's duration or exposure in the output shrinks to approx. 5s)

Clearly, the sum of Input duration and the Output duration does not match. It is even explicitly stated on the Job result of elastic transcoder.


Thought I had a wrong conversion settings in FFMPEG so I changed some options. After some changes and comparing the image converted to video (V1) with an authentic video to stitch with (V2), their settings are almost the same. In this I use ffmpeg -i myVideo.mp4 to check its details. They differ only on SAR, DAR, tbr and tbn and I dont really know what are their use.

Already checked the duration of the converted images after ffmpeg conversion and it is accurate, it only messed up after feeding it to the elastic transcoder and placed as the last input.

Here is my conversion command with FFMPEG(image to video): ffmpeg -r 29.97 -i [input.jpg] -f lavfi -i anullsrc=r=48000:cl:stereo -t [duration] -acodec aac -vcodec libx264 -profile:v baseline -pix_fmt yuv420p -t [duration] -vf scale=854:480 -strict -2 [output.mp4]

The expected result should be that the output file is consistent with the actual duration it has.

[EDIT]

Here's real videos I feed on Elastic Transcoder using ffprobe filename:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'clip2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.71.100
  Duration: 00:00:10.05, start: 0.042667, bitrate: 476 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:1(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 2136:2135 DAR 89:50], 341 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'image2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.12.100
  Duration: 00:02:10.03, start: 0.033333, bitrate: 130 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1943:1004 DAR 829661:240960], 2636 kb/s, SAR 283440:146461 DAR 1181:343, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
auricless
  • 11
  • 2

0 Answers0