如何用 gstreamer 进行 mp4 视频拼接?

12 天前
 lsk569937453

两个视频信息如下:

Properties:
  Duration: 0:01:12.100000000
  Seekable: yes
  Live: no
  Tags:
      video codec: H.264 / AVC
      container-specific-track-id: 1
      bitrate: 286767
      datetime: 2023-08-27T00:21:51Z
      container format: ISO MP4/M4A
  container #0: video/quicktime, variant=(string)iso
    Tags:
      datetime: 2023-08-27T00:21:51Z
      container format: ISO MP4/M4A

    video #1: video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4.2, profile=(string)constrained-baseline, codec_data=(buffer)0142402affe1001b2742402a95a01a80a1e693011000000300100000030288da1c32a001000428ce3c80, width=(int)1686, height=(int)1274, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)20/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true
      Tags:
        video codec: H.264 / AVC
        container-specific-track-id: 1
        bitrate: 286767

      Codec:
        video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4.2, profile=(string)constrained-baseline, codec_data=(buffer)0142402affe1001b2742402a95a01a80a1e693011000000300100000030288da1c32a001000428ce3c80, width=(int)1686, height=(int)1274, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)20/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true
      Stream ID: 300fa2d73257adb55ba1f7b66d59e5f3a02d95809b27cad83b8aeee34ca206d7/001
      Width: 1686
      Height: 1274
      Depth: 24
      Frame rate: 20/1
      Pixel aspect ratio: 1/1
      Interlaced: false
      Bitrate: 286767
      Max bitrate: 0
Properties:
  Duration: 0:00:08.541000000
  Seekable: yes
  Live: no
  Tags:
      audio codec: MPEG-4 AAC audio
      maximum bitrate: 64000
      bitrate: 64000
      language code: en
      container-specific-track-id: 1
      datetime: 2018-06-14T03:53:44Z
      QT atom: buffer of 33 bytes
      container format: ISO MP4/M4A
      video codec: H.264 / AVC
  container #0: video/quicktime, variant=(string)iso
    Tags:
      datetime: 2018-06-14T03:53:44Z
      QT atom: buffer of 33 bytes
      container format: ISO MP4/M4A

    audio #1: audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)1208, rate=(int)44100, channels=(int)1
      Tags:
        audio codec: MPEG-4 AAC audio
        maximum bitrate: 64000
        bitrate: 64000
        language code: en
        container-specific-track-id: 1

      Codec:
        audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)1208, rate=(int)44100, channels=(int)1
      Stream ID: ce71f7e55d3b89b717642b27ff2725345d4ecdc789036440d8e659aa9c8e39d0/001
      Language: en
      Channels: 1 (unknown layout)
      Sample rate: 44100
      Depth: 32
      Bitrate: 64000
      Max bitrate: 64000
    video #2: video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4, profile=(string)baseline, codec_data=(buffer)01428028ffe1001267428028da01100f1e5e520a0c0c0da1426a01000468ce06e2, width=(int)1080, height=(int)1920, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)0/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true
      Tags:
        video codec: H.264 / AVC
        language code: en
        container-specific-track-id: 2
        bitrate: 13165685

      Codec:
        video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4, profile=(string)baseline, codec_data=(buffer)01428028ffe1001267428028da01100f1e5e520a0c0c0da1426a01000468ce06e2, width=(int)1080, height=(int)1920, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)0/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true
      Stream ID: ce71f7e55d3b89b717642b27ff2725345d4ecdc789036440d8e659aa9c8e39d0/002
      Width: 1080
      Height: 1920
      Depth: 24
      Frame rate: 0/1
      Pixel aspect ratio: 1/1
      Interlaced: false
      Bitrate: 13165685
      Max bitrate: 0

需求如下:

问了 chatgpt 也没问出个所以然来,谷歌也没搜到正确的答案。

498 次点击
所在节点    程序员
2 条回复
frayesshi1
12 天前
为什么不用 ffmpeg 啊,gstreamer 一般用在 Nvidia 小盒子里硬编解码的
MrKrabs
11 天前
为什么不直接用傻瓜软件呢

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1049793

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX