# What settings when converting video

1. Originally Posted by davexnet
Originally Posted by jackdup

I found where to change the default to mp4, thank you. Is there any difference in these two or just the extension, in other words could you change the extension of an existing m4v to mp4 without any issues?
yes

Originally Posted by jackdup
As I mentioned in my original post I have numerous jobs I want to do and had hoped I could find one program which I could learn to use proficently. I bought a new Samsung TV which no longer plays avi files like my old Samsung did so have a large number of video files on a NAS drive I need to convert. While I want to maintain as much quality as reasonably possible I don't want to spend a bunch of time converting these and a slight quality loss is not a big deal as they are TV shows and movies. I also have a fairly large library of videos from a camcorder of kids and grandkids, family vacations, weddings etc etc so these I want to maintain as much quality as possible or perhaps even upscale some. I do have quite a bit in HD from a camcorder as well which I want to rip and put on my NAS drive so I can watch them from anywhere and don't always have to dig for the SD cards. These again I would want to maintain the quality. I also have some commercial Blu-Ray and DVDs that again want to rip to my NAS drive and keep as much quality as possible but again don't want to spend a ton of time.

Perhaps I am being unreasonable in expecting I can get one program to perform all of these jobs. I had previously purchased Aimersoft and find it isn't too bad but does not do as good of a job of cropping as Handbrake does.
There's not really one size fits all, it's best if you take it case by case. When you have a particular project in mind,
open a new thread and people will help

Does your new TV play MKV files? If so open the Mkvtoolnix GUI and re-wrap one of your avi files
into MKV and see if the TV will play it.
My LG TV works this way, it has no problem with Xvid/Divx/mp3 inside an MKV
It will play MKV but it is slower to load for some reason and the controls for fast forward or rewind do not work the same way as for mp4 which again sounds odd but that is the way it is. so would prefer mp4 files.

Right now I have a TV series I am ripping from DVD and following that will convert all the avi files I have. Once that is done I may start with some of the HD camcorder videos I have and can post again then for some guidance but for now ripping this one TV series and converting the avi files is at the top of the list.

Thank you
2. Originally Posted by jagabo
Originally Posted by jackdup
I found where to change the default to mp4, thank you. Is there any difference in these two or just the extension, in other words could you change the extension of an existing m4v to mp4 without any issues?
As I understand it... When Apple finally added AC3 audio to their MP4 videos they needed a way to differentiate the files so older devices didn't try to play the new files. That's where M4V was born. The choice of extension was unfortunate since M4V was already used form MPEG 4 elementary video streams. But Apple gets to do whatever they wants.

Originally Posted by jackdup
I bought a new Samsung TV which no longer plays avi files like my old Samsung did so have a large number of video files on a NAS drive I need to convert. While I want to maintain as much quality as reasonably possible I don't want to spend a bunch of time converting these and a slight quality loss is not a big deal
They can probably be remuxed into MKV or MP4. This would take very little time and there would be no quality loss. AviDemux is probably adequate for this. Open the source file, set video and audio to COPY, set the output container. Save.* Or you could use an ffmpeg batch file to remux an entire folder of AVI files at once.

* I just ran a test: a 600 MB AVI file (Xvid video, AC3 audio) was remuxed by AviDemux to a 600 MB MP4 file in about 2 seconds.
That sounds perfect for what I want to do. Can you do an entire folder with AviDemux as well or would you have to use ffmpeg?

Thank you
3. There are programs in the software section of this site that may help
MKVToolnix - rewrap almost anything to MKV (no re-encoding)
MP4Box Gui - rewrap most things to mp4 (no re-encoding)
MKVtoMP4 - quick MKV to MP4 container switch (only re-encodes audio under certain circumstances, otherwise no re-encode)

Perhaps you should try them
4. Originally Posted by jackdup
it seemed to me the bitrate of the source is relevant as using a higher bitrate that the source will only give you a larger output file with no improvement in quality.
I quite clearly stated that every time you reencode a video with a lossy codec you will lose quality. But the more bitrate you use the less those losses will be. Say, for example, reencoding at the same bitrate loses 5 percent of the quality. Reencoding at twice the bitrate may lose only 2 percent of the quality.

Beyond that, different codec families require different bitrates to retain quality. For example, if you were reencoding an h.264 video with MPEG 2, you might need 4 times as much bitrate to come close to the same quality. Even different encoders of the same family require different bitrates. For example Intel's Quick Sync h.264 encoder may require 50 percent or more bitrate than x264 to deliver similar quality -- even though they are both h.264 (MPEG 4 Part 10, aka AVC) encoders.
5. Originally Posted by jagabo
Originally Posted by jackdup
I have either been misinformed or misunderstood as I was under the impression that that the output file cannot be better quality than the input or source aside from perhaps cleaning up noise or artifacts so it would seem setting a higher CRF or bitrate than the original source would just be creating a larger file size without any improvement in quality but as I say perhaps I am wrong.
You are wrong. Every time you reencode a video with a lossy codec you will lose quality. Even if you use 2 or 5 or 10 times the bitrate.

Originally Posted by jackdup
It would seem the RF in Handbrake must be tied to the presets in some way
The relationship between preset, CRF, and bitrate is complex and varies from video to video. In general, slower presets deliver better quality -- the encoder works harder to find better ways to compress the video. At ultrafast and superfast you get very high bitrates (these are used mostly for real time compression when capturing where your primary concern is speed). From veryfast to placebo the bitrate doesn't decrease linearly (it can vary up and down) or by much (typically around 10 percent).
Ultrafast and Superfast have a higher bitrate? I thought the faster the encoding or reencoding went the lower the quality?
6. Originally Posted by jackdup
Ultrafast and Superfast have a higher bitrate? I thought the faster the encoding or reencoding went the lower the quality?
Video compression isn't one single thing. It's a collection of methods. Some are very fast but don't compress much. Others can compress much more (and more accurately) but take longer to do so. x264's ultrafast preset uses only the fastest, least effective compression methods. As you move to slower presets slower and more effective methods are used.
7. Originally Posted by jagabo
Originally Posted by jackdup
Ultrafast and Superfast have a higher bitrate? I thought the faster the encoding or reencoding went the lower the quality?
Video compression isn't one single thing. It's a collection of methods. Some are very fast but don't compress much. Others can compress much more (and more accurately) but take longer to do so. x264's ultrafast preset uses only the fastest, least effective compression methods. As you move to slower presets slower and more effective methods are used.
Are you referring to the presets in Handbrake? Is that what you would recommend for ripping from a Blu-Ray or DVD? I am not really worried about compression only want a format compatible with my new TV.

Also you had mentioned AviDemux for converting my AVIs. will this do a whole folder or do you have to load the files individually? What do you think of MP4Box.GUI Davexnet mentioned?
Thanks again
8. Originally Posted by davexnet
There are programs in the software section of this site that may help
MKVToolnix - rewrap almost anything to MKV (no re-encoding)
MP4Box Gui - rewrap most things to mp4 (no re-encoding)
MKVtoMP4 - quick MKV to MP4 container switch (only re-encodes audio under certain circumstances, otherwise no re-encode)

Perhaps you should try them
Thank you
9. Originally Posted by jagabo
Originally Posted by jackdup
I found where to change the default to mp4, thank you. Is there any difference in these two or just the extension, in other words could you change the extension of an existing m4v to mp4 without any issues?
As I understand it... When Apple finally added AC3 audio to their MP4 videos they needed a way to differentiate the files so older devices didn't try to play the new files. That's where M4V was born. The choice of extension was unfortunate since M4V was already used form MPEG 4 elementary video streams. But Apple gets to do whatever they wants.

Originally Posted by jackdup
I bought a new Samsung TV which no longer plays avi files like my old Samsung did so have a large number of video files on a NAS drive I need to convert. While I want to maintain as much quality as reasonably possible I don't want to spend a bunch of time converting these and a slight quality loss is not a big deal
They can probably be remuxed into MKV or MP4. This would take very little time and there would be no quality loss. AviDemux is probably adequate for this. Open the source file, set video and audio to COPY, set the output container. Save.* Or you could use an ffmpeg batch file to remux an entire folder of AVI files at once.

* I just ran a test: a 600 MB AVI file (Xvid video, AC3 audio) was remuxed by AviDemux to a 600 MB MP4 file in about 2 seconds.
Sorry I have been away for so long. I would love to use a batch process and do an entire folder at a time. I downloaded ffmpeg but when I ran the program I got what appeared to be a dos window flash on the screen and then nothing so am obviously not doing something. Does it install like most programs or is it a command line type program? Any assistance in running it to convert entire folders at a time would be much appreciated.

Thank you
10. Originally Posted by jackdup
I would love to use a batch process and do an entire folder at a time. I downloaded ffmpeg but when I ran the program I got what appeared to be a dos window flash on the screen and then nothing so am obviously not doing something. Does it install like most programs or is it a command line type program? Any assistance in running it to convert entire folders at a time would be much appreciated.
ffmpeg is a command line program. You can use it in a batch file to remux all AVI files in a folder to MP4. Put a copy of the following text in a batch file, in the same folder as the AVI files you want to remux. You can use Notepad to create the file, just be sure to save with the extension .BAT, not .TXT.

Code:
for %%F in ("*.avi") do ( ffmpeg -i "%%~nxF" -c copy "%%~nF.mp4" )
pause
Put a copy of ffmpeg.exe in "C:\Windows\Windows32", or use the full path name to wherever ffmpeg.exe is installed on your computer:

Code:
for %%F in ("*.avi") do ( "G:\Program Files\ffmpeg\bin\ffmpeg.exe" -i "%%~nxF" -c copy "%%~nF.mp4" )
pause
Double clicking on that BAT file in Explorer will remux all the AVI files in that folder to MP4. Beware that some codecs used in AVI may not be accepted in MP4. So check the resulting filfes. Xvid/Divx and MP3/AC3 should be fine.

The "pause" on the second line is to leave the CMD window open when the process is done -- so you can see if there are any error messages.
11. Beware that some codecs used in AVI may not be accepted in MP4. So check the resulting filfes. Xvid/Divx and MP3/AC3 should be fine.
If there is codecs in some of the AVI files that are not accepted does it just leave them as is or does it remux and make them unusable?

Thanks very much for your help.
12. Originally Posted by jackdup
Beware that some codecs used in AVI may not be accepted in MP4. So check the resulting filfes. Xvid/Divx and MP3/AC3 should be fine.
If there is codecs in some of the AVI files that are not accepted does it just leave them as is or does it remux and make them unusable?
The original AVI files will be untouched. If an MP4 file is created it will not contain the "bad" stream. So it may be missing the video or audio or both.
13. Originally Posted by jagabo
Originally Posted by jackdup
Beware that some codecs used in AVI may not be accepted in MP4. So check the resulting filfes. Xvid/Divx and MP3/AC3 should be fine.
If there is codecs in some of the AVI files that are not accepted does it just leave them as is or does it remux and make them unusable?
The original AVI files will be untouched. If an MP4 file is created it will not contain the "bad" stream. So it may be missing the video or audio or both.
Super, thanks again for your help, really appreciated.

14. [Attachment 53825 - Click to enlarge]
Originally Posted by jagabo
Originally Posted by jackdup
Beware that some codecs used in AVI may not be accepted in MP4. So check the resulting filfes. Xvid/Divx and MP3/AC3 should be fine.
If there is codecs in some of the AVI files that are not accepted does it just leave them as is or does it remux and make them unusable?
The original AVI files will be untouched. If an MP4 file is created it will not contain the "bad" stream. So it may be missing the video or audio or both.
Does the ffmpeg generally take quite a bit longer than the AviDemux? The AviDemux was quite fast where the ffmpeg is taking roughy3-6 minutes per video and most files are under 200MB. I am fine with that as I don't have to babysit or load each file individually but just wondered if that is normal?

Here is a screen capture of the messages that scroll as it is doing each file and there are a long list for each file but the new file seems to play fine.
Thanks
15. Originally Posted by jackdup
Originally Posted by jagabo
Originally Posted by jackdup
Beware that some codecs used in AVI may not be accepted in MP4. So check the resulting filfes. Xvid/Divx and MP3/AC3 should be fine.
If there is codecs in some of the AVI files that are not accepted does it just leave them as is or does it remux and make them unusable?
The original AVI files will be untouched. If an MP4 file is created it will not contain the "bad" stream. So it may be missing the video or audio or both.
Does the ffmpeg generally take quite a bit longer than the AviDemux? The AviDemux was quite fast where the ffmpeg is taking roughy3-6 minutes per video and most files are under 200MB. I am fine with that as I don't have to babysit or load each file individually but just wondered if that is normal?
Thanks
I tried this myself with some old xvid/mp3 avi files. It seems as if ffmpeg doesn't properly support the packed "B' frames in the avi.
The conversion takes longer, and you can see stuttering in the output file during scenes with movement. Perhaps you
should check the files
Perhaps jagabo will respond, there was a thread in the last few months where something similar came up
16. Earlier I tried it with some xvid/mp3 avi files (480x360, 29.97 fps, 22 minutes, ~200 MB) and the files remuxed nearly instantaneously. There were no problems. Looking at the videos showed they used only I and P frames. No B frames, so no packed bitstream.

I found an Xvid AVI with packed bitstream -- I see the same "pts has no value" error messages and slow processing. It's the display of all those error messages that is causing the slowdown. You can avoid that by setting the log level to panic. Might as well eliminate the banner message too:

Code:
for %%F in ("*.avi") do ( ffmpeg -hide_banner -loglevel panic -i "%%~nxF" -c copy "%%~nF.mp4" )
But I found the resulting mp4 file was jerky in some players. MPCHC was jerky, VLC wasn't. So I looked for another fix. I found you can unpack the packed bitstream (-bsf:v mpeg4_unpack_bframes) and generate new timecodes (-fflags +genpts). But I couldn't get a file that played smoothly in both players. So finally I tried a two step process AVI to new AVI with unpacked bitstream, then new AVI to MP4 with new timecodes. That gave a video that played smoothly in both MPCHC and VLC.

Code:
for %%F in ("*.avi") do (
ffmpeg -y -fflags +genpts -i "%%~nxF" -c copy -bsf:v mpeg4_unpack_bframes "%%~nF.temp.avi"
ffmpeg -y -fflags +genpts -i "%%~nF.temp.avi" -c copy -bsf:v mpeg4_unpack_bframes "%%~nF.mp4"
del "%%~nF.temp.avi"
)
The two step conversion is wasteful with AVI files without packed bitstream but the resulting mp4 files play ok.

Note I added the -y flag to prevent the program asking if you want to overwrite existing files.
17. I tried this myself with some old xvid/mp3 avi files. It seems as if ffmpeg doesn't properly support the packed "B' frames in the avi.
The conversion takes longer, and you can see stuttering in the output file during scenes with movement. Perhaps you
should check the files
Perhaps jagabo will respond, there was a thread in the last few months where something similar came up

Thank you for the reply.
18. Originally Posted by jagabo
Earlier I tried it with some xvid/mp3 avi files (480x360, 29.97 fps, 22 minutes, ~200 MB) and the files remuxed nearly instantaneously. There were no problems. Looking at the videos showed they used only I and P frames. No B frames, so no packed bitstream.

I found an Xvid AVI with packed bitstream -- I see the same "pts has no value" error messages and slow processing. It's the display of all those error messages that is causing the slowdown. You can avoid that by setting the log level to panic. Might as well eliminate the banner message too:

Code:
for %%F in ("*.avi") do ( ffmpeg -hide_banner -loglevel panic -i "%%~nxF" -c copy "%%~nF.mp4" )
But I found the resulting mp4 file was jerky in some players. MPCHC was jerky, VLC wasn't. So I looked for another fix. I found you can unpack the packed bitstream (-bsf:v mpeg4_unpack_bframes) and generate new timecodes (-fflags +genpts). But I couldn't get a file that played smoothly in both players. So finally I tried a two step process AVI to new AVI with unpacked bitstream, then new AVI to MP4 with new timecodes. That gave a video that played smoothly in both MPCHC and VLC.

Code:
for %%F in ("*.avi") do (
ffmpeg -y -fflags +genpts -i "%%~nxF" -c copy -bsf:v mpeg4_unpack_bframes "%%~nF.temp.avi"
ffmpeg -y -fflags +genpts -i "%%~nF.temp.avi" -c copy -bsf:v mpeg4_unpack_bframes "%%~nF.mp4"
del "%%~nF.temp.avi"
)
The two step conversion is wasteful with AVI files without packed bitstream but the resulting mp4 files play ok.

Note I added the -y flag to prevent the program asking if you want to overwrite existing files.
Wow, thank you for all the work to figure out a solution. I only tried two of the videos that I did and they played okay on my Samsung TV but didn’t try them on anything else.
19. Thanks jagabo, great solution, and as you said - nearly instantaneous when it's working right
20. I'm slowly learning some of the intricacies of ffmpeg!
21. Originally Posted by jagabo
Earlier I tried it with some xvid/mp3 avi files (480x360, 29.97 fps, 22 minutes, ~200 MB) and the files remuxed nearly instantaneously. There were no problems. Looking at the videos showed they used only I and P frames. No B frames, so no packed bitstream.

I found an Xvid AVI with packed bitstream -- I see the same "pts has no value" error messages and slow processing. It's the display of all those error messages that is causing the slowdown. You can avoid that by setting the log level to panic. Might as well eliminate the banner message too:

Code:
for %%F in ("*.avi") do ( ffmpeg -hide_banner -loglevel panic -i "%%~nxF" -c copy "%%~nF.mp4" )
But I found the resulting mp4 file was jerky in some players. MPCHC was jerky, VLC wasn't. So I looked for another fix. I found you can unpack the packed bitstream (-bsf:v mpeg4_unpack_bframes) and generate new timecodes (-fflags +genpts). But I couldn't get a file that played smoothly in both players. So finally I tried a two step process AVI to new AVI with unpacked bitstream, then new AVI to MP4 with new timecodes. That gave a video that played smoothly in both MPCHC and VLC.

Code:
for %%F in ("*.avi") do (
ffmpeg -y -fflags +genpts -i "%%~nxF" -c copy -bsf:v mpeg4_unpack_bframes "%%~nF.temp.avi"
ffmpeg -y -fflags +genpts -i "%%~nF.temp.avi" -c copy -bsf:v mpeg4_unpack_bframes "%%~nF.mp4"
del "%%~nF.temp.avi"
)
The two step conversion is wasteful with AVI files without packed bitstream but the resulting mp4 files play ok.

Note I added the -y flag to prevent the program asking if you want to overwrite existing files.
The first option was very quick but the second produced the following output and took a few minutes per file. It isn’t a problem but thought I would post in case this should not be the result.

[Attachment 53832 - Click to enlarge]

[Attachment 53833 - Click to enlarge]

[Attachment 53834 - Click to enlarge]
22. I haven't had that problem here. Does the resulting file play properly? You can always add "-loglevel panic" to stop the error messages. That might speed it up.
23. Originally Posted by jagabo
I haven't had that problem here. Does the resulting file play properly? You can always add "-loglevel panic" to stop the error messages. That might speed it up.
Yes the video seems to play fine. I only did a couple of files and only tested it on my Samsung TV but before I delete the original AVI files I would like to feel confident it will play on other players with no problem, as once I delete the files won’t be able to try anything else if I find problems on different players. When I have a bit more time I will test the output from all three of the batch files you provided. All three played fine on my Samsung TV. Can you tell exactly where to add the above to stop the errors. I have no doubt it would speed things up as the second command you provided made a huge difference in the time to process each file.

Thanks again
24. I'd put the -loglevel panic right after -y, before -fflags. Are the
25. Originally Posted by jagabo
I'd put the -loglevel panic right after -y, before -fflags. Are the
In both lines or just the first or second line?
26. Whichever line is causing the problem. I can't tell from your screen shot. Or both lines. It just supresses the less critical warning messages.
27. Originally Posted by jagabo
Whichever line is causing the problem. I can't tell from your screen shot. Or both lines. It just supresses the less critical warning messages.
I have had so much going on believe it or not I didn't get around to trying this until today. It has taken roughly an hour to do 18 files which seems a lot longer than I understood this should take.

Here is the contents of the batch file so would appreciate if you would look it over and insure it is correct and that there isn't an error or something which would be causing it to take longer than it otherwise would.

Thank you

Code:
for %%F in ("*.avi") do (
ffmpeg -y -loglevel panic -fflags +genpts -i "%%~nxF" -c copy -bsf:v mpeg4_unpack_bframes "%%~nF.temp.avi"
ffmpeg -y -loglevel panic -fflags +genpts -i "%%~nF.temp.avi" -c copy -bsf:v mpeg4_unpack_bframes "%%~nF.mp4"
del "%%~nF.temp.avi"
)
Perhaps I could put each command into a separate batch file and see which of the two commands is taking the majority of the time or perhaps they are taking an equal amount of time.
28. It's kinda reassuring, goes to show that I'm not alone in this hectic world who can be vvveerrrrryyy sssslllooooow at doing things sometimes...
A few “capsule replies” :
– You should learn how to take screenshots.
– Instead of going through all that hassle, just because the stupid new TV dropped support for older files that were played fine on the older model from the same brand, you could get a cheap standalone player that is known to play all common digital media file formats, like the once popular WD Live. Never had one, but I've read nothing but praise about that particular unit, it was quite cheap new and could be found even cheaper now used. Don't know if it's been updated to play newer formats like H.265, but that's not the issue here. Or play the pesky files from a laptop computer, or a Raspberry thingy (no experience with these), or some Internet set-top media boxes...
– If converting those pesky AVI files is really necessary, perhaps mkvmerge wouldn't have hiccups like ffmpeg does. It can be used from a GUI called MKVToolNix, but to process an entire folder a CLI script is way faster. What's nice is that when importing a file (drag-and-drop works) into MKVToolNix, then changing any setting, it can display the actual command line that is sent to the mkvmerge.exe executable ; then based on that it's easy to create a FOR ... DO ... loop script, even without fully understanding the intricacies of each and every switch / option involved. Anyway, for a simple AVI to MKV remuxing the command is quite straighforward.
Code:
"C:/Path/to/MKVToolNix\mkvmerge.exe" --ui-language en --output ^"E:\Path\to\output\output.mkv^" --language 0:und --language 1:und ^"^(^" ^"E:\Path\to\input\input.avi^" ^"^)^" --track-order 0:0,0:1
(Not sure why it replaces some backslash characters by forward slash characters, or why it adds those seemingly superfluous ^"^(^" ^" parentheses and escape characters.)
That's the base command obtained from “Multiplexer” => “Show command line” ; then the loop script would be (removed the unnecessary clutter) :
Code:
FOR %%F in (*.avi) DO "C:\Path\to\MKVToolnix\mkvmerge.exe" --output "%%~nF.mkv" "%%F" --track-order 0:0,0:1
Tested with an AVI file which has the “packed bitstream” kind of muxing (don't remember exactly what that is, I've probably read an in-depth explanation at some point but quickly forgot) : works fine, very quick. With “FOR /R” (/R stands for “recursive”) an entire folder with all its subfolders could be processed at once. It also allows to set a working directory different from the one where the .bat file is located, for instance if the .bat file is in E: root directory, this will process every AVI file in "F:\VIDEO" and all subdirectories :
Code:
FOR /R "F:\VIDEO" %%F in (*.avi) DO "C:\Path\to\MKVToolnix\mkvmerge.exe" --output "%%~nF.mkv" "%%F" --track-order 0:0,0:1
The same command can be launched from the command prompt, in which case only one “%” sign should be used for the arguments.
Code:
FOR /R "F:\VIDEO" %F in (*.avi) DO "C:\Path\to\MKVToolnix\mkvmerge.exe" --output "%~nF.mkv" "%F" --track-order 0:0,0:1
Another way is to first specify the working directory with “CD” (change directory), then execute the actual command.
Code:
F:
CD "VIDEO"
FOR %%F in (*.avi) DO "C:\Path\to\MKVToolnix\mkvmerge.exe" --output "%%~nF.mkv" "%%F" --track-order 0:0,0:1
Well, let's hope this gets solved before June 2021 ! (I'm talking about the Covid of course.)

I only did a couple of files and only tested it on my Samsung TV but before I delete the original AVI files I would like to feel confident it will play on other players with no problem, as once I delete the files won’t be able to try anything else if I find problems on different players.
I would be wary about deleting the original files, especially when it comes to personal recordings mentioned on page 1. Hence my suggestion of getting a complimentary standalone device that can read all that stuff with no fuss.
29. Originally Posted by jackdup
Originally Posted by jagabo
Whichever line is causing the problem. I can't tell from your screen shot. Or both lines. It just supresses the less critical warning messages.
I have had so much going on believe it or not I didn't get around to trying this until today. It has taken roughly an hour to do 18 files which seems a lot longer than I understood this should take.
I just ran a test with 24 Xvid AVI files of about 650 MB each (~52 minute TV episodes), 14.5 GB total, on a 4 TB local hard drive. It took about 6 minutes and 30 seconds. CPU usage was only about 5 percent (8 core, 16 thread system). But if you have lots of files that were generating lots of error messages it may take much longer. Even though ffmpeg isn't writing those error messages to the screen it's probably still doing a lot of extra work internally.

Originally Posted by jackdup
Here is the contents of the batch file so would appreciate if you would look it over and insure it is correct and that there isn't an error or something which would be causing it to take longer than it otherwise would.

Thank you

Code:
for %%F in ("*.avi") do (
ffmpeg -y -loglevel panic -fflags +genpts -i "%%~nxF" -c copy -bsf:v mpeg4_unpack_bframes "%%~nF.temp.avi"
ffmpeg -y -loglevel panic -fflags +genpts -i "%%~nF.temp.avi" -c copy -bsf:v mpeg4_unpack_bframes "%%~nF.mp4"
del "%%~nF.temp.avi"
)
It's my mistake but the second ffmpeg command line doesn't need the " -bsf:v mpeg4_unpack_bframes" option. It's already been done by the first command. I don't think it makes much difference in the execution time though.

Originally Posted by jackdup
Perhaps I could put each command into a separate batch file and see which of the two commands is taking the majority of the time or perhaps they are taking an equal amount of time.
It's worth a try.
30. Regarding muxing to MKV: MkvMerge doesn't unpack the packed bitstream so the resulting video may not play well on all devices.

After a quick test, KMPlayer, MPCHC, PotPlayer, SMPlayer, WMPlayer all played the MVK properly. So did Kodi on my Raspberry Pi 3, and VLC on my Android smartphone.

Statistics