VideoHelp Forum
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. I'd like to take videos recorded with my Droid, join them together, and then upload them to YouTube as a single video.

    I'm having trouble in the "joining", and I know this has been brought up many times, but I haven't found any solutions and I'm hoping to get a little personalized help with this.

    Regardless of the camcorder app I use on my Droid, every video I record ends up with a different framerate. This, of course, prevents me from joining them together.

    I realize I need to first re-encode them to all have matching framerates. I have been using Prism video converter to do this because it uses a convenient context-menu option and can do the job in only a couple of clicks. However, last night when I did this, the first re-encoded video (avi) that I previewed had its video de-synced from the audio. Waste of time.

    Even if I can find a way to re-encode the videos properly so that they can THEN be joined together using another program, I would really like to find a way to get this all done in fewer steps... which leads me to asking a couple of questions.

    First, is there a program that I can use that will re-encode the videos and then join them automatically?

    If not, then what program would you recommend for re-encoding them?
    Quote Quote  
  2. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    the specs of a typical video would help. try mediainfo in text mode and copy/paste the results here. most likely it's recording vfr(variable frame rate) video, try to find an app that will record in cfr(constant frame rate).
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  3. Thanks for the quick response!

    Here's an output of an example video file's data via MediaInfo:
    http://www.vertigofx.com/temp/video_help_example.html


    Also, I've already searched for an app that records with constant frame rate. So far I haven't found one. I've also posted about it on droidforums.net a couple of days ago and have so far not received any helpful responses.

    The camcorder app I use does allow me to choose H.263, H.264, MPEG4, or 'default' for the encoder (not sure what 'default' is), and lets me set either 3GPP or MP4 as the format/(container?). The app also has options for setting desired framerate but as far as I can tell, all that seems to do is let me choose the 'max' framerate of the video. I still end up with VFR videos.
    Quote Quote  
  4. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by vertigoelectric View Post
    First, is there a program that I can use that will re-encode the videos and then join them automatically?
    Hi
    What about trying MEncoder to re-encode and join them in one pass.
    Something like this:-
    Code:
    mencoder file1.mp4 file2.mp4 file3.mp4 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1800 -oac mp3lame -lameopts cbr:br=128 -o joined.avi
    EDIT
    Upload 3 samples if you want me to try it for you.
    Last edited by bat999; 15th Mar 2012 at 15:40.
    Quote Quote  
  5. Very cool. I got MEncoder and I'm running it on 3 of my MP4 files right now. I'll be very happy if this works flawlessly. I just used the settings you provided in your example. So far it appears to be working, so I guess we'll see.

    If this works, then I might be able to automate almost the entire process using a batch file and/or AHK. All I'd have to do is drop the video files in a folder and run the script. Boom. Done. I sure hope it works!
    Quote Quote  
  6. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by vertigoelectric View Post
    I got MEncoder and I'm running it on 3 of my MP4 files right now.

    ..If this works
    If it does work, there's another command to try with x264/aac in mp4 container, instead of the mpeg4/mp3 in avi container.
    Let me know.
    Quote Quote  
  7. Thanks for your continued help. Also, thumbs up on the demonoid avatar XD

    Well, it did join them together, and for the most part, it looked like the audio/video was in sync (hard to tell, since in my videos I was mostly talking in the dark). However, I did notice that occasionally it would seem to 'cut off' what I was saying, almost as if it was about to go out of sync but instead jumped ahead in the audio to keep things on track. I also noticed several lines during the MEncoding process that said something about frames missing. I'll get a screen shot next time.

    I'll also make a small series of test videos, and if you're still willing, I'd like to take you up on your offer and send them to you so that you can work out the optimal command line options for MEncoder for me. I could probably figure out the best settings for myself, but if you're already experienced with this then it would probably be much easier and faster for you. It would take me a long time.

    I'll post again later today after I've had a chance to create the test videos and stuff.

    Thanks again!
    Quote Quote  
  8. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by vertigoelectric View Post
    I'll also make a small series of test videos, and if you're still willing, I'd like to take you up on your offer and send them to you so that you can work out the optimal command line options for MEncoder for me.
    Yes, that's OK.
    Quote Quote  
  9. Okay. I created 3 test videos. All I did was play some movies on my computer and record the screen with my phone (so they look/sound crappy, but all we're really testing for is audio/video synchronization). The three videos are here: http://www.vertigofx.com/public/video/videohelptemp/

    This morning I tried joining some videos together again using your MEncode command line, but it was a lot worse this time. It was blatantly out of sync (if that makes sense). The video played much faster than the audio, at least during the first segment.

    I hope you can figure this out for me. That would be great.

    I've also created an AHK script that runs from the same folder as the video files. It automatically finds the MP4 files in that folder and generates the MEncode command line for processing the videos and runs it. If you're absolutely unable to get the videos to reencode and merge properly with a single command line, I can use the AHK script to reencode them first and then automatically run a joining command afterward without any additional user interaction.

    I'm anxious to see what you come up with, though. Thanks again for the help!
    Quote Quote  
  10. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Hi
    MEncoder doesn't seem to work joining these vfr sample files.
    I think that you need to convert them to cfr before you try to join them.

    Google says Avisynth can do it, but I'm not familiar with that software.
    It's for Windows.
    Maybe there are others on the forum with this knowledge.

    To join cfr files.
    In an ideal world MEncoder can do it without re-encoding.
    Like this:-
    Code:
    mencoder file1 file2 file3 -ovc copy -oac copy -o joined.avi
    But if you do need to re-encode...
    This command gives MPEG-4 and aac in mp4 container:-
    Code:
    mencoder file1 file2 file3 -of lavf -ovc lavc -lavcopts  vcodec=mpeg4:vbitrate=1800 -oac lavc -lavcopts  aglobal=1:acodec=libfaac:abitrate=64 -o joined.mp4
    I got those sample files converted to cfr using an online converter website.
    Then re-encoded and joined them with MEncoder.
    The result is here ---> http://www.mediafire.com/?y7uz4n60naimbb2
    Last edited by bat999; 17th Mar 2012 at 21:12.
    Quote Quote  
  11. Thank you so much for trying.

    Hmmmm... can MEncode convert the files to CFR? If it can, I can write my script so that it automatically converts the individual files and then afterward run the command to join them.
    Quote Quote  
  12. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by vertigoelectric View Post
    Hmmmm... can MEncode convert the files to CFR?
    Hi
    Maybe it can...
    but I don't know how to do that.
    Quote Quote  
  13. Dang it. Well, I'm trying to figure out a way to get AviSynth to do it via command line, but I'm not having much success. Since you are more experienced with MEncoder than I am, would you help me find a way to convert VFR to CFR with it?
    Quote Quote  
  14. Well, I'm getting really frustrated. As with most things I try to do that should be simple, I run into problems in every direction.

    I can't find any way to join the videos properly because they're all VFR.

    I can't find any way to efficiently convert the videos from VFR to CFR in order to join them.

    I can't find any way to record the original videos in CFR in the first place.

    This is ridiculous.
    Quote Quote  
  15. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Hi
    I've had another look at this.
    With latest version of FFmpeg from here --> http://ffmpeg.zeranoe.com/builds/

    Make three temporary cfr files with FFmpeg:-

    Code:
    ffmpeg -i sample01.mp4 -c:v mpeg4 -b:v 1800k -c:a copy -vsync 1 -r 25 temp01.mp4
    Code:
    ffmpeg -i sample02.mp4 -c:v mpeg4 -b:v 1800k -c:a copy -vsync 1 -r 25 temp02.mp4
    Code:
    ffmpeg -i sample03.mp4 -c:v mpeg4 -b:v 1800k -c:a copy -vsync 1 -r 25 temp03.mp4
    Join them with MEncoder:-

    Code:
    mencoder temp01.mp4 temp02.mp4 temp03.mp4 -of lavf -ovc copy -oac lavc -lavcopts aglobal=1:acodec=libfaac:abitrate=64 -o joined2.mp4
    Result is here ---> http://www.mediafire.com/?t4h2yol2zeubll8

    Code:
    General
    Complete name             : joined2.mp4
    Format                    : MPEG-4
    Format profile            : Base Media
    Codec ID                  : isom
    File size                 : 47.0 MiB
    Duration                  : 3mn 31s
    Overall bit rate mode     : Variable
    Overall bit rate          : 1 862 Kbps
    
    Video
    ID                        : 1
    Format                    : MPEG-4 Visual
    Format profile            : Simple@L1
    Format settings, BVOP     : No
    Format settings, QPel     : No
    Format settings, GMC      : No warppoints
    Format settings, Matrix   : Default (H.263)
    Codec ID                  : 20
    Duration                  : 3mn 31s
    Bit rate mode             : Variable
    Bit rate                  : 1 811 Kbps
    Width                     : 1 280 pixels
    Height                    : 720 pixels
    Display aspect ratio      : 16:9
    Frame rate mode           : Constant
    Frame rate                : 25.000 fps
    Color space               : YUV
    Chroma subsampling        : 4:2:0
    Bit depth                 : 8 bits
    Scan type                 : Progressive
    Compression mode          : Lossy
    Bits/(Pixel*Frame)        : 0.079
    Stream size               : 45.7 MiB (97%)
    Writing library           : Lavc54.10.100
    
    Audio
    ID                        : 2
    Format                    : AAC
    Format/Info               : Advanced Audio Codec
    Format profile            : LC
    Codec ID                  : 40
    Duration                  : 3mn 31s
    Bit rate mode             : Variable
    Bit rate                  : 48.0 Kbps
    Channel(s)                : 2 channels
    Channel positions         : Front: L R
    Sampling rate             : 48.0 KHz
    Compression mode          : Lossy
    Stream size               : 1.18 MiB (3%)
    Quote Quote  
  16. GENIUS! Thank you so much! This seems to work perfectly! I considered using ffmpeg but I didn't know the command parameters or where to get it. Your example helps a lot.

    I've already written my AHK script. All I have to do is drop my video files into the folder and run the script. First it loops through the files and runs the ffmpeg command on each one, creating temporary files. After it's finished with that, it automatically uses MEncode to join them together and then deletes the temporary files. The whole process couldn't get any easier. It's also fast, since I currently have it set up to run ffmpeg on the files all at the same time.

    With the sample videos I shared with you, this seems to work great so far. I'll let you know if I run into any problems later. Thank you so very, very much!
    Quote Quote  



Similar Threads

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