Skip to content

Help with concat diffrent media types together #551

@Nosh-Ware

Description

@Nosh-Ware
import ffmpeg


input_still = ffmpeg.input("C:/Users/Nosh/Desktop/sample/1.mp3")
input_audio = ffmpeg.input("C:/Users/Nosh/Desktop/sample/1.jpg")

(
    ffmpeg
    .concat(input_still, input_audio, v=1, a=1)
    .output("output.mp4")
    .run(overwrite_output=True)
)

I am trying to concat an audio (sans video stream) and an image (sans audio stream) together. It seems to not like this, which after research seems to be because the image file has no audio stream and vice versa.
How do I make this work? How do I make it show the image for the entire duration of the audio clip? Here is the longer output for more context:

[mjpeg @ 00000296a2930140] Found EOI before any SOF, ignoring
[mjpeg @ 00000296a2930140] No JPEG data found in image
Input #0, mp3, from 'C:/Users/Nosh/Desktop/sample/1.mp3':
Duration: 00:01:57.91, start: 0.046042, bitrate: 191 kb/s
 Stream #0:0: Audio: mp3, 24000 Hz, stereo, fltp, 160 kb/s
   Metadata:
     encoder         : LAME3.99r
 Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1500x1338 [SAR 1:1 DAR 250:223], 90k tbr, 90k tbn (attached pic)
   Metadata:
     comment         : Cover (front)
[mjpeg @ 00000296a2935f00] Found EOI before any SOF, ignoring
[mjpeg @ 00000296a2935f00] No JPEG data found in image
Input #1, image2, from 'C:/Users/Nosh/Desktop/sample/1.jpg':
 Duration: 00:00:00.04, start: 0.000000, bitrate: 55920 kb/s
 Stream #1:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1600x1598 [SAR 72:72 DAR 800:799], 25 fps, 25 tbr, 25 tbn
Stream specifier '' in filtergraph description [0][1]concat=a=1:n=1:v=1[s0] matches no streams.
Traceback (most recent call last):
 File "C:\Users\Nosh\Desktop\TempEmailMaker.py", line 8, in <module>
   ffmpeg
 File "C:\Users\Nosh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\ffmpeg\_run.py", line 325, in run
   raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions