how do i efficiently attach audio to an image

hi all, ive tried using shotcut and kdenlive but the outputted file ends up being huge. i have a single image and want to put audio on top (releasing a song) but these programs end up making video files where they render the same image on each frame and the files end up being huge. what is the best way to achieve my use case of making a single photo music ‘video’ that doesnt degrade the quality of the image and can be posted to youtube?

tl;dr: need a still image video (image is lossless) where rhe imsge isnt reduplicared and has audio

haroldstork,

This might depend on where you’re uploading/how you’re playing this file, but you could add a thumbnail to the audio file? I know that vlc and mpv will play your audio file and show the thumbnail, but I’m not sure if YouTube would take that. Not sure if this is exactly what you’re looking for but it is pretty efficient.

hinterlufer,

In kdenlive, the following settings work well for me (you can transfer the options to ffmpeg cli as well if you prefer that):

f=matroska movflags=+faststart vcodec=libx264 tune=stillimage progressive=1 g=1000 bf=2 crf=%quality acodec=flac ar=48000

For reference, I get a 3.7 GB video with a duration of over 5 h @4k resolution. The audio itself is already 3.7 GB and it’s just a still image. For CRF, set something around 23, that should do.

bbbhltz,
@bbbhltz@beehaw.org avatar

Recommended YT settings might be helpful here.

What command have you been using?

andrew_bidlaw, (edited )
@andrew_bidlaw@sh.itjust.works avatar

Can you intentionally set various bitrate (VBR) with a big difference, like from 16mbps max to 1mbps min? Constant bitrate can be your problem. Premiere had this on media export menu, I can’t remember where others have this. And, if you want to upload it to youtube, see what size it has on a private upload by downloading it - they reencode every video themselves to their uniform standard, so maybe you don’t even need to bother with that.

turkalino,
@turkalino@lemmy.yachts avatar

Are you sure your rendering settings are correct? It sounds like the video isn’t being encoded at all. Video encoding works by storing a frame in full quality every couple seconds or so. For the rest of the frames, only their differences from the previous full-quality frame are stored. But from what you describe, it sounds like the latter sentence isn’t happening

jackpot,
@jackpot@lemmy.ml avatar

oh i didnt think this is how it worked, i ended up using ffmpeg to make a one frame a second video but it still looks blurry??

nekusoul, (edited )
@nekusoul@lemmy.nekusoul.de avatar

Since the end goal is to post a video to YouTube, you will have to create a video file. Personally I would probably just be lazy and upload the large file, since YouTube is going to reconvert the video anyway.

That said, to optimize the file you need to know how videos work, specifically key frames. Speaking generally, when a video gets encoded, it doesn’t add the whole image for each frame. Instead, it only does that when the current frame is a key frame, and then only stores the difference to the previous frame for every regular frame. There’s a lot of different strategies when placing keyframes, like every X seconds, when the scene changes, or both. This is usually you can change somewhere in the encoding settings of the application you’re using. You will need to use a codec/format that supports interframe compression though, so avoid AVI and MJPEG.

So the TL;DR is: Try to decrease the amount of key frames as much as possible, maybe even down to only one if possible.

gray,
@gray@pawb.social avatar
luthis,

The answer is always ffmpeg

jackpot,
@jackpot@lemmy.ml avatar

im confused sorry, i tried the libx265 codec but the image still has blurry edges??

jws_shadotak,

Are you able to add it through the file properties menu?

jackpot, (edited )
@jackpot@lemmy.ml avatar

probably? would that be able to be sent to people / uploaded? how do i do this? linux mint btw

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • localhost
  • All magazines
  • 200 Redirect @ entry_single
    HTTP status 200 OK
    Route name entry_single
    Has session yes
    Stateless Check no
    302 Redirect from entry_comment_create (0f3ab7)
    Time 593 ms
    Total time 593 ms
    Initialization time 55 ms
    Memory 16.0 MiB
    Peak memory usage 16.0 MiB
    PHP memory limit 128 MiB
    Cache 1
    Number of forms 1
    Number of errors 0
    Logger 86
    Errors 0
    Warnings 0
    Deprecations 86
    Cache 76 in 274.14 ms
    Cache Calls 76
    Total time 274.14 ms
    Cache hits 70 / 83 (84.34%)
    Cache writes 10
    641
    Default locale en
    Missing messages 641
    Fallback messages 0
    Defined messages 150
    Security n/a
    Authenticated No
    Firewall name main
    Twig 414 ms
    Render Time 414 ms
    Template Calls 157
    Block Calls 82
    Macro Calls 6
    118 in 360 ms
    user_avatar 20
    settings_row_switch 15
    date 11
    user_inline 10
    date_edited 9
    vote 9
    boost 9
    entry_comment 8
    entry_comments_nested 8
    user_settings_row_switch 4
    settings_row_enum 2
    entry 1
    entries_cross 1
    editor_toolbar 1
    user_actions 1
    magazine_box 1
    magazine_sub 1
    related_magazines 1
    active_users 1
    related_categories 1
    related_posts 1
    related_entries 1
    support_us_block 1
    featured_magazines 1
    20 in 259.11 ms
    Database Queries 20
    Different statements 13
    Query time 259.11 ms
    Invalid entities 0
    Cache hits 41
    Cache misses 0
    Cache puts 0
    6.4.0
    Profiler token 4a223e
    Environment dev
    Debug enabled
    PHP version 8.2.26   View phpinfo()
    PHP Extensions Xdebug ✗ APCu ✓ OPcache ✓
    PHP SAPI apache2handler