VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. Member
    Join Date
    Jan 2010
    Location
    New Zealand
    Search Comp PM
    I have video from various sources and sizes - some 1280x720 (square pixels) some 1440x1080 (anamorphic). I thought AVIDemux would be a good tool to split the video clips I wanted and resize everything to the same size with a lossless codec, then that would give me good flexibility in bring the AVI's into whatever I decided to use for the final composition.

    I decided FFV1 would be the best lossless codec to use, but it is not available in AVIDemux 2.6. Huffyuv is, but Huffyuv's compression is not nearly as good as FFV1 (FFV1 files are half the size).

    In AVIDemux though, with my MP4's I get a warning ""If the file is using B-Frames as a refrence it can lead to a crash or stuttering. Avidemux can use another mode which is safe but YOU WILL LOSE FRAME ACCURACY. Do you want to use that mode?" (I don't get this warning in AVIDemux 2.6.). If I click 'No' it still seems to work - is this ok does it mean I have a problem?

    The funny thing is though whether I encode using Huffyuv in AVIDemux 2.6 or FFV1 in 2.5, I can't play back the resulting AVI in VLC or Windows Media Player. But I can open it in AVIDemux and VirtualDub (although VirtualDub does give warnings about VBR audio).

    Just on VirtualDub, I take it it is really not suitable for working with MP4's? I see some references to a plugin that allows it to support MP4's, but that it isn't really recommended because it's not frame accurate.

    Sorry for all the questions - but some advice would be appreciated.
    Quote Quote  
  2. I've never used AVIDemux so I can't help there.

    It might pay to skip the lossless part and go straight to the encoding stage, but there's many ways to do it. If you're just wanting to split the video without re-encoding that's a different story, but assuming you're wanting to re-encode, opening the original video using an AVISynth script and working with it, rather than working with the video directly, might be easier and it'll save having to first convert to a lossless format.

    If you're not familiar with AVISynth then maybe try MeGUI. It'll open and index MP4s, let you specify resizing etc, then it saves an AVISynth script to use for encoding. MeGUI also has a script cutter, which you can use to open the script MeGUI created and specify "cuts". The script cutter opens a preview window and lets you specify which sections of the video you want to re-encode (frame accurately) and it then saves the cuts to the script. Once that's done, you just re-encode as you normally would, except you're only re-encoding the sections you specified. The script cutter also saves a "cuts file" which MeGUI can use for re-encoding the audio, and it'll re-encode it in sections as it does the video.

    Rather than use MeGUI's script cutter you can just use MeGUI to create a script for encoding the whole video, then open the script using VirtualDub. You can then add existing audio (if VirtualDub supports it) and edit the video using VirtualDub as you would if you'd opened the video directly.

    There's times when for one reason or another you may need to convert to a lossless format first, but generally it's better to leave it as a last resort. If I do convert to lossless I tend to convert the whole video first, then edit the lossless version, but the problem there is you're working with large files.
    Last edited by hello_hello; 25th Oct 2012 at 19:19.
    Quote Quote  
  3. Member
    Join Date
    Jan 2010
    Location
    New Zealand
    Search Comp PM
    Thanks for the advice. There are situations, however, that I think I will definitely want to process a video and save it in a lossless format. For example, I have old interlaced MiniDV camcorder AVI files. If I want to mix this with my newer progressive MP4 video I would really want to deinterlace it separately (AVISynth), which would mean I need to save it as an intermediate file, which of course I would want to be lossless.Another situation I am thinking of is my 1440x1080 anamorphic MP4 video. Media players don't seem to know that it's not using square pixels (the display is squashed up unless I tell the media player it's 16:9), so I don't have any confidence that video editors would either. So if I'm mixing 1280x720 (square pixel) video with 1440x1080 (anamorphic), it seemed to me like it would be a good idea to scale the latter down to 1280x720 before composing my final video in an editor - which would again require an intermediate file that I would want to be lossless.
    Quote Quote  
  4. Yeah if you're mixing video of different types, then converting to lossless while resizing them to match etc might be the easiest solution. I still think converting them to lossless using AVIsynth to frameserve the original video might be easier than trying to open and edit them directly though. Well at least when it comes to MP4s.

    I don't know how familiar you are with AVIsynth but if you have it installed and you can install ffmpegsource, you can create a basic script to open and index the video, then open the script and edit frame accurately using VirtualDub.

    Generally, because I'm not exactly an AVISynth expert myself, I just use MeGUI to create the scripts while using MeGUI's script creator to apply any necessary de-interlacing and resizing etc, then use MeGUI's AVS Cutter to specify which parts of the video to encode. I also use MeGUI's AVS Cutter as it has a preview window which allows you to specify cut points frame accurately.
    Even if you create the script manually though, once you've done so you can open it with another program and convert it to a lossless format. Or if you don't add the cuts manually you can open the script using VirtualDub and then edit the video as you normally would before converting, except you don't need to worry about keyframes. A simple script might look like this:

    Code:
    LoadPlugin("C:\Program Files\ffms2\ffms2.dll")
    
    FFIndex("E:\movie.mp4") AudioDub(FFVideoSource("E:\movie.mp4"), FFAudioSource("E:\movie.mp4"))
    
    Spline36Resize(640,480)
    
    __film = last
    __t0 = __film.trim(56, 3678)
    __t0
    The above script will get ffmpegsource to index the video the first time you open it (there'll be a pause the first time you do while the index file is created) it'll resize the video to 640x480 and AVISynth will output frames 56 through to 3678.

    One program I use for converting video to a lossless format now and then is AnyVideoConverter. It'll convert to both FFV1 and huffyuv and it'll also convert using a script such as the one above as the source. You can also use MPC-HC to open and preview AVISynth scripts.
    Last edited by hello_hello; 25th Oct 2012 at 22:13.
    Quote Quote  
  5. Member
    Join Date
    Jan 2010
    Location
    New Zealand
    Search Comp PM
    Thank you so much or all the great advice.

    I have actually used Avisynth in the past for deinterlacing so I am familiar with how it works. I didn't think of using it with VirtualDub. As I understand it I would be opening the script in VirtualDub and this script would be 'feeding' the video to VirtualDub through AviSynth. Then I would have all the VirtualDub filters available to me and could save it as a lossless AVI from there.
    Quote Quote  
  6. Yes. Although unless you particularly need to apply a VirtualDub filter you still might be able to skip the lossless stage at times.

    For instance if you want to use a section of 1280x720 video and add a section of 1440x1080 video followed by a section of a camcorder AVI file, there's probably no reason why you couldn't just encode the section of each you want to keep and then join the three encodes... rather then convert each to lossless first, join them and then re-encode. Obviously you'd want to end up with the same resolution etc for each, so you'd just resize them the same when encoding, and de-interlace whichever section needs de-interlacing etc. As long as the three encodes are the same.... same resolution, frame rate and encoder settings, and as long as you convert the audio of each to the same format, then joining them together should be pretty easy. I do that sort of thing using MeGUI every so often without any problem. If the output is MKV, MKVMergeGUI will join them. If the output is MP4 then something like YAMB should be able to do the same.

    I guess it might also depend how you're wanting to encode them too. For instance if you want to join sections of each video and then encode it as a single video while sticking to a particular file size, converting to lossless first would probably be the way to go. But if you're not worried about file size and just use the same CRF value each time (assuming x264 encoding) then encoding each section and joining them together without the lossless step might save a bit of time.

    Just some thoughts, anyway.....
    Quote Quote  



Similar Threads

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