Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 Encoder GUIs

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st March 2010, 12:51   #1  |  Link
D9JK
Registered User
 
Join Date: Feb 2010
Posts: 41
Batch encoding videos - Looking for a specific option

Hey all,

Hopefully this is the most suitable forum/subforum for this. If not, my bad, but I was recommended these forums when I asked this elsewhere.

I'll first explain a bit of background to my question, so please imagine the following:

1) you have several hundred video clips, from different sources
2) some videos are low-resolution, some are very high resolution
3) some videos are of muddy quality, some are super crisp
4) unfortunately only ~ 10% of those actually play in your brand new TV
5) the TV supports H264, so you want to re-encode all videos to that.
6) to minimize your work, you want either a "process entire directory"-option, or something similar
7) you don't want to neither increase filesize, nor sacrifice quality, at all

The problem is the last two points: you want the program to process a large number of videos, with minimum work to yourself, while neither increasing filesize, nor reducing quality.

Let's see our options.

Batch convert with constant bitrate? Not optimal, because:

- too high a bitrate, and the mud-quality videos grow in filesize
- too low a bitrate, and the detail in the high-quality videos is destroyed
- averaged bitrate? Muddy videos grow in size without any gain in quality, crisp videos degrade but you gain a bit of free space

Any better options, such as batch converting with constant target size, perhaps? That's not a good option either: just swap the "bitrate" with "target size" in the last list, and you'll see.

But, if I've understood correctly, here is an option that would be tailor-made for this job:

"[X] Batch convert: encode each video using its original bitrate"

Why? Because then each video, in my understanding, should remain very close to its original quality and filesize, after the H264-encoding is complete.

Of course the problem is, I haven't actually found any program with such an option. I've looked for it in VirtualDub, Avidemux, Handbrake, Megui, Bencos and Super, but no luck. Sure, they can all batch convert videos, but as explained above, unfortunately that's not enough this time.

Does such an option exist in any program?
Is there a better option that I may have missed?
If so, how would you approach this instead? Remember there are several hundred videos, so manual work isn't an option (at least not in my opinion!).


Thanks for any help. Cheers!
D9JK is offline   Reply With Quote
Old 1st March 2010, 14:19   #2  |  Link
7ekno
Guest
 
Posts: n/a
What's wrong with x264 and using --crf 18 (which is generally considered "transparent"), meaning no discernable difference between source and encode ...

As far as GUI goes, StaxRip and BENCOS probably have the best features ... just set all files to be encoded with --crf 18 ...

I doubt it would increase file size at all over the other types of far more inefficient encoders, but if it does, you can dial it back to --crf 19 or 20 ... considering your "Batch convert: encode each video using its original bitrate" method would force x264 to use the same bitrate as sources like MPEG-1, MPEG-2, MJPEG, DivX, MPEG-1, RM, etc - In MPEG-2's case that could be a factor of more than 2x overkill for x264 (transparency from MPEG-2 can almost be achieved at half the MPEG-2 bitrate, depending on source), and in MJPEG's case can be a factor of 4-6x overkill (wasting space and bits for nothing) ...

Quote:
Originally Posted by D9JK View Post
Why? Because then each video, in my understanding, should remain very close to its original quality and filesize, after the H264-encoding is complete.
One of the ADVANTAGES of H.264 and x264 in particular is that it's far more efficient at encoding than the other formats and DOES NOT REQUIRE the same bitrate to retain "quality" ...

If you really want inefficient encoding (when compared to x264), why not use the much faster MPEG-2/1?!? - that will require far more bitrate than x264 to maintain "quality", so your criteria of "same size" should be met ...

7ek

Last edited by 7ekno; 1st March 2010 at 15:32.
  Reply With Quote
Old 1st March 2010, 15:33   #3  |  Link
Inspector.Gadget
Registered User
 
Join Date: May 2008
Posts: 1,618
1) Avisynth Batch Scripter [DirectShowSource()...] -> BatchEnc + x264 [--crf 18 -o C:\path\file.mp4]

2) Batchenc + Nero AAC (if necessary) -> C:\path\file.m4a

3) Batchenc + mp4box -> C:\path\file_muxed.mp4
Inspector.Gadget is offline   Reply With Quote
Old 1st March 2010, 16:43   #4  |  Link
D9JK
Registered User
 
Join Date: Feb 2010
Posts: 41
Quote:
What's wrong with x264 and using --crf 18 (which is generally considered "transparent"), meaning no discernable difference between source and encode ...
Nothing, if it works, that's why I was asking for other options as well. I'm a bit new when it comes to H.264, so I'm willing to consider any useful advice.

Quote:
One of the ADVANTAGES of H.264 and x264 in particular is that it's far more efficient at encoding than the other formats and DOES NOT REQUIRE the same bitrate to retain "quality"
Yes, I'm aware of the fact that H.264/x264 is the most sophisticated and efficient encoder at the moment. Actually, I was first thinking of writing "encode at each video at half of its original bitrate" instead (if not even less), but decided to go with "original" just to be sure that it wouldn't derail the discussion. But point taken: I'll use CRF instead.

Anyway, hopefully I've understood this correctly: using "Constant rate factor" of 18 should produce lossless results (as far as can be perceived), without increasing the filesize. If so, it sounds like just the thing I was looking for. But in Bencos, the "constant rate factor"-option seems to be missing in the settings-tab. Did you mean enabling the option from command line instead, if that's even possible?

By the way, I know Avidemux has numerous advanced encoding options (including the CRF), but I couldn't figure out how to make it batch convert a directory, other than loading the files one by one using the job list. Are you more familiar with it, by any chance?

EDIT:

Nevermind the questions about Bencos/Avidemux. I just tried Staxrip, and it seems to the best program for this job. Thanks for your help.

Last edited by D9JK; 1st March 2010 at 17:35.
D9JK is offline   Reply With Quote
Old 2nd March 2010, 11:57   #5  |  Link
D9JK
Registered User
 
Join Date: Feb 2010
Posts: 41
Hey again. I'm getting an error in the middle of the processing, numerous times: "ffmpeg.exe has stopped working". The process of course pauses and I have to be constantly overseeing it so that it keeps going. Though, I doubt the files are even converted when it happens.

Am I doing something wrong, perhaps? What should I do to fix this?

This is in Windows 7, as it's my faster computer. In a pinch, I could use Windows Xp too.
D9JK is offline   Reply With Quote
Old 2nd March 2010, 12:12   #6  |  Link
7ekno
Guest
 
Posts: n/a
Quote:
Originally Posted by D9JK View Post
This is in Windows 7, as it's my faster computer. In a pinch, I could use Windows Xp too.
Used the direct show source filter fix for Windows 7?!?

What application is causing FFMPEG to crash?!? Which version of FFMEG?!?

We aint mind readers, the more detail you give on what you are doing to get the crash, the more help will be forthcoming

7ek
  Reply With Quote
Old 2nd March 2010, 13:00   #7  |  Link
D9JK
Registered User
 
Join Date: Feb 2010
Posts: 41
Sure, no problem.

1) I wasn't aware of the fix you mentioned, and didn't know I was going to need one when I started. But I'll search for it, unless you can post a link
2) The error appears when I'm batch processing the files using Staxrip. Apparently the processing of the current file has just finished, at which point the whole process pauses with the error message (but also resumes when I respond to the error message)
3) Well, the details of the error only claim that its version is "0.0.0.0". (I have installed the latest ffdshow-tryout, if that helps)

But perhaps the aforementioned fix will be enough to get rid of the problem.


By the way, two additional questions about Staxrip, if you/someone can answer:

1) I changed the "Source" from "Automatic" to "DirectShow", as the second poster mentioned it. Good move or bad move?
2) Let's assume I apply the fix and it works. If I restart the exact same job list I've currently been processing, is the batch processor smart enough to skip the jobs for which the target file (.MKV) already exists? Just asking in case the conversion has failed for only some videos, since there's no point to re-process those files that converted without problems.

Thanks.
D9JK is offline   Reply With Quote
Old 2nd March 2010, 21:45   #8  |  Link
RunningSkittle
Skittle
 
RunningSkittle's Avatar
 
Join Date: Mar 2008
Posts: 539
Save your self a headache and use ffmpegsource2 (ffms2) instead of directshow
RunningSkittle is offline   Reply With Quote
Old 2nd March 2010, 22:16   #9  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,799
Quote:
I changed the "Source" from "Automatic" to "DirectShow", as the second poster mentioned it. Good move or bad move?
It's better to use Automatic.

Quote:
If I restart the exact same job list I've currently been processing, is the batch processor smart enough to skip the jobs for which the target file (.MKV) already exists?
A job gets removed from the job list immediately after it was processed.
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More
stax76 is offline   Reply With Quote
Old 3rd March 2010, 00:46   #10  |  Link
D9JK
Registered User
 
Join Date: Feb 2010
Posts: 41
Quote:
A job gets removed from the job list immediately after it was processed.
Yes, but to be more precise, I meant re-creating an identical job list, and was asking if the program would then recognize when any target files already exist for the jobs at hand. From what I remember when first testing the program with several files, it said something along the lines that "target file already exists, perhaps because the conversion was successfully finished". If so, then I would think that it does in fact skip jobs already completed... which is good.

Anyway - even with "Source" set to Automatic, the ffmpeg.exe-crash still occurs. Not only in Windows 7, but in Windows XP as well. Unfortunately I haven't been able to find the fix 7ekno mentioned, so I'm waiting for more details on that. (meanwhile, I might as well try the advice RunningSkittle gave)

The crash may be audio-related, as the videos play on my TV, but without sound. Not that I'm sure of it... just a thought.
D9JK is offline   Reply With Quote
Old 3rd March 2010, 00:59   #11  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,799
It always overwrites files, there is a assistant warning you mentioned but assistant warnings aren't relevant when batch processing. Regarding a crash please mail the log file assuming you use the latest test version. In case a third party application crashes I need also a sample clip to reproduce the crash.
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More
stax76 is offline   Reply With Quote
Old 3rd March 2010, 10:53   #12  |  Link
D9JK
Registered User
 
Join Date: Feb 2010
Posts: 41
Just to be sure in case you missed it in my previous posts - it's not Staxrip crashing: it's ffmpeg.exe crashing while batch processing the files with Staxrip.

But if still relevant, I can provide the log file and a sample clip.
D9JK is offline   Reply With Quote
Old 3rd March 2010, 15:07   #13  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,799
Yes it's still relevant.
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More
stax76 is offline   Reply With Quote
Old 3rd March 2010, 15:59   #14  |  Link
D9JK
Registered User
 
Join Date: Feb 2010
Posts: 41
I've attached the log file. The filesize limitations of attachments are too strict on this forum for the video clip, so if you need it, I can email it instead.

Meanwhile, take a look at the log file. Go to the "Audio decoding"-part: immediately after the title, there are two identical lines. This is where the ffmpeg-crash occurred. As I mentioned a few posts back, the process will continue after confirming the error message, but the resulting video clip will be mute.

Maybe it helps, maybe it doesn't. But I can still send the video clip, if necessary.
Attached Files
File Type: zip Log file.zip (1.7 KB, 6 views)
D9JK is offline   Reply With Quote
Old 3rd March 2010, 16:10   #15  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,799
Please mail both or use a file hoster.
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More
stax76 is offline   Reply With Quote
Old 3rd March 2010, 16:25   #16  |  Link
D9JK
Registered User
 
Join Date: Feb 2010
Posts: 41
Your mail address can't be found in your profile, so I used a file hosting service instead.

Link.
D9JK is offline   Reply With Quote
Old 5th March 2010, 15:15   #17  |  Link
D9JK
Registered User
 
Join Date: Feb 2010
Posts: 41
Meanwhile, I've been processing some videos recorded with my Canon DSLR. It encodes the videos on-the-fly using H264, but I can save a significant amount of file space by recompressing them with Staxrip, without a visible loss in quality.

However, apparently the processed files are being set to use a frame rate of 25 per second, instead of the original 30 per second. This is making the finished video 20% longer, and causing audio/video desynchronisation (the audio playback finishes before the video track).

I've been searching through the various options in Staxrip, but haven't yet found a setting with which to prevent this (perhaps it's somewhere in the profile details, because 25 fps refers to the PAL system).
D9JK is offline   Reply With Quote
Old 5th March 2010, 15:34   #18  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,799
That's likely a bug, please upload a sample of that too.
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More
stax76 is offline   Reply With Quote
Old 5th March 2010, 16:03   #19  |  Link
D9JK
Registered User
 
Join Date: Feb 2010
Posts: 41
I've uploaded a short video clip and a log file:

Link.

If you either convert the video clip using Staxrip, or read the log file, you'll see that the input video has a frame rate of 30 per second, but the output file should end up with a frame rate of 25 per second. That is, unless you can adjust some option in Staxrip GUI that I couldn't find.
D9JK is offline   Reply With Quote
Old 5th March 2010, 16:17   #20  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,799
I don't see a problem with this file, the source frame rate is 30 so the output will also be 30. If you want something else you have to apply some filter.

http://staxrip.wikispaces.com/AviSynth+Filters

Regarding your other file, seems weird since mpg should be MPEG-2 Program Stream and this should not contain AVC and AAC, maybe it's a MP4 container, try to rename it to mp4. Looks it has wrong file extension and because of this it's not handled properly.
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More

Last edited by stax76; 5th March 2010 at 16:26.
stax76 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.