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):
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).... 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....
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:
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.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....
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?
+ Reply to Thread
Results 1 to 13 of 13
-
Last edited by rocksockdoc; 28th Jul 2012 at 20:29.
-
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 -
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".Last edited by rocksockdoc; 28th Jul 2012 at 16:17.
-
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!Last edited by rocksockdoc; 28th Jul 2012 at 20:08.
-
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.)Last edited by rocksockdoc; 28th Jul 2012 at 16:41.
-
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.Last edited by rocksockdoc; 28th Jul 2012 at 20:11.
-
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. -
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?
(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?)
Last edited by rocksockdoc; 28th Jul 2012 at 20:42.
-
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 ?
(i.e., could it have caused the sound to be a half second in front of the video?)Last edited by rocksockdoc; 28th Jul 2012 at 20:47.
-
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
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
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.
-
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\".
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.
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.Last edited by rocksockdoc; 29th Jul 2012 at 08:38.
-
Similar Threads
-
How to convert frame sequential 3D to side by side 3D ?
By nutzito in forum Video ConversionReplies: 38Last Post: 5th Feb 2013, 13:08 -
Player to play 2 separate videos side by side for 3D effect ?
By andy15star in forum Software PlayingReplies: 9Last Post: 21st Jan 2012, 12:52 -
How Create ACHD side by side compatible with Panasonic 3D Cam and HDTV?
By castana in forum Video ConversionReplies: 7Last Post: 25th Jul 2011, 15:47 -
Is the panasonic dmres46v a seudo svhs side-by-side player/recorder?
By yoda313 in forum RestorationReplies: 8Last Post: 17th May 2010, 08:09 -
combine 2 avi(s) into 1 side-by-side?
By dome in forum EditingReplies: 1Last Post: 22nd Oct 2008, 09:51