Posted: . At: 4:27 PM. This was 7 years ago. Post ID: 10858
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Create a video from one image and a wav file easily.


To create a video file from a wav, just use ffmpeg. This is how I created a 4k resolution video using just ffmpeg and an image file and audio wav I got off the Internet.

Put both files into the same folder and then run this command. This will add two frames to the video, this will allow the video to process properly on Youtube.

jason@darkstar:~/Downloads$ ffmpeg -r 1 -loop 1 -i pellets_plant_in_zapolyarny.jpg -i "Ambient Dark Skies.wav" -acodec copy -r 1 -shortest -vcodec libx264 industry.flv

Playing an earlier attempt I made with a different image.

Playing the created video file.
Playing the created video file.

And this is the finished video file in 4k on Youtube: https://www.youtube.com/watch?v=S5gQbAdFnQk&feature=youtu.be.

This way, a simple video may be created to show off music, without a video editing application. I uploaded a video that is in 5k and it worked fine, I might try a 16K video, but I think it will not work. But it does not hurt to try.

This is the command that I used to encode a 5k video. The size of the input image determines the video resolution, so make it as high as possible.

ffmpeg -r 1 -loop 1 -i 20180522_113625_Richtone\(HDR\).jpg -i "song.wav" -acodec aac -profile:a aac_low -r 1 -shortest -vcodec libx264 satan.flv

This is how to encode as an MKV file.

jason@jason-desktop:~/Videos$ ffmpeg -r 1 -loop 1 -i 20170701_154012-e1499940409898.jpg -i websdr_recording_start_2020-08-12T22\ 33\ 03Z_4625.0kHz.wav -acodec copy -r 1 -shortest -vcodec libx264 buzzer.mkv
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, image2, from '20170701_154012-e1499940409898.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 274816 kb/s
    Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 4128x3096 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 25 tbn, 25 tbc
Guessed Channel Layout for Input Stream #1.0 : mono
Input #1, wav, from 'websdr_recording_start_2020-08-12T22 33 03Z_4625.0kHz.wav':
  Duration: 00:06:00.21, bitrate: 113 kb/s
    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 7119 Hz, mono, s16, 113 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[libx264 @ 0x55801704d5c0] using SAR=1/1
[libx264 @ 0x55801704d5c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x55801704d5c0] profile High, level 6.0
[libx264 @ 0x55801704d5c0] 264 - core 155 r2917 0a84d98 - 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=6 lookahead_threads=1 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=1 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, matroska, to 'buzzer.mkv':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuvj420p(pc), 4128x3096 [SAR 1:1 DAR 4:3], q=-1--1, 1 fps, 1k tbn, 1 tbc
    Metadata:
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 7119 Hz, mono, s16, 113 kb/s
frame=  414 fps= 11 q=17.0 Lsize=   12785kB time=00:06:01.00 bitrate= 290.1kbits/s speed=9.86x    
video:7763kB audio:5008kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.106170%
[libx264 @ 0x55801704d5c0] frame I:2     Avg QP: 3.27  size:3491152
[libx264 @ 0x55801704d5c0] frame P:104   Avg QP: 4.73  size:  8035
[libx264 @ 0x55801704d5c0] frame B:308   Avg QP:22.30  size:   499
[libx264 @ 0x55801704d5c0] consecutive B-frames:  0.7%  0.0%  0.7% 98.6%
[libx264 @ 0x55801704d5c0] mb I  I16..4:  9.2% 79.8% 11.0%
[libx264 @ 0x55801704d5c0] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  6.3%  0.0%  0.0%  0.0%  0.0%    skip:93.7%
[libx264 @ 0x55801704d5c0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.6%  0.0%  0.0%  direct: 0.0%  skip:99.4%  L0:17.0% L1:83.0% BI: 0.0%
[libx264 @ 0x55801704d5c0] 8x8 transform intra:79.8% inter:94.2%
[libx264 @ 0x55801704d5c0] coded y,uvDC,uvAC intra: 99.6% 44.6% 28.5% inter: 0.6% 0.0% 0.0%
[libx264 @ 0x55801704d5c0] i16 v,h,dc,p:  3% 10% 76% 12%
[libx264 @ 0x55801704d5c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 26% 42%  2%  3%  3%  5%  3%  5%
[libx264 @ 0x55801704d5c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 20% 16%  7%  9%  7% 10%  6%  9%
[libx264 @ 0x55801704d5c0] i8c dc,h,v,p: 50% 28% 19%  3%
[libx264 @ 0x55801704d5c0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x55801704d5c0] ref P L0: 99.8%  0.0%  0.1%  0.1%
[libx264 @ 0x55801704d5c0] ref B L0: 99.3%  0.6%  0.1%
[libx264 @ 0x55801704d5c0] ref B L1: 67.3% 32.7%
[libx264 @ 0x55801704d5c0] kb/s:154.04

This file format seems to work better than the mp4 or flv options.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.