1

I am trying to transcode a single video file with 1 video stream and several audio streams to the file having same video stream in different bitrates/sizes with correct padding at the same time.

the command I use is:

    ffmpeg -y -ss 600 -t 600 -i "INPUT.mkv" -map_chapters -1 -map 0:0 -c:v libx264 -keyint_min 48 -g 96 -bufsize 350k -b:v 350k -minrate 300k -maxrate 400k -profile:v baseline -level 3.0 -preset slow -vf "scale=iw*min(480/iw\,272/ih):ih*min(480/iw\,272/ih),pad=480:272:(480-iw)/2:(272-ih)/2" -map 0:0 -c:v libx264 -keyint_min 48 -g 96 -bufsize 650k -b:v 650k -minrate 500k -maxrate 800k -profile:v baseline -level 3.1 -preset slow -vf "scale=iw*min(640/iw\,360/ih):ih*min(640/iw\,360/ih),pad=640:360:(640-iw)/2:(360-ih)/2" -map 0:1 -c:a libfaac -b:a 32k -ar 44100 -f mpegts OUTPUT.m2ts

ffmpeg creates two video streams, however the bitrate and resolution for all of them are taken from the last video arguments - i.e. both streams are 640x360:

    Output #0, mpegts, to 'OUTPUT.m2ts':
    Stream #0:0(eng): Video: h264, yuv420p, 640x360 [SAR 559:560 DAR 559:315], q=-1--1, 650 kb/s,     Stream #0:1(eng): Video: h264, yuv420p, 640x360 [SAR 559:560 DAR 559:315], q=-1--1, 650 kb/s, 90k tbn, 23.98 tbc (default)
    Stream #0:2(rus): Audio: aac, 44100 Hz, 5.1, s16, 32 kb/s (default)
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 -> libx264)
    Stream #0:0 -> #0:1 (h264 -> libx264)
    Stream #0:1 -> #0:2 (aac -> libfaac)
    Press [q] to stop, [?] for help

Is it practically possible to make transcoding to several bitrates to the same file?

4

2 回答 2

2

您正在映射您的输入,但不是您的输出。尝试像这样指定您的输出比特率:-b:v:0 350k-b:v:1 650k. 其他流和变量(如编解码器)也可以通过这种方式定义。有关更多信息和示例,请参阅FFmpeg 地图 wiki

于 2013-03-13T13:54:31.287 回答
0

试试这个命令:

ffmpeg -y -ss 600 -t 600 -i "INPUT.mkv" -map_chapters -1 -map 0:0 -map 0:0  -map 0:1 -c:v:0 libx264 -keyint_min 48 -g 96 -bufsize 350k -b:v0 350k -minrate 300k -maxrate 400k -profile:v:0 baseline -level 3.0 -preset slow -vf "scale=iw*min(480/iw\,272/ih):ih*min(480/iw\,272/ih),pad=480:272:(480-iw)/2:(272-ih)/2" -c:v:1 libx264 -keyint_min 48 -g 96 -bufsize 650k -b:v1 650k -minrate 500k -maxrate 800k -profile:v:1 baseline -level 3.1 -preset slow -vf "scale=iw*min(640/iw\,360/ih):ih*min(640/iw\,360/ih),pad=640:360:(640-iw)/2:(360-ih)/2" -c:a libfaac -b:a 32k -ar 44100 -f mpegts OUTPUT.m2ts
于 2020-01-28T15:50:35.370 回答