VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    I thought by now there would be audio support since you can wrap h264 in mp4 and mkv during encoding with x264 but there is no audio.

    What parameter(s) do I need to include for video + audio in x264 ?

    Thanks
    Quote Quote  
  2. You can use ffmpeg libx264 if you want audio support

    There is an x264 audio patch, but it's only compatible with older versions (about 2 years old) . Changes in the x264 API broke compatibility and nobody updated it. taro_06 regularly posted builds with the audio patch in the past, they are still up on his board
    Quote Quote  
  3. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by vhelp View Post
    I thought by now there would be audio support since you can wrap h264 in mp4 and mkv during encoding with x264 but there is no audio.
    The MP4 container supports MP1, MP2, MP3, AAC, DTS, AC3, ALAC, MPEG-4 ALS (besides Vorbis and some obscure low-bandwidth cräp).
    The Matroska container supports many more audio formats.
    Which audio formats should x264 include, then?
    Only one of the above?
    Some of the above?
    All of the above?
    Or none of the above?
    Quote Quote  
  4. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    My source is analog captures from vhs. So, the audio is raw, 48khz. I was not encoding for any specific "codec" format (aac, ac3, etc), maybe that is why. It didn't occur to me to change anything. I was assuming that it would take care of that and encode to minimal format, thus aac or ac3. Anyway. If there is any parameters I need to include in the x264 script, let me know, or else i'll look into the ffmpeg method, thanks.
    Quote Quote  
  5. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    The x264 encoder has a single purpose: Encode H.264 video. The x264 CLI (= command line interface) encoder is just the simplest possible user interface. You are more or less "lucky" that x264 (in contrast to x265, yet...) already comes with a few convenience extras so that you can read more than just a raw video stream from the standard input, and output the result not only raw but also in some basic containers for better compatibility with picky follow-up applications. Just to save you a few more manual steps.

    Instead, ffmpeg is the tool you need when you are looking for a multi-purpose converter. You have a choice of input formats, a choice of output formats (each both content and containers), and on top even several built-in filters (depending on the build details).

    The reason for this separation is "division of labour": Codec developers can concentrate their attention on the development of high quality and high speed codec modules. And ffmpeg developers can concentrate their attention on the cooperation of all modules to one slightly more convenient framework. If codec developers had to make both a great codec and a convenient interface, they would have to re-invent wheels while being engine developers instead.
    Quote Quote  
  6. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    Ok. So after searching and reading and trial/error, i finally have video/audio. May not be the best method or (audio) quality, but at least it works.

    Code:
    ffmpeg  -i movie.avs  -c:v libx264  -x264-params preset=slow:tune=grain  -c:a aac  -strict experimental  -b:a 160k  -y video.test1.mkv
    -x264-params preset=slow:tune=grain --- so that i'm actually using x264's encoding parameters and not ffmpeg's. I just learned about that while searching for the audio support. I was using ffmpeg's preset and params in previous practices



    But the only problem I have is that ffmpeg is using an older version x264 and not the current one.
    Quote Quote  
  7. You can compile ffmpeg with a newer libx264, and libfdk_aac (which is the highest quality AAC encoder ffmpeg has to offer), but it has to be compiled non-free . According to various tests, fdk-aac and quicktime aac are the best overall in terms of quality for AAC encoders

    Or if you want to continue to use x264CLI, just make a batch file for video, audio and muxing . This is what the many of the various GUI's for x264 do (the ones that aren't ffmpeg based)
    Quote Quote  
  8. yes, for avisynth script as input, you need Bepipe, NeroAacEnc (or something else), x264.exe, MP4box, this way you use always version you want, latest etc...
    Code:
    set "fps=23.97"
    BePipe.exe --script "Import(^movie.avs^)" | neroAacEnc.exe -lc -cbr 160000 -if - -of "audio.m4a"
    x264.exe --crf 18 --preset slow --tune grain  --output "video.264"  "movie.avs"
    MP4box.exe -add "video.264":fps=%fps%  -add "audio.m4a"  -new "movie.mp4"
    Quote Quote  
  9. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    To compile ffmpeg with all current sources from this moment, you can use jb-alvarado's media-autobuild_suite (green button to the right: "Clone or download", download master ZIP, unpack in an auxiliary directory; run batch file to configure ffmpeg with "non-free" license, install an MSYS2 environment, download sources, and start the compilation; it will need a few GB free space and some time). Do not redistribute this ffmpeg binary!

    It is also possible to configure VirtualDub 1.10+ (or VirtualDub Filter Mod) to use e.g. x264 + a CLI audio encoder (fdkaac or qaac) + a CLI multiplexer (MP4Box or L-SMASH) as "external encoders" to handle output streams from VirtualDub, instead of saving an AVI. This has been documented before here...
    Quote Quote  



Similar Threads

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