VideoHelp Forum




+ Reply to Thread
Results 1 to 17 of 17
  1. Member
    Join Date
    Mar 2015
    Location
    Australia
    Search PM
    I want to convert a 3D side by side video to Top and Bottom arrangement.
    Is there a quick and easy way to do this?
    I've been doing some googling, and it looks like AviSynth and VirtualDub might be able to get it done, but I've been having trouble actually achieving it.
    My source video is an h.264 MP4 file, so I've tried to install the FFMS2 plugin for AviSynth to load it up, but it hasn't worked so far, just thrown me a few different errors.

    I've never worked with AviSynth or VirtualDub before, so a noob-oriented step by step would be most helpful.
    Quote Quote  
  2. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    First off, I am no avisynth expert but as a general rule if you want help you must be somewhat more explicit.

    That is 'a few different errors' means zilch. You really need to write out what these errors say.

    It would not, theoretically, be difficult to achieve what you desire.

    1. You create two copies, with different names of your source video
    2. Load them in to avisynth
    3. Crop left pixels from video 1
    4. Crop right pixels from video 2
    5. Stack Vertical video 1,video 2

    Feed avisynth script into program such as vdub to write the new video file
    Quote Quote  
  3. Basic script:

    Code:
    ffVideoSource("filename.ext") # you'll need the ffmpeg source library, or use DirectShowSource() instead.
    left=Crop(0,0,width/2,height)
    right=Crop(width/2,0,width/2,height)
    StackVertical(left,right) # or right,left
    Quote Quote  
  4. Member
    Join Date
    Mar 2015
    Location
    Australia
    Search PM
    Originally Posted by DB83 View Post
    First off, I am no avisynth expert but as a general rule if you want help you must be somewhat more explicit.

    That is 'a few different errors' means zilch. You really need to write out what these errors say.

    It would not, theoretically, be difficult to achieve what you desire.

    1. You create two copies, with different names of your source video
    2. Load them in to avisynth
    3. Crop left pixels from video 1
    4. Crop right pixels from video 2
    5. Stack Vertical video 1,video 2

    Feed avisynth script into program such as vdub to write the new video file
    Thanks!
    Yeah, I knew I should be more specific about the error messages, but I was about to leave for the weekend and didn't have time to try it again and record the exact wording.
    Thanks for writing up the basic plan of action too.
    Is it necessary to create two copies of the video to start with though? I'd have thought I could just load it twice into two different variables or something.
    Anyway, I see that someone has provided a script too, so I'll check that out and report back.

    Originally Posted by jagabo View Post
    Basic script:

    Code:
    ffVideoSource("filename.ext") # you'll need the ffmpeg source library, or use DirectShowSource() instead.
    left=Crop(0,0,width/2,height)
    right=Crop(width/2,0,width/2,height)
    StackVertical(left,right) # or right,left
    Thanks, that looks like it should do exactly what I want.
    I'm still a bit unsure about how to install the ffmpeg source library though.
    I'll give it a go and report back if I have problems.


    Edit:
    I was getting all kinds of problems with Virtual Dub, so I decided to remove it entirely and install it with the VirtualDubAIO installer that I found linked on this forum.

    With that done, the script works exactly as I want it to, so kudos to jagabo for that!
    Now I just need to figure out how to save it back as an MP4 file after converting.

    Here's the media information as given by avidemux and VLC for the original file.
    https://drive.google.com/file/d/0Bwn-F1yXFEVHWC1WMFdFb1BDUkk/view?usp=sharing
    https://drive.google.com/file/d/0Bwn-F1yXFEVHbHFHcS1CVkFNMGs/view?usp=sharing

    Does VirtualDub only output to plain AVI files, or is there a way to make it save the converted movie back in the same MP4 structure as the original?

    Edit:
    I found video compression options under Video>Compression unsurprisingly, and there's an x264 option in there, but I've got no idea what settings to configure it with to get it to match the quality of the original video.

    Also, will the sound from the original video survive this conversion or is that something I need to add to the script to bring the audio along with the video?
    Last edited by spiritofcat; 22nd Mar 2015 at 00:35.
    Quote Quote  
  5. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    vdub only saves as avi, The compression settings just affect the codec within the avi container.

    To mux that avi in to a .mp4 container with no additional compression you could use avidemux with copy for video and audio and mp4 as the output format.

    I suspect that there are utilites that can load a avisynth script and directly output to mp4. My brain is rather mushed right now to think of one.

    A little curious though why you should want to do this transformation. Could you enlighten me ?
    Quote Quote  
  6. The AviSynth Script can be loaded into AviUtl (WinXP/Win7 version) and directly encode to MP4 or MKV
    Stopping development until someone save me from poverty or get me out of Hong Kong...
    Twitter @MaverickTse
    Quote Quote  
  7. Member
    Join Date
    Mar 2015
    Location
    Australia
    Search PM
    Originally Posted by DB83 View Post
    A little curious though why you should want to do this transformation. Could you enlighten me ?
    I have a 180 degree stereoscopic video that was made for viewing on Oculus Rift, and I want to view it in my Gear VR through the app called Milk VR.
    Milk VR only officially supports full 360 degree videos though, but it can load 180 degree videos if they're in the top and bottom configuration, just not the side by side.

    Originally Posted by MaverickTse View Post
    The AviSynth Script can be loaded into AviUtl (WinXP/Win7 version) and directly encode to MP4 or MKV
    Thanks, I'll check that out.
    Quote Quote  
  8. You can play AviSynth scripts with many media players. So you may not need to recompress.
    Quote Quote  
  9. Member
    Join Date
    Mar 2015
    Location
    Australia
    Search PM
    Originally Posted by jagabo View Post
    You can play AviSynth scripts with many media players. So you may not need to recompress.
    Yeah, I need an actual mp4 file in a particular location on my phone's internal storage for it to be read by the Milk VR app in the Gear VR.
    Quote Quote  
  10. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    It's likely to be more complicated than that.

    The phone/app will expect a certain format - dimensions, codec etc.
    Quote Quote  
  11. Member
    Join Date
    Mar 2015
    Location
    Australia
    Search PM
    Originally Posted by MaverickTse View Post
    The AviSynth Script can be loaded into AviUtl (WinXP/Win7 version) and directly encode to MP4 or MKV
    That program seems not to like working with files larger than 1920x1080


    Originally Posted by DB83 View Post
    It's likely to be more complicated than that.

    The phone/app will expect a certain format - dimensions, codec etc.
    Yeah, it wants it like this:

    Current low quality format:
    Codec: h.264
    Profile: Baseline
    Bitrate: 5400-6000Kbps
    Level 4.1

    High quality format:
    Codec: h.264
    Profile: Baseline
    Bitrate: 20,000Kbps
    Level 4.1

    I'm going to test it with a small section of the original video first, just a minute or so worth, and if it plays correctly, then I'll convert the whole 20 minute video.
    Last edited by spiritofcat; 22nd Mar 2015 at 20:55.
    Quote Quote  
  12. Originally Posted by spiritofcat View Post
    Originally Posted by MaverickTse View Post
    The AviSynth Script can be loaded into AviUtl (WinXP/Win7 version) and directly encode to MP4 or MKV
    That program seems not to like working with files larger than 1920x1080


    File> SETTINGS > System >
    Then change the Max Resolution fields
    Stopping development until someone save me from poverty or get me out of Hong Kong...
    Twitter @MaverickTse
    Quote Quote  
  13. Member
    Join Date
    Mar 2015
    Location
    Australia
    Search PM
    Originally Posted by MaverickTse View Post
    Originally Posted by spiritofcat View Post
    Originally Posted by MaverickTse View Post
    The AviSynth Script can be loaded into AviUtl (WinXP/Win7 version) and directly encode to MP4 or MKV
    That program seems not to like working with files larger than 1920x1080


    File> SETTINGS > System >
    Then change the Max Resolution fields
    Yeah, I did that, then it crashed.

    It's okay, I've got an acceptable workflow with VirtualDub and AviDemux now.
    I've managed to convert the video and get it to play in Milk VR.
    Only remaining issue is that I've lost the Audio along the way.
    What's the easiest way to remedy that? Is there something I can add to the AviSynth script to bring the Audio along, or is there a simple way to copy it from the source video when muxing into the mp4 container with AviDemux at the end?

    I've tried changing FFVideoSource to FFMpegSource2 in the AviSynth script, but it didn't seem to work.

    VirtualDub just says "Unable to open file" when I try to load those versions of the script.

    I tried running the script into Windows Media Player instead and that gave me a video of some red text saying "Script error: ffvideosource does not have a named argument "pp" (ffms2.avsi, line 35)"
    Last edited by spiritofcat; 22nd Mar 2015 at 22:43.
    Quote Quote  
  14. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    vdub processes the audio just like with video. You have to alter the compression to suite your requirements. Although 'Direct Stream Copy' should work ??

    Check the original with mediainfo and also the new version. I expect there are differences.
    Quote Quote  
  15. If you don't need to process the audio just mux the original audio with the new video with mp4muxer or yamb or ffmpeg.

    If you do need to process the audio you can use a sequence like:

    Code:
    A = FFAudioSource(X)
    V = FFVideoSource(X)
    AudioDub(V, A)
    For that to work you need to delete the index file created by prior use of ffvideosource() alone.

    Regarding ffmpegsource2() not working, did you include ffms2.avsi in AviSynth's plugins folder when you installed ffms2.dll? And as above, you may need to delete the previous index file.
    Last edited by jagabo; 23rd Mar 2015 at 06:09.
    Quote Quote  
  16. Member
    Join Date
    Mar 2015
    Location
    Australia
    Search PM
    Originally Posted by jagabo View Post
    If you don't need to process the audio just mux the original audio with the new video with mp4muxer or yamb or ffmpeg.

    If you do need to process the audio you can use a sequence like:

    Code:
    A = FFAudioSource(X)
    V = FFVideoSource(X)
    AudioDub(V, A)
    For that to work you need to delete the index file created by prior use of ffvideosource() alone.

    Regarding ffmpegsource2() not working, did you include ffms2.avsi in AviSynth's plugins folder when you installed ffms2.dll? And as above, you may need to delete the previous index file.
    Thanks. I don't need to process the audio, so I'll check out those muxing tools you linked.
    Quote Quote  



Similar Threads

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