VideoHelp Forum




+ Reply to Thread
Results 1 to 23 of 23
  1. I want to Transcode my videos to x265 format. Also x264 format.

    I dont want to use any GUI [MeGUI, HandBrake, StaxRip ... or whatever]. I dont even want to use HandBrake CLI [It doesnt support NeroAAC, which people say is the best implementation of aac.]

    As x265 only accepts yuv or y4m, im using ffmpeg to get the raw video.

    Is this ok ? i mean, is this the 'best practice' ? to get raw video ?

    And i use fmpeg to extract the audio in wav .
    This is input to NeroAacEnc
    Again, is this the best practice or are there any better ways to do this ?


    Here's what im doing :

    ffmpeg -i Wildlife.wmv -f yuv4mpegpipe - | x265 --y4m --preset "ultrafast" - -o Wildlife_ultrafast.265
    ffmpeg -i Wildlife.wmv -f wav - | neroaacenc -ignorelength -q 0.3 -if - -of Wildlife.aac
    mkvmerge -o Wildlife_ultrafast.mkv Wildlife_ultrafast.265 Wildlife.aac

    Am i doing something wrong ?
    Can this be done in any better way ?

    Like, i have this feeling in my head that ffmpeg is not normally used to extract the raw video n raw audio.
    I wanna know the best practices.

    And, i dont want to use any GUIs or even HandBrake CLI [Trying to be a purist here].

    People replying below, You have completely forgot this part :


    And one more thing, can you please specify how I resize my videos [Ex : 720p to 480p]

    Thanks guys .
    Last edited by NonyMony; 4th Oct 2014 at 21:59.
    Quote Quote  
  2. Member hech54's Avatar
    Join Date
    Jul 2001
    Location
    Yank in Europe
    Search PM
    Originally Posted by NonyMony View Post
    And, i dont want to use any GUIs or even HandBrake CLI [Trying to be a purist here].
    Oh my.
    Quote Quote  
  3. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    If you insist in doing so (maybe for portability across operating systems and scripting the conversion of a number of source files), then it is already a valid approach; but when you have an ffmpeg build with included libx265, then you can avoid piping at least for the video if you discover how to submit x265 specific options.

    Unfortunately, there is no known free AAC encoder as good as Nero, FHG or QuickTime available inside ffmpeg yet, as far as I remember.

    Being a purist, I would recommend you to multiplex HEVC and AAC to MP4, though, using current versions of MP4Box or L-SMASH.
    Quote Quote  
  4. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    NeroAAC or QAAC for AAC.

    I use command line transcoding only, but I process them with AVISynth before re-encoding. In fact no matter what I'm doing I always feed the video into the encoder using AVISynth. But the files I re-encode are almost exclusively MKVs so I can extract the elemental streams with MKVExtract (except VC1 ) .

    http://forum.doom9.org/showthread.php?t=169607

    Generally I do the majority of processing using AviSynth and VirtualDub (VirtualDub can be used as a CLI tool, it still opens a window but can be set to automatically minimise and exit when it's done and the 'status' window occasionally comes in handy when I want to keep track of how long the filtering is going to take) and from there I save the video as a UT Video Codec AVI intermediate. When I'm done filtering I just pipe the UT Video Codec AVI to the encoder using one of the piping programs (avs4x265/avs2pipemod). I've been using Nero for audio, but I recently discovered QAAC can tap into the AAC encoder written into apple products, including iTunes, so I'm thinking next time I make an mp4 I'll use that instead (I think there was a problem with apple encoders and audio with more than 2 channels at some point but maybe they figured out a way around that - I think it was just a meta problem anyway).
    Quote Quote  
  5. Originally Posted by LigH.de View Post
    If you insist in doing so (maybe for portability across operating systems and scripting the conversion of a number of source files), then it is already a valid approach; but when you have an ffmpeg build with included libx265, then you can avoid piping at least for the video if you discover how to submit x265 specific options.

    Unfortunately, there is no known free AAC encoder as good as Nero, FHG or QuickTime available inside ffmpeg yet, as far as I remember.

    Being a purist, I would recommend you to multiplex HEVC and AAC to MP4, though, using current versions of MP4Box or L-SMASH.
    Why MP4 and not MKV ?

    And thanks for mentioning that FFMpeg can itself encode h.265 using libx265 .

    Originally Posted by ndjamena View Post
    NeroAAC or QAAC for AAC.

    I use command line transcoding only, but I process them with AVISynth before re-encoding. In fact no matter what I'm doing I always feed the video into the encoder using AVISynth. But the files I re-encode are almost exclusively MKVs so I can extract the elemental streams with MKVExtract (except VC1 ) .

    http://forum.doom9.org/showthread.php?t=169607

    Generally I do the majority of processing using AviSynth and VirtualDub (VirtualDub can be used as a CLI tool, it still opens a window but can be set to automatically minimise and exit when it's done and the 'status' window occasionally comes in handy when I want to keep track of how long the filtering is going to take) and from there I save the video as a UT Video Codec AVI intermediate. When I'm done filtering I just pipe the UT Video Codec AVI to the encoder using one of the piping programs (avs4x265/avs2pipemod). I've been using Nero for audio, but I recently discovered QAAC can tap into the AAC encoder written into apple products, including iTunes, so I'm thinking next time I make an mp4 I'll use that instead (I think there was a problem with apple encoders and audio with more than 2 channels at some point but maybe they figured out a way around that - I think it was just a meta problem anyway).
    I cant use MKVExtract, i dont always work with MKVs . FFMpeg can extract raw video from a wide variety of containers.
    I dont want to use "UT Video Codec" .

    Tell me the advantages of AviSynth over FFMpeg.
    Quote Quote  
  6. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Originally Posted by NonyMony View Post
    I cant use MKVExtract, i dont always work with MKVs.
    Hence the 'but'. All my source files come from MakeMKV.

    Originally Posted by NonyMony View Post
    FFMpeg can extract raw video from a wide variety of containers.
    Which is why I'd recommend it to anyone working with a variety of file formats.


    Originally Posted by NonyMony View Post
    I dont want to use "UT Video Codec" .

    Tell me the advantages of AviSynth over FFMpeg.
    AviSynth is a scripting language that can filter the videos before they're encoded. If there's something not quite right with the video you can add a few lines to an AviSynth script and attempt to repair it. It's quite an involved process since everything need to be adapted to each particular source but if you're really obsessed with command lines and scripts then AviSynth is practically nirvana. I used to have a bunch of Handbrake encodes on my hard drive that I encoded long ago, a few months ago I thought to compare them to more recent attempts to encode the same videos using my (admittedly rather basic) AVISynth skills... it's no contest, the old Handbrake files no longer exist on my hard drive.

    UT Video Codec is a lossless codec, you don't make files you want to keep with it, but filtering is a long involved process and sometimes it's better to handle it step by step rather than wasting time doing masses of filters all at once, then finding out you missed something. Plus, it's better to feed a UT file directly to the encoder rather than while it's filtering, you can better utilise your CPU power that way.
    Quote Quote  
  7. Originally Posted by NonyMony View Post
    Plus, it's better to feed a UT file directly to the encoder rather than while it's filtering, you can better utilise your CPU power that way.
    No, running everything in parallel will usually utilize the CPU the most. The only way using a lossless intermediate is faster is when your filtering is extremely slow compared to your encoding and you want to do multiple passes. You can then do the filtering only once (with a fast (near-)lossless codec) and then do the multiple passes with the final encoder.
    Quote Quote  
  8. Originally Posted by NonyMony View Post
    Tell me the advantages of AviSynth over FFMpeg.
    How easy is previewing when encoding with ffmpeg or Handbrake from the commandline? Being able to preview the video before I start encoding is pretty important to me. Avisynth makes that fairly easy. My PC is hooked up to my TV so I can create a script, open it with MPC-HC, move the player to the TV and run the video fullscreen. It's handy being able to preview the video the way you're going to be viewing it after it's encoded, before you encode it. Quite often I'll create a few different scripts with different filtering or different resizing and run them in different instances of MPC-HC on my TV and switch between them before deciding on the filtering to use etc.....

    Or you can do something similar with AvsPmod, although personally I prefer to fiddle with the scripts using Notepad and Ctrl+E to get MPC-HC to reload the video when I've changed something. Although before I get to that stage I use MeGUI to help index the video and apply cropping and resizing etc using MeGUI's preview.

    If all you want to do is re-encode then any method works, but if you're doing more than that a GUI which lets you preview the video definitely helps. And being able to apply different filtering to different sections of video reasonably easily.....

    Below is a script I'm using for encoding at the moment. It's nothing over the top as far as Avisynth scripts go.
    The video is ITVC'd to 23.976fps, the first thousand or so frames have a bit of blue removed before being denoised, cropped and resized, the opening credits are cropped a bit differently and resized, then the rest of it is denoised, the saturation bumped up a tad and it's once again cropped and resized. Finally some dithering to help prevent banding.

    LoadPlugin("C:\Program Files\MeGUI\tools\avisynth_plugin\TIVTC.dll")
    tfm(order=0).tdecimate(hybrid=1)

    Trim(0,1163).ConvertToRGB().RGBAdjust(1,1,1,1,0,0,-5,0).ConvertToYv12()..TemporalDegrain().crop(16, 8, -8, -8).Spline36Resize(832,468)\
    ++Trim(1164,1955).crop(16, 12, -14, -8).Spline36Resize(832,468)\
    ++Trim(1956,0).TemporalDegrain().Tweak(Sat=1.1).cr op(16, 8, -8, -8).Spline36Resize(832,468)

    gradfun3()
    Mind you the above would be pretty slow thanks to the denoising (TemporalDegrain is very slow), but fortunately I've got a few encodes do to so I'm running two at a time in MeGUI's job queue and keeping the CPU busy that way, or alternatively I'd use Trim() to split an encode in half and run both at the same time etc.
    Last edited by hello_hello; 3rd Oct 2014 at 06:09.
    Quote Quote  
  9. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Originally Posted by sneaker
    No, running everything in parallel will usually utilize the CPU the most. The only way using a lossless intermediate is faster is when your filtering is extremely slow compared to your encoding and you want to do multiple passes. You can then do the filtering only once (with a fast (near-)lossless codec) and then do the multiple passes with the final encoder.
    :P It's really hard to explain exactly why using intermediate files is preferable, I guess it's dependant on your workload and how your processes work. And yes, the extra number crunching inherent in converting to UT must by definition slow things down in... anyway, what I meant was, I can run four instances of QTGMC at once and get 100% cpu utilisation, then I can feed the UT file to x264 and THAT will use 100% as well (or two of three for the lower quality versions). If I remember correctly when I was feeding QTGMC directly into x264 the CPU utilisation was all over the place. I don't know, with all the fiddling I do nothing else will work anyway.

    (and there is the fact that I tend to make 3 versions of each video as well)
    Quote Quote  
  10. Doesn't the time it takes to create an intermediate file tend to negate any time you save by being able to push the CPU to 100% when later encoding with x264? Not to mention the time it takes to index a 29GB file.....
    If you're encoding the video more than once and applying the same slow filtering each time, I can see how creating a lossless file while applying the slow filtering would be advantageous, as then it only needs to be applied once.


    I find when running QTGMC, if I run two encodes at a time, CPU usage for my Quadcore sits between 90% and 100% most of the time. Incidentally (a little off topic) I discovered recently that QTGMC slows down a fair bit when the video isn't mod16. I'd never paid attention until recently, but I was running quite a few nearly identical encoding jobs recently (in respect to the source video and AVS scripts), and I noticed every so often one would literally take twice as long (they were all around 720x576). I was running QTGMC in progressive mode. A bit of investigating revealed each time it happened the source width was mod4. As a test I added AddBorders(4,0,0,0) to the script before QTGMC, adjusted the cropping by an extra 4 pixels to compensate after QTGMC, and I was back up to speed. I don't know whether the same applies to deinterlacing, but I imagine it would.

    Apologies to the OP for wandering off topic......
    Quote Quote  
  11. How easy is it to set process priorities these days? I'm still using XP. Can you do it via the command line?

    I ask, because MeGUI does it for me.

    Name:  priority.gif
Views: 911
Size:  8.4 KB

    I was watching a movie a couple of hours ago and it started stuttering occasionally. Fortunately the penny dropped pretty quickly. I'd somehow managed to bump up the encoding priority in MeGUI's GUI. Once I returned it to "low" I could go back to watching the movie while foobar2000 converted some audio to AAC for me without feeling like the CPU was particularly busy. Even though it was.
    Quote Quote  
  12. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    I have Process Lasso which I use constantly, I keep thinking I should ask at the forum to see if there's a command line interface, I tend to over-utilise the thing trying to get everything running smoothly but only rarely do I get any noticeable results. The batch "START" command can apparently set priorities but only at the initialisation of a program. I remember when I was using handbrake I made a vbs script that could alter the handbrake priority and attached it to a macro key on my keyboard. The idea was that when I wasn't using the PC I could press the macro key and it would switch Handbrake to real-time priority, then when I came back and since at that point the entire user interface would be completely unresponsive, I had another key that when pressed would put handbrake back to normal priority. I don't think I achieved any real gains in doing that, but it was fun.

    My current QTGMC setting are a bit... well, I got bored of Placebo. And that's just step one.

    Anyway, I removed any ability of my batch files to encode from anything other than UT intermediates quite a while ago, so I obviously didn't think it was an ability worth hanging on to. AVISource doesn't need to index files, even if it did, I could always just run a batch and go do something else for a while.
    Quote Quote  
  13. And one more thing, can you please specify how I resize my videos [Ex : 720p to 480p]
    Last edited by NonyMony; 19th Apr 2018 at 21:00.
    Quote Quote  
  14. -s (width)x(height)

    e.g

    -s 854x480 , or if you want mod16 -s 848x480
    Quote Quote  
  15. Originally Posted by poisondeathray View Post
    -s (width)x(height)

    e.g

    -s 854x480 , or if you want mod16 -s 848x480
    That input to x265 or FFMpeg ?
    Quote Quote  
  16. That is scaling by ffmpeg

    x265 doesn't have any other functions like filters, scaling
    Quote Quote  
  17. Originally Posted by poisondeathray View Post
    That is scaling by ffmpeg

    x265 doesn't have any other functions like filters, scaling
    Yea, I checked the docs
    Quote Quote  
  18. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Originally Posted by NonyMony View Post
    Why MP4 and not MKV ?
    Just the tightest fitting container. AVC and HEVC as video streams, as well as AAC as audio stream, are all described in MPEG standards, so why not use a container described in an MPEG standard too? But yes, MKV is useful too, it is the universal container which can contain almost everything related to media.

    Originally Posted by NonyMony View Post
    Tell me the advantages of AviSynth over FFMpeg.
    You can use binary plugins written in compiled languages like C; you can use functions written in AviSynth loaded from import scripts (often named *.avsi); and you can do "Non Linear Editing" (NLE), like splitting a clip, filtering copies of it, and merging the different results via boolean decisions or averaging calculations. The possible complexity is way beyond a sequence of ffmpeg built-in filters.

    QTGMC is a good example of an importable function using several plugins, applying motion-aware deinterlacing (to avoid quality reduction of rather still scenes).

    Originally Posted by NonyMony View Post
    And one more thing...
    Would you please be so kind as not to yell at us? We can read default size text too.
    Last edited by LigH.de; 3rd Oct 2014 at 10:00.
    Quote Quote  
  19. Originally Posted by LigH.de View Post
    Originally Posted by NonyMony View Post
    Why MP4 and not MKV ?
    Just the tightest fitting container. AVC and HEVC as video streams, as well as AAC as audio stream, are all described in MPEG standards, so why not use a container described in an MPEG standard too? But yes, MKV is useful too, it is the universal container which can contain almost everything related to media.

    Originally Posted by NonyMony View Post
    And one more thing...
    Would you please be so kind as not to yell at us? We can read default size text too.

    Thanks for the explanation about MP4 and MKV .


    And about the big red text, Its just formatting, i wanted to make sure that the users read it as well.
    It doesnt mean im 'yelling' at u mate .
    Quote Quote  
  20. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Neither MP4 nor MKV, just choose Transport Streams FTW \o/

    Quote Quote  
  21. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Well, Transport Streams may have some advantage when it comes to compatibility with specific playback devices; but their disadvantage is usually a waste of space due to a lot of multiplexing overhead, caused by its small granularity (a header each 188 or 192 bytes).

    And "big fat red" is considered "written yelling". It made me believe that you were afraid of being ignored, despite such a lot of replies...

    P.S.: ^ more edits above. But no need for "useless full quotes". Quote only the small part you need to refer to, if at all.
    Quote Quote  
  22. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Resizing in FFMPEG isn't all that interesting. (Not like resizing in AVISynth.)

    I just filed my first bug report to MP4Box and I feel soiled .
    Quote Quote  
  23. Originally Posted by NonyMony View Post
    And one more thing, can you please specify how I resize my videos [Ex : 720p to 480p]

    Code:
     -vf scale="'if(gt(a,16/9),848,-1)':'if(gt(a,16/9),-1,477)':sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp,pad=848:480:(ow-iw)/2:0"
    Last edited by pandy; 6th Oct 2014 at 03:59.
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!