VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member
    Join Date
    Jun 2010
    Location
    Switzerland
    Search PM
    I'm trying to cut some commercials in some h264 avi files. Sometimes the P frames aren't exactly at the beginning of the commercial part, so I cut and reencode the surrounding part (using avidemux). This way I limit the quality loss to this part.

    Then I rejoin the avi files using mencoder. The resulting video looks fine, at least up to mplayer SVN-r29796-4.4.3.
    But with mplayer SVN-r30554-4.4.3, the reencoded parts of the video play with a different aspect ratio than the rest (not reencoded), i.e. mplayer changes the aspect ratio during the playback.

    Since I don't want to reencode all my files, I'm searching for a method to get rid of the aspect ratios stored in the files.
    Code:
    mencoder -ovc copy -oac copy -force-avi-aspect 16:9 -o outfile infile
    doesnt help, even if I split the avi, apply this command to each segment and rejoin it.
    The funny thing is that i can set the correct aspect ratio for each single segment. But after joining them, their "original" / wrong aspect ratios come back.

    Is somebody familiar with this behaviour?
    Quote Quote  
  2. Member ricardouk's Avatar
    Join Date
    Mar 2005
    Location
    Portugal
    Search Comp PM
    i think you can change aspect ratio after with MPEG4 Modifier

    have you tried removing the force-avi-aspect 16:9 from the script and let mencoder do that on its own, i think it detects aspect ratio, fps, resolution without the user specifying it.

    try another player that doesnt use mplayer, mpc-hc or vlc
    I love it when a plan comes together!
    Quote Quote  
  3. Member
    Join Date
    Jun 2010
    Location
    Switzerland
    Search PM
    Thanks for your reply!
    i think you can change aspect ratio after with MPEG4 Modifier
    I can't test MPEG4 Modifier since I have to create a mp4 first and my MP4Box reports that my raw videos are corrupt (importing them into a mkv file works).
    By the way: if I put the merged video in a mkv the same change of aspect ratio occurs (even if I first put all parts in different mkv with correct aspect ratio and then merge them).
    have you tried removing the force-avi-aspect 16:9 from the script and let mencoder do that on its own, i think it detects aspect ratio, fps, resolution without the user specifying it.
    Leaving out the -force-aspect-ratio option has no effect on the output file (at least mplayer keeps changing the aspect ratio).
    try another player that doesnt use mplayer, mpc-hc or vlc
    vlc doesn't change the aspect ratio. It plays the video in 4:3 if I leave it as an avi, but it plays it in 16:9 if I put it in a mkv container.
    Quote Quote  
  4. Member ricardouk's Avatar
    Join Date
    Mar 2005
    Location
    Portugal
    Search Comp PM
    Originally Posted by wipp View Post
    I can't test MPEG4 Modifier since I have to create a mp4 first
    you can open avi files with it

    I love it when a plan comes together!
    Quote Quote  
  5. Member ricardouk's Avatar
    Join Date
    Mar 2005
    Location
    Portugal
    Search Comp PM
    another solution would be to convert the commercials to DV and then use virtualdub to edit/join at will without reconverting.
    Code:
    ffmpeg -i video.mkv -target pal-dv video.dv
    1- convert each video to dv and put in a folder called DV
    2- cut edit each video from folder DV with virtualdub and save it again (without reconverting it) to folder EDITED
    3- join all dv files from folder EDITED with virtualdub and save it (no recompression) to Folder FINAL
    4- convert the video from the FINAL folder to avi with virtual dub
    Last edited by ricardouk; 28th Aug 2010 at 13:36.
    I love it when a plan comes together!
    Quote Quote  
  6. Member
    Join Date
    Jun 2010
    Location
    Switzerland
    Search PM
    OK, but with my file or with one segment, I get "This is not a valid MPEG-4 video (startcode not found at beginning of frame). Codec: H264."
    Quote Quote  
  7. Member ricardouk's Avatar
    Join Date
    Mar 2005
    Location
    Portugal
    Search Comp PM
    Originally Posted by wipp View Post
    so I cut and reencode the surrounding part (using avidemux). This way I limit the quality loss to this part.
    ah i thought you were converting to avi (xvid+mp3) i don't normally associate avi with h264...

    try to convert them to dv (minimal quality loss) and then edit/join with virtualdub and then convert the final dv to your favourite format, with the DV format you can cut and join without worrying about special keyframes.
    I love it when a plan comes together!
    Quote Quote  
  8. Member
    Join Date
    Jun 2010
    Location
    Switzerland
    Search PM
    OK, thanks. I'll give this a try.
    Quote Quote  



Similar Threads

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