VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Hi guys,

    I want to merge a number of mp3 files with the same image to create corresponding mp4 files (one mp4 file for each mp3 file). I also want the metadata in the audios to follow to the mp4 files. I also want the image to be in as high quality possible but not to the extent where it leads to ridiculously large files and slow processing.


    I have all audio files and the image in the same folder and I'm using the below batch-script but am having some difficulties.

    Code:
    for /R %%g in ("*.mp3") do (
    ffmpeg -r 1.0 -loop 1 -i "Main.jpg" -i "%%g"^
     -map_metadata 1^
     -map_metadata:s:v 1:s:v^
     -map_metadata:s:a 1:s:a^
     -c:a copy -c:v libx264 -preset superfast -tune stillimage^
     -shortest "%%~dpng.mp4"
    )

    I get the following error on some files: "track 1: muxing mp3 at *** is not standard".

    Could someone advise on how to best address this in bulk to achieve my objectives without losing audio quality?

    Should I re-encode or stream copy all audios first? Can I do it in the same instance as I merge the files?

    Any suggestions on scripts?

    Many thanks
    Last edited by DennisO; 26th Nov 2018 at 16:13. Reason: Code tags
    Quote Quote  
  2. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Please wrap your command in code tags to get rid of the smilies.
    Quote Quote  
  3. Originally Posted by JVRaines View Post
    Please wrap your command in code tags to get rid of the smilies.
    Done, thanks
    Quote Quote  
  4. As far as I know, MP4 container normally accepts only one AVC video stream and one AAC audio stream, anything else (including MP3) is non standard.
    I still consider myself a beginner with ffmpeg, and this is something I've never attempted, but perhaps the same command would work with a .mkv output. MKV container can accept almost anything (including MP3). If the MP4 format is a requirement, transcoding the audio would seem mandatory.

    I also want the metadata in the audios to follow to the mp4 files.
    What particular metadata ?

    I also want the image to be in as high quality possible but not to the extent where it leads to ridiculously large files and slow processing.
    That can be affected by the -crf parameter. Apparently (see x264 --fullhelp) the default value is -crf 23, which is medium quality {*}. For a still picture it should be quite good, but it could be slightly better with -crf 18 for instance. The file sizes would be larger but not by an excessive amount, while the processing speed would be similar (I guess). The -preset switch affects the processing speed – from what I understand, a slower processing preset reduces the size of the encoded file at the same quality settings, or improves the quality at the same average bitrate setting. So if you want speed and quality, a combination of -preset superfast and a lower CRF value (lower CRF means higher quality) should do the trick.

    {*} Although this may be different in ffmpeg. Under “libx264 AVoptions” I see :
    “-crf <float> E..V..... Select the quality for constant quality mode (from -1 to FLT_MAX) (default -1)”
    I don't know what “-1” means here.
    (With ffmpeg -h full >"E:\ffmpeg_help_full.txt" you can get the complete integrated help – and I mean complete, that's a 800KB text file, about as big as a phone book...)


    (This thread would be better placed in “Video conversion” or “Audio conversion”.)
    Last edited by abolibibelot; 28th Nov 2018 at 07:21.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!