VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Hello,

    I have a MP4 file (container) where video is compressed with DIV3; since DIV3 should be compatible with AVI, I am looking for a way to repackage without full de-/re-encoding.

    The file plays well in mpc and BSPlayer, but not in wmp nor zoom. ffdshow is installed, but is not really needed (if I disable libavcodec msmpeg4, the DIVX codec directly handles DIV3 also correctly).

    avidemux opens the MP4 file, but doesn't seem to support the DIV3 codec and only displays colorful pixels at the screen bottom; file information reports the codec as blank. Saving to AVI does not fill in any information about the video codec.

    I can demux the two streams with MP4Box, but don't know what to do afterwards with the raw DIV3 stream data.

    I can well open the file in VD using avisynth, but since it only gives access to the decompressed video data this is to no avail.

    I can also open the file in VD with the quicktime plugin, forcing mode=4 (VFW) and a fourcc=DIV3, but afterwards unfortunately cannot save back to AVI with direct stream copy: I get the error "The source Video stream uses a compression algorithm which is not compatible with avi files. Direct Stream Copy cannot be used with this Video stream"

    Questions:
    a) does the QT plugin give access to the raw (compressed) video stream data, or only (like avisynth) to the decompressed?
    b) is there any other chance to repackage without re-encoding?

    w.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Have you tried ffmpeg?

    Code:
    ffmpeg -i video.mp4 -vcodec copy -acodec copy video.avi
    Quote Quote  
  3. Nope, that one has escaped my attention so far.

    Will try tonite, thanks a lot!

    w.
    Quote Quote  
  4. Hello Baldrick,

    I have used your command with the round 20 files I have, and I get 3 different results:

    1) for a couple of files, everything works fine
    2) for a couple of files, ffmpeg stops quickly with "error, non monotone timestamps"
    3) for some ffmpeg blows up the file to 10 times its original size (more then 50% used by an enormous index); I have to feed it again into VD and save with mode direct stream copy to get it back to a reasonable size close to the original.

    I haven't used ffmpeg before, can you give any advise on problems (2) and (3)?

    Thanks, w.
    Quote Quote  
  5. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Nope, I have no ideas. Sounds like crappy source video...
    Quote Quote  
  6. Solved it.

    Reason was the audio track: I had to first demux it with MP4Box, then process (repackage) the video with ffmpeg using the "no audio" option (-an), and then remux the two tracks together again with VirtualDub.

    Sounds complicated, but can be scripted/batched easily, and only takes 2 seconds per file.

    VDub script "my.script":
    Code:
    VirtualDub.Open(VirtualDub.params[0],"",0);
    VirtualDub.audio.SetSource(VirtualDub.params[1], "MPEG audio input driver (internal)", "DAAAAE1QM08AAAAA");
    VirtualDub.audio.SetMode(0);
    VirtualDub.audio.SetInterleave(1,500,1,0,0);
    VirtualDub.audio.SetClipMode(1,1);
    VirtualDub.audio.SetConversion(0,0,0,0,0);
    VirtualDub.audio.SetVolume();
    VirtualDub.audio.SetCompression();
    VirtualDub.audio.EnableFilterGraph(0);
    VirtualDub.video.SetInputFormat(0);
    VirtualDub.video.SetOutputFormat(7);
    VirtualDub.video.SetMode(0);
    VirtualDub.video.SetSmartRendering(0);
    VirtualDub.video.SetPreserveEmptyFrames(0);
    VirtualDub.video.SetFrameRate2(0,0,1);
    VirtualDub.video.SetIVTC(0,0,-1,0);
    VirtualDub.video.SetCompression();
    VirtualDub.video.filters.Clear();
    VirtualDub.audio.filters.Clear();
    VirtualDub.subset.Delete();
    VirtualDub.video.SetRange();
    VirtualDub.project.ClearTextInfo();
    VirtualDub.SaveAVI(VirtualDub.params[2]);
    VirtualDub.audio.SetSource(1);
    VirtualDub.Close();
    batch (requires a temp folder):
    Code:
    C:\Programme\MP4Box\mp4box %1.mp4 -raw 2
    C:\Programme\ffmpeg-0.5\ffmpeg -i %1.mp4 -vcodec copy -an %1.avi
    C:\Programme\VirtualDub\vdub.exe /i my.script %1.avi %1_track2..mp3 .\TEMP\%1.avi
    DEL %1.avi
    DEL %1_track2..mp3
    MOVE .\TEMP\%1.avi .
    Quote Quote  



Similar Threads

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