Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: Making a YT compatible audio file with image ffmpeg

  1. #21
    Join Date
    Sep 2006
    Beans
    3,713

    Re: Making a YT compatible audio file with image ffmpeg

    Quote Originally Posted by shantiq View Post
    this my command
    Code:
    time ffmpeg -y -loop 1 -i amarilla.png -i bulgaria.mp3 -c:a copy -c:v libx264 -crf 0 -s hd720 -preset veryslow -shortest output2.mkv
    Try using "-r 2" as an input option and change veryslow to veryfast if the potential difference in file size (shouldn't be much for static image I believe) is less important than encoding speed:
    Code:
    ffmpeg -y -loop 1 -r 2 -i amarilla.png -i bulgaria.mp3 -c:a copy -c:v libx264 -crf 0 -s hd720 -preset veryfast -shortest output2.mkv
    Fastest would be to stream copy everything:
    Code:
    ffmpeg -y -loop 1 -i amarilla.png -i bulgaria.mp3 -c copy -shortest output2.mkv
    Output file size may be large, but it's a tradeoff between encoding speed and file size (we try to keep quality as high as practically possible since YT will re-encode anyway). For static image, depending on the image, -crf 0 (lossless) and -crf 18 (roughly visually lossless) may not vary too significantly in file size or encoding time, so you can compare those too.

    ffmpeg console outputs are usually more informative and accurate than mediainfo outputs.
    Last edited by FakeOutdoorsman; August 30th, 2013 at 09:33 PM.

  2. #22
    Join Date
    Jun 2007
    Beans
    12,764

    Re: Making a YT compatible audio file with image ffmpeg

    shantiq, what CPU do you have?
    Code:
    cat /proc/cpuinfo
    I wonder if using ffmpeg's -threads option will help you. I couldn't get it to show any difference: http://ubuntuforums.org/showthread.php?t=2168503

  3. #23
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan
    Beans
    2,103
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Making a YT compatible audio file with image ffmpeg

    Yes T. maybe my machine is not very powerful; i have had it 6 or 7 years now


    cat /proc/cpuinfoprocessor : 0
    vendor_id : AuthenticAMD
    cpu family : 15
    model : 47
    model name : AMD Athlon(tm) 64 Processor 3400+
    stepping : 2
    cpu MHz : 2200.000
    cache size : 512 KB
    fpu : yes
    fpu_exception : yes
    cpuid level : 1
    wp : yes
    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow rep_good nopl extd_apicid pni lahf_lm
    bogomips : 4377.29
    TLB size : 1024 4K pages
    clflush size : 64
    cache_alignment : 64
    address sizes : 40 bits physical, 48 bits virtual
    power management: ts fid vid ttp tm stc

    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community
    Playing with Slackware too now ...
    ShanArt

  4. #24
    Join Date
    Jun 2007
    Beans
    12,764

    Re: Making a YT compatible audio file with image ffmpeg

    Well, it's a single-core chip, so multithreading probably won't help. I wonder if '-g 0' would help?

  5. #25
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan
    Beans
    2,103
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Making a YT compatible audio file with image ffmpeg

    well Temüjin absolutely fantastic RESULT! CHECK that time
    funnily enough it did not work with -s hd720 as it warped the image but it worked with Fake's suggestion of -vf scale=-1:720



    PS i cannot see that -g switch in ffmpeg -h full where is it? what does it do?

    ha ok found it

    -g <int> E..V.. set the group of picture (GOP) size (from INT_MIN to INT_MAX) (default 12)
    but it might as well be in sanskrit. What does it mean?


    so that is really SOLVED here i think, 6 minutes and a perfect copy [if only a bit fat at 450MB for a 5 minute video]

    AND it does not make my computer sound like a revved-up jet engine; mostly quiet throughout


    Thank you very much to both





    time ffmpeg -y -loop 1 -r 2 -i amarilla.png -i bulgaria.mp3 -c:a copy -c:v libx264 -g 0 -crf 0 -vf scale=-1:720 -preset veryfast -shortest output2.mkv


    ffmpeg version git-2013-08-27-16c3ed5 Copyright (c) 2000-2013 the FFmpeg developers
    built on Aug 27 2013 18:43:59 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
    configuration: --prefix=/home/shan/ffmpeg_build --extra-cflags=-I/home/shan/ffmpeg_build/include --extra-ldflags=-L/home/shan/ffmpeg_build/lib --bindir=/home/shan/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
    libavutil 52. 42.100 / 52. 42.100
    libavcodec 55. 29.100 / 55. 29.100
    libavformat 55. 14.102 / 55. 14.102
    libavdevice 55. 3.100 / 55. 3.100
    libavfilter 3. 82.102 / 3. 82.102
    libswscale 2. 5.100 / 2. 5.100
    libswresample 0. 17.103 / 0. 17.103
    libpostproc 52. 3.100 / 52. 3.100
    [image2 @ 0x1c29700] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, image2, from 'amarilla.png':
    Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: png, rgb24, 2816x2244 [SAR 18898:18898 DAR 64:51], 25 tbr, 25 tbn, 25 tbc
    [mp3 @ 0x1c2b200] Estimating duration from bitrate, this may be inaccurate
    Input #1, mp3, from 'bulgaria.mp3':
    Metadata:
    encoder : LAME 64bits version 3.99.5 (http://lame.sf.net)
    TLEN : 288810
    Duration: 00:04:48.87, start: 0.000000, bitrate: 320 kb/s
    Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
    No pixel format specified, yuv444p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x1c2dfe0] using SAR=1920/1921
    [libx264 @ 0x1c2dfe0] using cpu capabilities: MMX2 SSE2Slow SlowCTZ
    [libx264 @ 0x1c2dfe0] profile High 4:4:4 Intra, level 3.1, 4:4:4 8-bit
    [libx264 @ 0x1c2dfe0] 264 - core 138 r2 9e941d1 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=1 keyint_min=1 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
    Output #0, matroska, to 'output2.mkv':
    Metadata:
    encoder : Lavf55.14.102
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv444p, 904x720 [SAR 1920:1921 DAR 64:51], q=-1--1, 1k tbn, 2 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, 320 kb/s
    Stream mapping:
    Stream #0:0 -> #0:0 (png -> libx264)
    Stream #1:0 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame= 580 fps=1.6 q=0.0 Lsize= 440008kB time=00:04:50.00 bitrate=12429.5kbits/s
    video:428622kB audio:11284kB subtitle:0 global headers:0kB muxing overhead 0.023305%
    [libx264 @ 0x1c2dfe0] frame I:580 Avg QP: 0.00 size:756739
    [libx264 @ 0x1c2dfe0] mb I I16..4: 10.3% 31.0% 58.6%
    [libx264 @ 0x1c2dfe0] 8x8 transform intra:31.0%
    [libx264 @ 0x1c2dfe0] coded y,u,v intra: 99.1% 98.9% 99.1%
    [libx264 @ 0x1c2dfe0] i16 v,h,dc,p: 33% 26% 31% 10%
    [libx264 @ 0x1c2dfe0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 22% 28% 4% 5% 7% 5% 7% 6%
    [libx264 @ 0x1c2dfe0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 15% 17% 7% 8% 10% 7% 8% 7%
    [libx264 @ 0x1c2dfe0] kb/s:12107.82


    real 6m10.671s !!!
    user 4m41.860s
    sys 0m22.140s




    ok playing further to reduce the obscene size of 450MB


    tried -g 4 -g 8 and finally -g 7 also moved from 320k mp3 to 192k aac which i understand is the highest YT ever goes for [might shorten conversion time on YT?]


    time is slightly shorter and size down to 92MB video drops from 4000k to 2000k thereabouts perfectly adequate


    time ffmpeg -y -loop 1 -r 2 -i amarilla.png -i bulgaria.mp3 -c:a libfdk_aac -b:a 192k -c:v libx264 -g 7 -crf 0 -s hd720 -preset veryfast -shortest output24.mkv


    ffmpeg version git-2013-08-27-16c3ed5 Copyright (c) 2000-2013 the FFmpeg developers
    built on Aug 27 2013 18:43:59 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
    configuration: --prefix=/home/shan/ffmpeg_build --extra-cflags=-I/home/shan/ffmpeg_build/include --extra-ldflags=-L/home/shan/ffmpeg_build/lib --bindir=/home/shan/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
    libavutil 52. 42.100 / 52. 42.100
    libavcodec 55. 29.100 / 55. 29.100
    libavformat 55. 14.102 / 55. 14.102
    libavdevice 55. 3.100 / 55. 3.100
    libavfilter 3. 82.102 / 3. 82.102
    libswscale 2. 5.100 / 2. 5.100
    libswresample 0. 17.103 / 0. 17.103
    libpostproc 52. 3.100 / 52. 3.100
    [image2 @ 0x1e3d780] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, image2, from 'amarilla.png':
    Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: png, rgb24, 2816x2244 [SAR 18898:18898 DAR 64:51], 25 tbr, 25 tbn, 25 tbc
    [mp3 @ 0x1e3f1e0] Estimating duration from bitrate, this may be inaccurate
    Input #1, mp3, from 'bulgaria.mp3':
    Metadata:
    encoder : LAME 64bits version 3.99.5 (http://lame.sf.net)
    TLEN : 288810
    Duration: 00:04:48.87, start: 0.000000, bitrate: 320 kb/s
    Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
    No pixel format specified, yuv444p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x1e41ac0] using SAR=12/17
    [libx264 @ 0x1e41ac0] using cpu capabilities: MMX2 SSE2Slow SlowCTZ
    [libx264 @ 0x1e41ac0] profile High 4:4:4 Predictive, level 3.1, 4:4:4 8-bit
    [libx264 @ 0x1e41ac0] 264 - core 138 r2 9e941d1 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1 keyint=7 keyint_min=1 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
    Output #0, matroska, to 'output24.mkv':
    Metadata:
    encoder : Lavf55.14.102
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv444p, 1280x720 [SAR 12:17 DAR 64:51], q=-1--1, 1k tbn, 2 tbc
    Stream #0:1: Audio: aac (libfdk_aac) ([255][0][0][0] / 0x00FF), 44100 Hz, stereo, s16, 192 kb/s
    Stream mapping:
    Stream #0:0 -> #0:0 (png -> libx264)
    Stream #1:0 -> #0:1 (mp3 -> libfdk_aac)
    Press [q] to stop, [?] for help

    .....................

    real 5m32.539s
    user 4m24.580s
    sys 0m12.064s



    SO FINAL OFFER!



    time ffmpeg -y -loop 1 -r 2 -i IMAGE.png -i SOUNDFILE.mp3 -c:a libfdk_aac -b:a 192k -c:v libx264 -g 7 -crf 0 -vf scale=-1:720 -preset veryfast -shortest VIDEO.mkv
    Last edited by shantiq; September 1st, 2013 at 12:40 PM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community
    Playing with Slackware too now ...
    ShanArt

  6. #26
    Join Date
    Jun 2007
    Beans
    12,764

    Re: Making a YT compatible audio file with image ffmpeg

    '-g 0' turns off motion estimation (from ffmpeg manpage):
    Code:
    If your computer is not fast enough, you can speed up the compression at the expense of the compression ratio.
               You can use '-me zero' to speed up motion estimation, and '-g 0' to disable motion estimation completely (you
               have only I-frames, which means it is about as good as JPEG compression).

Page 3 of 3 FirstFirst 123

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •