VideoHelp Forum
+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. This is my first post ever on this forum ... so please let me know where I err!

    I have a 3D movie which I wish to convert to 2D on CentOS6 Linux for the learning experience and to help others.

    Intuitively, I first tried using Linux "recordMyDesktop" to simply screen-capture the left half of the screen - that still might work - but it takes two hours to play the video and then it seems to take days for recordmydesktop to encode the results - so I'm looking for a faster method of splitting off one horizontal side of the 3D movie to make it a 2D movie instead.

    Googling, I found this forum where some people suggest AVISynth but, unfortunately, the CentOS installer (yum) doesn't have AVISynth as described here:
    - 3D MKV to 2D MKV

    Googling some more, it seems the right way to go may be to try to follow this AVIdeMux tutorial:
    - How to encode 3D STEREOSCOPIC to 2D

    That tutorial suggests the use of "avidemux", so my first task (OT) was to figure out how to install avidemux on Centos6 (which isn't easy, trust me - due to the dependencies and the fact it's not in the standard repositories).

    Once AVIdeMux was installed, the next task was to follow the (seemingly garbled) instructions in that tutorial.

    Here are the instructions in the referenced tutorial (verbatim):
    ... locate the file to encode (convert) by click on open, the stereoscopic "3 D" look like this, we need change the video codec, audio & format, we want keep the quality so for video MPEG-4 AVC, audio AC-3, format MKV, after you choose the video codec, you can use configure, for the encode, encode by ["encode mode" (single or dual pass)], ["target size" (if is for a single dvd 4Gb], or ["quantizer" (big number to low, from 51 to 0, but 51 bad quality 0 best quality), by default the max ref. frames are 3, but I use 4, don't go over 6, software like multiAVC will claim about it."filters" menu where we need change a few thing for the best end result,on transform filter use resize, crop & resize but this is only necessary only like this case the sample is 3000x800 so resize first to 1280x720, them crop 640 & resize again to 1280x720, destination 16:9 and lanczos3, [on MEgui is lanczos4]screenshot of correct sise 1280x720, now crop,half of 1280 is 640 input that on with and click enter (return key),choose from left or right to crop in to half,them resize again to 1280x720, from the filters menu you have to use for this first resise MPayer,then crop and last resize with avisynth, screenshot after all the settings apply,save the file for Avidemux start the encode, my is avt.mkv, in Avidemux you have to add .mkv to the end of the file and after the encode use the MKmerge to change the internal name of the file "tag" for the name that you want.in Mkmerge, file segment title, under global tab is "Avidemux", change for the name that you want or clear it, is up to you. MEgui you don't need do this, so that it I hope this will help someone....
    I'm a native English speaker - but I still didn't understand what the author was trying to tell me above (it doesn't help that I've never used avidemux before).

    Always aiming for success, I first attempted what anyone else would do - which is to edit and rewrite the tutorial so that it made sense to an English speaking audience. Here's the result of that editing effort:
    1. locate the file to encode (convert) by click on open,
    2. we need change the video codec, audio & format,
    we want keep the quality so for video MPEG-4 AVC, audio AC-3, format MKV,
    3. after you choose the video codec, you can use configure, for the encode,
    ["encode mode" (single or dual pass)],
    ["target size" (if is for a single dvd 4Gb], or ["quantizer" (big number to low, from 51 to 0, but 51 bad quality 0 best quality),
    by default the max ref. frames are 3, but I use 4, don't go over 6, software like multiAVC will claim about it.
    4. "filters" menu where we need change a few thing for the best end result,
    on transform filter use resize, crop & resize but this is only necessary only like this case the sample is 3000x800
    so resize first to 1280x720, them crop 640 & resize again to 1280x720,
    destination 16:9 and lanczos3, [on MEgui is lanczos4]
    5. now crop,half of 1280 is 640 input that on with and click enter (return key),
    choose from left or right to crop in to half,
    6. them resize again to 1280x720, from the filters menu
    7. you have to use for this first resise MPayer, then crop and last resize with avisynth,
    8. screenshot after all the settings apply,
    9. save the file for Avidemux
    10. start the encode, my is avt.mkv, in Avidemux you have to add .mkv to the end of the file and after the encode use the MKmerge to change the internal name of the file "tag" for the name that you want.in Mkmerge, file segment title, under global tab is "Avidemux", change for the name that you want or clear it, is up to you. MEgui you don't need do this, so that it I hope this will help someone....
    Hmmmmm.... I'm not at all sure that this good-faith edit attempt actually improved upon anything - but, by doing so, I realized a key step seems to be to choose what format you want your resulting file to be in.

    Here's what I did so far:
    Avidemux:File->Open->movie.mkv


    The AviDemux "File->Information" command shows the original file to be of the format shown below:
    - Video Codec 4CC = AVC1
    - Image Size = 1920x1080
    - Audio Codec = DTS
    - Audio Channels = 6

    Q: As this is my first post ever, may I ask what format I want my resulting movie to be in?
    Image Attached Thumbnails Click image for larger version

Name:	Screenshot.png
Views:	14756
Size:	40.4 KB
ID:	13241  

    Last edited by rocksockdoc; 28th Jul 2012 at 20:29.
    Quote Quote  
  2. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    buy the movie. first you'd have to cut the movie in half horizontally then re-encode whats left. the quality will suck.
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  3. Originally Posted by aedipuss View Post
    first you'd have to cut the movie in half horizontally then re-encode whats left
    Ah, that's great advice!

    What you're saying is I divide my 1920x1080 movie in half horizontally, and then re-encode what's left. Right?

    So 1920 divided in half horizontally is 960 pixels (which eliminates the right half of the movie).

    After hunting and pecking around the AviDeMux GUI for a while, I found that the task for that in AVIdeMux seems to be this sequence shown in the image below:
    Avidemux: Video->Filters->Transform->Crop->{top=0,bottom=0,left=0,right=960}

    I'll see if I can figure out the step after that, which you said is to "re-encode whats left".
    Image Attached Thumbnails Click image for larger version

Name:	Screenshot-2.png
Views:	759
Size:	79.8 KB
ID:	13243  

    Last edited by rocksockdoc; 28th Jul 2012 at 16:17.
    Quote Quote  
  4. Originally Posted by aedipuss View Post
    cut the movie in half horizontally, then re-encode whats left...
    Working on that advice, I belatedly realized I had not mentioned I would have expected the final 2D output to be 1920x1080 so I tried an experiment (which I thought would likely result in a stretched video).

    To resize the cut-in-half movie back to the original size, I used the following (which I found by hunting and pecking in the AVIdeMux user interface:

    Avidemux:Video->Filters->Transform->MPlayer resize->"green +"->Lock aspect ratio=off

    Now with the lock-aspect-ratio turned off, I changed the "Resize Dimensions" from 960x1080 to 1920x1080.

    As shown below, I'm assuming this sequence of steps will run two successive filters, the first of which is to crop the original 1920x1080 file to 960x1080 ... and then the second filter will attempt to resize that 960x1080 (1:1.25 ratio) file back to 1920x1080 pixels (1:1.75 ratio).

    Anyway, I guess the next step is now back to what you had suggested ... which is to "re-encode" what's left".

    I'll see if I can figure how to do that "re-encode" step next.
    ---------------------
    EDIT: (update)
    --------------------
    Note: There must be some 'magic' going on because the video results were perfect; they were not stretched sideways!
    I would have thought that changing the size from 960x1080 to 1920x1080 would have stretched the video sideways - but it didn't. The video was perfect!
    Image Attached Thumbnails Click image for larger version

Name:	filter.png
Views:	821
Size:	206.0 KB
ID:	13250  

    Last edited by rocksockdoc; 28th Jul 2012 at 20:08.
    Quote Quote  
  5. Originally Posted by aedipuss View Post
    re-encode whats left
    Unfortunately, I could find no button that was called 'encode' or 're-encode', so, after a bit of hunting and pecking, I figured that the command for that must simply be the following save sequence:
    Avidemux: File->Save->Save Video->Filename=half.avi

    It looks like it will take a while ... so I'll let you know how it works out.
    (I'm sure I made a ton of mistakes ... so additional advice will be welcome.)
    Image Attached Thumbnails Click image for larger version

Name:	half.png
Views:	14680
Size:	32.1 KB
ID:	13251  

    Last edited by rocksockdoc; 28th Jul 2012 at 16:41.
    Quote Quote  
  6. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    the only mistake that pops out is the output container(format). in avidemux you have to set that also. it should be mp4.
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  7. Originally Posted by aedipuss View Post
    the output container(format). ... should be mp4.
    Ah. Thanks. I had never used an MP4 before. Generally, on Centos6, I use DeVeDe to convert an AVI to a DVD ISO which I burn to disc using K3b.

    Q: Had I created an MP4 file instead of an AVI, I'll have to google what the next steps would be to convert that MP4 file to a DVD ISO to burn to DVD disc.
    Image Attached Thumbnails Click image for larger version

Name:	Screenshot.png
Views:	7684
Size:	125.5 KB
ID:	13257  

    Last edited by rocksockdoc; 28th Jul 2012 at 20:11.
    Quote Quote  
  8. UPDATE:

    The resulting AVI file was 'almost' perfect.

    a) The video was perfect (it was not stretched, surprisingly) <--- must be some magic inside of avidemux that allowed that!
    b) The audio was about a half second ahead of the people's lips <--- somehow I lost frame accuracy
    c) There was about a second of extraneous video at the very start of the movie that came from somewhere in the movie

    In hindsight, I remember a warning that popped up at some point regarding frame accuracy.
    I'll have to google a bit to see how to resolve these relatively minor problems.
    Image Attached Images  
    Quote Quote  
  9. I re-ran the initial File->Open on the original MKV file.
    This is the warning that first confronted me.
    Confirmation:
    H.264 detected
    If the file is using B-frames as reference 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 had said "yes" - but maybe that's why my sound is a half-second in front of the movie???
    (The sound is fine in the original movie.)

    Q: What is the correct response to this question (yes or no)?
    (i.e., could it have caused the sound to be a half second in front of the video?)

    Click image for larger version

Name:	h264_detected.png
Views:	8180
Size:	66.4 KB
ID:	13259
    Last edited by rocksockdoc; 28th Jul 2012 at 20:42.
    Quote Quote  
  10. I'm looking for the culprit that caused the two (perhaps related?) anomalies:
    a) There was about a second or two of extraneous video at the start of the converted result
    b) The sound was ahead of the action by about a half second or so

    Going back, I realized that I had said YES to a few dialogs that popped up unexpectedly when I first converted the 1920x1080 3D side-by-side MKV to a 1920x1080 2D AVI file.

    For example, this popped up right after the previous popup:
    Confirmation:
    Index is not up to date
    You should use Tool->Rebuild frame. Do it now ?
    Q: What is the suggested response to this question (yes or no)?
    (i.e., could it have caused the sound to be a half second in front of the video?)
    Image Attached Thumbnails Click image for larger version

Name:	index_is_not_up_to_date.png
Views:	7461
Size:	57.3 KB
ID:	13261  

    Last edited by rocksockdoc; 28th Jul 2012 at 20:47.
    Quote Quote  
  11. Based on googling for Linux (Centos6) commands that will fix the audio sync with the sound, I found this which I'll try:
    How to fix audio synchronization of an AVI on Linux

    Essentially, you guess how much your sound is ahead of your video, and you run the mencoder command to fix it:
    Code:
    $ sudo yum install mencoder
    $ /usr/bin/mencoder video.avi  -oac copy -ovc copy  -delay -0.5 -o video-fixed.avi
    This will delay the audio by about a half second.

    For testing, I will do the first 5 minutes (300 seconds) of the video only ... until I get the audio-delay setting right.
    Code:
    $ /usr/bin/mencoder video.avi  -oac copy -ovc copy  -delay -0.5 -endpos 300 -o video-fixed.avi
    Note: I found a method that uses virtualdub on the PC which calculated the exact amount the audio was out of synch; but I'm on Centos 6 Linux (which uses YUM & RPM files) so VirtualDub isn't an option.

    Q: If you know how to calculate on Linux how much ahead the sound is from the video, please let me know.
    Last edited by rocksockdoc; 28th Jul 2012 at 21:50.
    Quote Quote  
  12. Originally Posted by rocksockdoc View Post
    H.264 detected. If the file is using B-frames as reference 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?
    Looking in the Avidemux DokuWiki, and given how frequent this message is, I'm shocked to find the discussion not in the FAQ (it should be as I can see I'm not the only one asking the question). The Avidemux wiki does say that "H.264 (MPEG-4 Part 10, AVC)" is a "compression format" as explained in wikipedia at "http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC".

    I'm further dismayed that the Avidemux tutorials are just as remiss when it comes to explaining this obviously frequently asked question.

    Giving up on the Avidemux wiki tutorials, I move on to the Avidemux forum where various answers lie, e.g., this article basically says to always say 'yes' to this message.
    If I open an x264 movie (in this case your sample from MegaUpload), I ALWAYS press YES. Then I check the composition of the movie. Your sample movie starts with a P-frame (not standard but OK), than it alternates using IBBPBBPBBP....I frames.
    The movie structure has an I-frame every 300 frames and in between it uses a ..BBPBBP.. sequence (1). Next to that it is \"Closed Gap\" as the ending frame before the new index I-frame is a P-frame (2).
    So the structure of the movie conforms exactly to what the message says \"If the file is using B-frames as reference...\", and this file does. You must use the alternate mode in this case (YES on the first popup). It\'s not an avidemux error, it\'s anx264 issue every editor (not viewers) needs to take care of.

    If you open an x264 file, always say YES (another mode) and check the movie structure to see if it uses B-frames. If it doesn\'t use B-frames, you can reopen the x264 and say NO.
    Again: this is not an avidemux issue, but an x264 \"drawback\". The only thing you can say about avidemux is that it should not accept your choice and than crash. The 2.6 version that is currently being developed deals with this \"more elegantly\".
    However, googling further, I find others say the 'correct' response to this question is apparently always 'no', unless/until Avidemux actually crashes. Then, if avidemux actually crashes, the answer is 'yes'.
    Note: On some video files, you may see the message below:
    H.264 detected: If the file is using B-Frames as reference it can lead to a crash or
    stuttering. Aveedmux can use another mode which is safe but YOU WILL LOSE FRAME
    ACCURACY. Do you want to use that mode?
    Choose No.
    ...
    Troubleshooting notes
    Error: Avidemux crashes during saving/conversion process
    Note: On some video files, you may see a message below: H.264 detected: If the file is
    using B-Frames as reference 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?
    Solution: Choose Yes this time
    We chose no the first time because we want to try for the most accurate conversion
    possible, with little to no loss of quality. Choosing yes may result in minor frame skips and
    video losing some synchronization with the audio.
    In summary, I think nobody actually knows the answer, or, I haven't found it by googling.

    So, it seems there is no clear answer to this question with regard to what it does to the audio sync.

    However, this is perhaps the simplest explanation of the avidemux flaw that I could find:
    AFAIK.
    H264 video uses I B(n) P frames, frame accurate cutting is not so simple.
    Cutting at I frames is simple. (possibly not frame accurate).
    Cutting at B & P frames requires re-encoding all B(n) & P frames back to previous I frame & new I frame to be placed at cut & re-encoding all Bs & P frames to the next I frame.
    I not sure AviDemux can do this properly..

    Indexing is required on variable bit rate & out-of order video encoding because..
    Video using IBP frames encodes the frames in different order to the presentation because Bs & P requires the I and the Bs require I & P.
    An index of I frames allows fast seeking..
    Some botched containers (like avi) use packed B frames so predicting/calculating framerates/indexes is problematic.
    In the end, I think everyone just guesses at the answer, and then assumes that their method is the one to use. I'll be no different; from now on, unless I learn otherwise, I'll simply say "no" to the H264 question and "yes" to the index question, and change my approach if the results turn out badly.
    Last edited by rocksockdoc; 29th Jul 2012 at 08:38.
    Quote Quote  
  13. Originally Posted by aedipuss View Post
    the only mistake that pops out is the output container(format). in avidemux you have to set that also. it should be mp4.
    In Avidemux, there are three MP4 format choices for the resulting video conversion:
    1. MPEG-4 AVC
    2. MPEG-4 ASP (Xvid)
    3. MPEG-4 ASP (mpeg4)

    None are listed as "mp4".

    Which would you suggest I use?
    Quote Quote  



Similar Threads

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