流0,使用ffmpeg连接视频时未设置时间刻度

时间:2018-02-15 13:51:13

标签: video ffmpeg

我有2个视频,我想将它们一起添加,所以我制作了一个包含文件名

的文本文件
file No-fade_25fps.mp4
file video.mp4

然后我开始使用这个命令

ffmpeg -f concat -i ffmpeg-sound.txt -c copy final_output.mp4

问题是我从ffmpeg

得到了这个
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0561dbc0] stream 0, timescale not set
[mov,mp4,m4a,3gp,3g2,mj2 @ 0561dbc0] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'out.txt':
  Duration: N/A, start: 0.000000, bitrate: 464 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 464 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Metadata:
      creation_time   : 2018-02-09T10:36:18.000000Z
      handler_name    : Core Media Video
    Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 72:72 DAR 16:9], 90k tbr, 90k tbn, 90k tbc
Output #0, mp4, to 'final_output.mp4':
  Metadata:
    encoder         : Lavf58.7.100
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 464 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc
    Metadata:
      creation_time   : 2018-02-09T10:36:18.000000Z
      handler_name    : Core Media Video
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 05c3e940] Auto-inserting h264_mp4toannexb bitstream filter
frame= 8194 fps=0.0 q=-1.0 Lsize=    2254kB time=46:35:51.68 bitrate=   0.1kbits/s speed=1.19e+006x
video:2157kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.486598%

结果给了我一个视频mp4文件,持续时间很长,如46:33:20而且不起作用,我确信这两个视频都有相同的重新设置。
我尝试的是使用此命令转换视频

ffmpeg -y -i No-fade_25fps.mp4 -r 25 -s 1280x720 -c:v libx264 -b:v 3M -strict -2 -movflags faststart destination.mp4

当我再次连接它时,它工作并给我结果mp4文件,它具有正确的持续时间并且工作正常但没有声音,因为我使用的第一个视频文件静音没有声音,第二个包含声音。
我的问题是如何在没有这个问题的情况下将这些视频连接起来也是什么使得视频有这么长时间的问题以及当我使用它运行的命令行转换它们时?
第一个视频信息是No-fade_25fps.mp4

    [mov,mp4,m4a,3gp,3g2,mj2 @ 03e05000] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'No-fade_25fps.mp4':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: M4V M4A mp42isom
    creation_time   : 2018-02-09T10:36:18.000000Z
    keywords        : tunepro,orange
    album_artist    : Kiran Khan
    description     : This video is about new tunepro
    artist          : Kiran Khan
    title           : new tunepro
  Duration: 00:00:06.48, start: 0.000000, bitrate: 497 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 464 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2018-02-09T10:36:18.000000Z
      handler_name    : Core Media Video
    Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 72:72 DAR 16:9], 90k tbr, 90k tbn, 90k tbc
At least one output file must be specified

第二视频video.mp4

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.7.100
  Duration: 00:05:21.28, start: 0.000000, bitrate: 181 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 1280x720 [SAR 1:1 DAR 16:9], 45 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, s16p, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

我想要的是添加任意数量的视频togthers没有这样的问题他们都有相同的reslution和每秒帧数是否有其他需要检查才能开始合并视频?
更新
这是我使用没有复制编解码器的命令时得到的

[mov,mp4,m4a,3gp,3g2,mj2 @ 058ddb80] stream 0, timescale not set
[mov,mp4,m4a,3gp,3g2,mj2 @ 058ddb80] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'out.txt':
  Duration: N/A, start: 0.000000, bitrate: 464 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 464 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Metadata:
      creation_time   : 2018-02-09T10:36:18.000000Z
      handler_name    : Core Media Video
    Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 72:72 DAR 16:9], 90k tbr, 90k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 05937d00] using SAR=1/1
[libx264 @ 05937d00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 05937d00] profile High, level 3.1
[libx264 @ 05937d00] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'final_output.mp4':
  Metadata:
    encoder         : Lavf58.7.100
    Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      creation_time   : 2018-02-09T10:36:18.000000Z
      handler_name    : Core Media Video
      encoder         : Lavc58.9.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
[mov,mp4,m4a,3gp,3g2,mj2 @ 058ddb80] Auto-inserting h264_mp4toannexb bitstream filtered=3.41x
More than 1000 frames duplicated

它就像在无限循环中一样停止

0 个答案:

没有答案