VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member
    Join Date
    Feb 2009
    Location
    Germany
    Search Comp PM
    I tried to solve this since few days with no luck so far, so please help...

    I have a mkv HD file (720p) with video encoded in h.264 format and 5.1 audio in DTS format. What I need is an avi file, the same resolution, video encoded in xvid (or divx), 5.1 audio preferably untouched (DTS) or converted to AC3 if it's not possible. But 5.1, not stereo mp3.

    I'm on linux so I worked only with mencoder so far. The first try was:

    mencoder movie.mkv -ffourcc XVID -ovc lavc -lavcopts vcodec=mpeg4:threads=8:vbitrate=3000 -oac copy -o movie.avi

    Video of the resulting file seems all right, but I get lots of "Skipping frame" errors from mencoder during encoding (like every 2 seconds) and audio (it's DTS all right) goes out of sync after a while.


    I also found some option (googling) to get rid of this "skipping frame" errors. The result was an xvid/dts avi file, with audio much more out of sync, than before.


    Then I tried to reencode dts into ac3 with this command:

    mencoder movie.mkv -ffourcc XVID -ovc lavc -lavcopts vcodec=mpeg4:threads=8:vbitrate=3000 -oac lavc -lavcopts acodec=ac3:abitrate=384 -channels 6 -o movie.avi

    Video was all right again, but there is no sound at all when I watch the movie. Media info tool and "codec info" from VLC say there os 5.1 AC3 sound, but can I hear no sound at all.

    I also tried:

    mencoder movie.mkv -ffourcc XVID -ovc lavc -lavcopts vcodec=mpeg4:threads=8:vbitrate=3000:cmp=2ubcmp=2:trell=yes:v4mv=yes:mbd=2 -oac lavc -lavcopts acodec=ac3:abitrate=384 -channels 6 -af channels=6:6:0:0:4:1:1:2:2:3:3:4:5:5 -o movie.avi

    with the same result.


    Any ideas?


    Edit1: as far as I can tell there is no variable framerate or bitrate anywhere in the input file involved - see output of the MediaInfo below.

    Edit2: here info about input file (output from MediaInfo):
    Code:
    General 
    Count : 246 
    Count of stream of this kind : 1 
    Kind of stream : General 
    Kind of stream : General 
    Stream identifier : 0 
    Inform : 
    Matroska: 4.37 GiB, 1h 28mn 
    Count of video streams : 1 
    Count of audio streams : 1 
    Video_Format_List : AVC 
    Video_Format_WithHint_List : AVC 
    Codecs Video : AVC 
    Video_Language_List : English 
    Audio_Format_List : DTS 
    Audio_Format_WithHint_List : DTS 
    Audio codecs : DTS 
    Complete name : ***
    Folder name : ***
    File name : ***
    File extension : mkv 
    Format : Matroska 
    Format/Url : http://packs.matroska.org/ 
    Format/Extensions usually used : mkv mka mks 
    Codec : Matroska 
    Codec/Url : http://packs.matroska.org/ 
    Codec/Extensions usually used : mkv mka mks 
    File size : 4695226405 
    File size : 4.37 GiB 
    File size : 4 GiB 
    File size : 4.4 GiB 
    File size : 4.37 GiB 
    File size : 4.373 GiB 
    Duration : 5309313 
    Duration : 1h 28mn 
    Duration : 1h 28mn 29s 313ms 
    Duration : 1h 28mn 
    Duration : 01:28:29.313 
    Overall bit rate : 7074702 
    Overall bit rate : 7 075 Kbps 
    Encoded date : UTC 2008-06-17 22:21:16 
    Writing application : mkvmerge v2.2.0 ('Turn It On Again') built on Mar 4 2008 12:58:26 
    Writing library : libebml v0.7.7 + libmatroska v0.8.1 
    Writing library : libebml v0.7.7 + libmatroska v0.8.1 
    
    Video 
    Count : 134 
    Count of stream of this kind : 1 
    Kind of stream : Video 
    Stream identifier : 0 
    Inform : English, 5 250 Kbps (5 562 Kbps), 1280*544 (2.35), at 23.976 fps, AVC (Container profile=Unknown@5.1) (High@L5.1) (CABAC / 5 Ref Frames) 
    ID : 1 
    ID : 1 
    UniqueID : 1 
    Format : AVC 
    Format/Info : Advanced Video Codec 
    Format/Url : http://developers.videolan.org/x264.html 
    Format profile : High@L5.1 
    Format settings : CABAC / 5 Ref Frames 
    Format settings, CABAC : Yes 
    Format settings, CABAC : Yes 
    Format settings, ReFrames : 5 
    Format settings, ReFrames : 5 frames 
    Muxing mode : Container profile=Unknown@5.1 
    Codec ID : V_MPEG4/ISO/AVC 
    Codec ID/Url : http://ffdshow-tryout.sourceforge.net/ 
    Codec : V_MPEG4/ISO/AVC 
    Codec : AVC 
    Codec/Family : AVC 
    Codec/Info : Advanced Video Codec 
    Codec/Url : http://ffdshow-tryout.sourceforge.net/ 
    Codec profile : High@L5.1 
    Codec settings : CABAC / 5 Ref Frames 
    Codec settings, CABAC : Yes 
    Codec_Settings_RefFrames : 5 
    Duration : 5304000 
    Duration : 1h 28mn 
    Duration : 1h 28mn 24s 0ms 
    Duration : 1h 28mn 
    Duration : 01:28:24.000 
    Bit rate : 5249684 
    Bit rate : 5 250 Kbps 
    Nominal bit rate : 5562000 
    Nominal bit rate : 5 562 Kbps 
    Width : 1280 
    Width : 1 280 pixels 
    Height : 544 
    Height : 544 pixels 
    Pixel Aspect Ratio : 1.000 
    Display aspect ratio : 2.353 
    Display aspect ratio : 2.35 
    Frame rate : 23.976 
    Frame rate : 23.976 fps 
    Frame count : 127296 
    Resolution : 24 
    Resolution : 24 bits 
    Colorimetry : 4:2:0 
    Scan type : Progressive 
    Scan type : Progressive 
    Interlacement : PPF 
    Interlacement : Progressive 
    Bits/(Pixel*Frame) : 0.314 
    Delay : 0 
    Writing library : x264 - core 60 r886 1075536 
    Writing library : x264 core 60 r886 1075536 
    Writing library/Name : x264 
    Writing library/Version : core 60 r886 1075536 
    Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=7 / brdo=1 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=1 / bime=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=5562 / ratetol=1.0 / rceq='blurCplx^(1-qComp)' / qcomp=1.00 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=2:1.00 
    Language : en 
    Language : English 
    
    Audio 
    Count : 121 
    Count of stream of this kind : 1 
    Kind of stream : Audio 
    Kind of stream : Audio 
    Stream identifier : 0 
    Inform : 1 536 Kbps, 48.0 KHz, 6 channels, DTS 
    ID : 2 
    ID : 2 
    UniqueID : 2708952726 
    Format : DTS 
    Format/Info : Digital Theater Systems 
    Codec ID : A_DTS 
    Codec : DTS 
    Codec : DTS 
    Duration : 5309313 
    Duration : 1h 28mn 
    Duration : 1h 28mn 29s 313ms 
    Duration : 1h 28mn 
    Duration : 01:28:29.313 
    Bit rate mode : CBR 
    Bit rate mode : Constant 
    Bit rate : 1536000 
    Bit rate : 1 536 Kbps 
    Channel(s) : 6 
    Channel(s) : 6 channels 
    Channel positions : Front: L C R, Surround: L R, LFE 
    Channel positions : 3/2.1 
    Sampling rate : 48000 
    Sampling rate : 48.0 KHz 
    SamplingCount : 254847024 
    Resolution : 24 
    Resolution : 24 bits 
    Delay : 0 
    Video delay : 0 
    Video0 delay : 0
    Quote Quote  
  2. On linux, you could try avidemux, with the dts addon

    http://www.avidemux.org/admForum/viewtopic.php?pid=18985#p18985

    If you have access to Windows, there are many more options
    Quote Quote  
  3. Member
    Join Date
    Feb 2009
    Location
    Germany
    Search Comp PM
    Originally Posted by poisondeathray
    On linux, you could try avidemux, with the dts addon

    http://www.avidemux.org/admForum/viewtopic.php?pid=18985#p18985

    If you have access to Windows, there are many more options
    Thanks for your advice, poisondeathray.

    I tried avidemux (had to compile it from sources to enable dts library under linux), but for some reason it recognizes only 2 channels in the input DTS stream. But MediaInfo, says it's 6 channel DTS. Any ideas why?

    Video conversion (h.264->xvid) works as expected, AC3 sound in the output file can be heard, but there are only 2 channels available...
    Quote Quote  
  4. Member
    Join Date
    Feb 2009
    Location
    Germany
    Search Comp PM
    It seems I found the solution, so I post it here in case somebody has similar problems.

    I managed to transcode my mkv/h.264/dts video to avi/xvid/dts using mencoder without reencoding audio (just copying the audio stream) and without these strange a/v out of sync problems.

    Here my understanding, what caused the problems. Somebody correct me if I got it wrong...
    The original video was encoded with the standard 23.976 fps. At least this is what MediaInfo and media players displayed. But it seems this value was read just from some file/container header and the real framerate was a bit higher (slightly above 24 fps). Hence the "skipping frame" warnings every 2 seconds from mencoder. Mencoder tried to encode in the same framerate it believed the source material was (23.976 fps), but there was more frames per second in the actual video stream. Automatic skipping of frames tried to remedy the problem, but was inaccurate and after a while the sound went out of sync.

    And here the solution. I used -ofps option of mencoder to set fps of the output video to the right value. I found it by trial&error - the goal was to achieve encoding process without "skipping frame" or "duplicate frame" (the opposite) warnings. The right value I found at last was 24.405 fps, which is pretty strange (not one of the standard fps values), but works for this particular file like charm. No a/v out of sync issues at all anymore.

    So... here the command I used for reference:

    Code:
    mencoder input.mkv -noodml -ofps 240000/9834 -ffourcc XVID -ovc lavc -lavcopts vcodec=mpeg4:threads=8:vbitrate=4000:cmp=2:subcmp=2:trell=yes:v4mv=yes:mbd=2 -oac copy -channels 6 -o output.avi
    The -ofps value is good only for my particular strange input file of course. Mostly the standard values (23.976 fps, 25 fps etc.) should work I think - so no -ofps setting needed here. If not, the right value has to be found by trial&error again.
    Quote Quote  



Similar Threads

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