VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member
    Join Date
    Aug 2009
    Location
    United States
    Search Comp PM
    Hi Everone,

    I am new to transcoding so I would greatly appreciate some feedback on my below 2-pass VOB->H264 ffmpeg commands. This is used to convert standard def movies in 16:9 and 4:3 (the 16:9 is hard-coded below but that is not usually the case) to MPGs for playback on my PS3. The source VOBs are raw uncompressed VOBs straight from the DVDs.

    Code:
    : Extract video and transcode to X264 in 2 Passes
    : --------------------------------------------------------------
    echo %date% %time% Starting Video Pass 1 >> %LOG%
    ffmpeg -i %SRCFILE% -pass 1 -passlogfile %TEMPFILE_PASSLOG% -an -vcodec libx264 -b 5000kb -minrate 5000kb -maxrate 5000kb -bufsize 224kb -s 720x480 -r 29.97 -aspect 16:9 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method epzs -subq 1 -trellis 0 -refs 1 -bf 3 -b_strategy 1 -threads 1 -level 41 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 4000kb -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 temp_video_1.mp4
    
    echo %date% %time% Starting Video Pass 2 >> %LOG%
    ffmpeg -i %SRCFILE% -pass 2 -title %TITLE% -an -f mp4 -vcodec libx264 -b 5000kb -minrate 5000kb -maxrate 5000kb -bufsize 224kb -s 720x480 -r 29.97 -aspect 16:9 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me_method umh -subq 5 -trellis 2 -refs 5 -bf 3 -b_strategy 1 -threads 1 -level 41 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 4000kb -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 temp_video_2.mp4
    Two things I am concerned with are:
    1. When I seek very far into one of these converted MPGs it takes a LONG time (35-45s) for the video to resume playback. I noticed that this doesn't happen when I use a lower encoding bitrate (1500kb) instead of the 5000kb I have below. Can I add more reference frames to the above encoding commands to help with this? Can you give me an example?
    2. Is 5000kb too high a bitrate to encode the video? I am noticing that the resulting MPGs are about 800MB to 1GB smaller than the original VOBs. I mean if that is the only savings I am getting should I just stick with the original VOBs and not bother transcoding them? If I use anything around 4500KB or below the video doesn't look nearly as good as the DVD. Should I just get over it and expect that to happen since I am using a lossy compression codec? Can I still seek back and forth with VOBs?

    Any tips or critcism of my transcoding would be greatly appreciated! At this point I just want to learn more about transcoding and I feel like I could use some pushes in some more directions.

    If it helps I can post my full batch file (not much to it, parameter maintenance, AC3 audio extraction and muxing to MKV so I can then use mkv2vob to get my final MPG with 5.1 audio for PS3 playback).

    Thanks Very Much,
    Gloriosis
    Quote Quote  
  2. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    At a glance I'd say the main problem is that you're forcing constant bitrate encoding by specifying equal minimum and maximum bitrates. This prevents the encoder from optimally saving bits. Unless you have a very good reason for it, it usually makes sense to omit minimum bitrate altogether. Try some encodes like that and see what they look like and what size they are.

    Increasing keyframe frequency will help seeking, so you can play around with that. Just make sure of the relationship between -g and -keyint_min - I'm unsure whether libx264 allows for more than one I-frame in a GOP.

    VOBs contain MPG material. Many players play them directly or after you've renamed them to .mpg. If you have enough disc space, you can choose to skip all of the above .
    Quote Quote  
  3. Why don't you use a tool like Handbrake that's directly intended for your purpose? It would also save you from having to troubleshoot your x264 commandline.
    Quote Quote  
  4. Member
    Join Date
    Aug 2009
    Location
    United States
    Search Comp PM
    Thanks very much for the feedback.

    creamyhorror, I investigated a lot of tools such as Handbrake and I really wanted something that was command-line driven so I could batch process VOBs. This way I could rip DVDs all day at work while doing my actual work then transcode them at night. No biggie really -you're totally right the GUIs take a lot of the guesswork/troubleshooting out of the equation. For me I guess it's just fun to tinker.

    fvisagie, thanks for your insight into the command-line. Since posting I have been poking around on some 264 guides and found some better settings (including the bonehead maneuver of restricting by bitrate! Whoops...)

    Although, I have to admit since I am only getting a few hundred to 1GB worth of size savings at a cost of 3.5Mb/s I think I am just going to use the straight VOBs. Even though most of my collection are standard def the video degradation is bugging me just enough to say "Screw it -VOBs it is..."

    But, I am still going to tinker. Transcoding is very interesting especially when you get into device-specific stuff like iPhone etc.

    Can someone tell me why NO ONE seems to post their ffmpeg/x264/etc scripts anywhere? I know I know -now that I said that someone is going to point me to abunchofffmpegscripts.com or something. But, really I just don't get it.

    I think I might make some great command-lines for transcoding VOBs that are live-action, animated, etc so people can learn from them and tweak as needed.

    Thanks again and please feel free to post any more insights into my command-line. Soon I will post my full bat file.

    -Gloriosis
    Quote Quote  



Similar Threads

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