Batch Video Converter

Search This thread

Budius

Senior Member
May 1, 2010
229
58
A little more insight into the outstanding bug.

yeah I guess I know why:
https://github.com/budius/Chromecas...hromecast/converter/ExecutionControl.java#L19
Code:
  private static final List<String> VIDEO_EXTENSION =
            Arrays.asList("mp4", "mkv", "avi", "mpeg", "mpg", "mpe", "mov", "qt", "asf", "flv", "wmv", "m1v", "m2v", "3gp");

.m4v is not in the list of video files, I forgot it exist, there might be others. I'll add to it soon and update again.
 

sethlo

Senior Member
Jul 13, 2007
80
3
5.1 Audio process?

Thank you for this great tool.

What happens with audio?
If I have a file that contains AC3 5.1 audio and a aac 2.0 track, what will happen in the audio conversion?

I am experimenting using plex and I seem to have trouble getting anything to stream with 5.1.
I'd like to get aac with 5.1 audio to work.

Thanks again.
 

Budius

Senior Member
May 1, 2010
229
58
Thank you for this great tool.

What happens with audio?
If I have a file that contains AC3 5.1 audio and a aac 2.0 track, what will happen in the audio conversion?

I am experimenting using plex and I seem to have trouble getting anything to stream with 5.1.
I'd like to get aac with 5.1 audio to work.

Thanks again.

hi, I'm glad you like it.

I believe it will keep all the channels. I'm not explicitly in the code setting the number of channels, so whatever is happening is the FFMPEG AAC standard behaviour.

So my best suggestion is to make a test. Run on a 5.1 video, un-mark the checkbox that says "Delete on completion" and see the final result. And please share the results back with us :D

in case you curious, the code that does it is here: https://github.com/budius/Chromecas.../chromecast/converter/FFMpegBuilder.java#L374.
 

sethlo

Senior Member
Jul 13, 2007
80
3
hi, I'm glad you like it.

I believe it will keep all the channels. I'm not explicitly in the code setting the number of channels, so whatever is happening is the FFMPEG AAC standard behaviour.

So my best suggestion is to make a test. Run on a 5.1 video, un-mark the checkbox that says "Delete on completion" and see the final result. And please share the results back with us :D

in case you curious, the code that does it is here: https://github.com/budius/Chromecas.../chromecast/converter/FFMpegBuilder.java#L374.

Ran it on an .mkv file with ac3 5.1 and it converted to .mp4 with aac 5.1. Worked like a charm.
I am curious what happens if there are multiple audio tracks. I'll try it on a file like that at some point.

Only other thing that would be on my wishlist would be the option to keep/copy the original audio stream(s) into the wrapper along with the new compatible one. I did a lot of reading this weekend on mapping/copying streams in ffmpeg, and I think I could stumble my way through it . . . but I'm a total noob at ffmpeg (and linux for that matter) so your one-click solution is great!
 

Budius

Senior Member
May 1, 2010
229
58
Ran it on an .mkv file with ac3 5.1 and it converted to .mp4 with aac 5.1. Worked like a charm.
I am curious what happens if there are multiple audio tracks. I'll try it on a file like that at some point.

let me know when you do :good: :highfive:

Only other thing that would be on my wishlist would be the option to keep/copy the original audio stream(s) into the wrapper along with the new compatible one. I did a lot of reading this weekend on mapping/copying streams in ffmpeg, and I think I could stumble my way through it . . . but I'm a total noob at ffmpeg (and linux for that matter) so your one-click solution is great!

when I started this project I was pretty noob on FFMPEG too. And the whole deal with the stream mapping gave me headache.

I guess what I was trying to do is, besides exporting the subtitle file, also include the original subtitle streams into the final file, but I just couldn't.
If you found what are the FFMPEG commands to achieve those results (copy original audio, copy original subtitle), let me know that I'll be happy to include in the tool.
 

sethlo

Senior Member
Jul 13, 2007
80
3
If you found what are the FFMPEG commands to achieve those results (copy original audio, copy original subtitle), let me know that I'll be happy to include in the tool.

I'll give it a try and see how I do... Do you mind if I link to this thread to try and get your converter some attention in a couple other forums/communities?
 

lemoon

Senior Member
Dec 31, 2010
64
6
Thanks. But I already got some cool converters such as Aneesoft video converter, which also can batch convert videos and can play embedded subtitles.
 

Budius

Senior Member
May 1, 2010
229
58
I'll give it a try and see how I do... Do you mind if I link to this thread to try and get your converter some attention in a couple other forums/communities?

Absolutely not. Go for it.
If we get more brain power on it we can make it better, right?

Thanks. But I already got some cool converters such as Aneesoft video converter, which also can batch convert videos and can play embedded subtitles.

I almost feel like you're trying to advertise their software.
But if you're happy with the paid closed source software you have, good for you.
I'm just giving for free a tool I created for myself and believe some might want to use it too.
I'm not trying to create a business or anything and sincerely don't care if 1 or 1 million people uses it.
 

pwvandeursen

Senior Member
Aug 16, 2007
282
15
just compiled ffmpeg and installed java. downloaded chomecastconvert and executed it. however this was the reply:

Any help as to why this could be the case and how to solve it?

thanks!

DiskStation> java -jar ChromecastConverter.jar
Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:2 07)
at java.awt.Window.<init>(Window.java:535)
at java.awt.Frame.<init>(Frame.java:420)
at javax.swing.JFrame.<init>(JFrame.java:224)
at com.javafx.main.Main$1.run(Main.java:882)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDo main.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre ad.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread. java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre ad.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
DiskStation>
 

nappster

Member
Dec 30, 2011
11
0
I know this tread is only for Batch Video Converter but i have tested a Programm (Movavi Video Converter) and he makes a convert a mkv container to a mp4 container for a 10GB Movie in less than 4 Minutes.

But the Programm is not free !

EDIT:

a 1,4 GB AVI file to convert in mp4 less than 8 minutes
 
Last edited:

Budius

Senior Member
May 1, 2010
229
58
just compiled ffmpeg and installed java. downloaded chomecastconvert and executed it. however this was the reply:

Hi.... sorry for the delay. I was OOO.

I Googled a bit around and apparently you're missing some package for the Java Runtime.
check this:
http://stackoverflow.com/questions/5241850/running-java-gui-application-through-linux-terminal

maybe/probably something like that can fix it too:

Code:
sudo apt-get purge openjdk-6-jre openjdk-6-jdk
sudo apt-get install openjdk-6-jre
 

stdanjo

New member
Dec 19, 2016
3
0
hi - I really want to try out your converter but I'm having trouble getting started - very new to all this - I have as per the instructions installed ffmpeg (windows 7 user) and configured the path for it - on the c drive - but the next bit I cant seem to get right - I have downloaded and unzipped your converter but no matter what location I use it in when I use open cmd prompt and type cc_converter as per instructions I get 'is not recognised as an interna lor external command etc' error - I reckon its probably something basic that I'm doing wrong but no amount of googling seems to be fixing it!

appreciate any simple steps you can provide.

cheers
 

Budius

Senior Member
May 1, 2010
229
58
hi - I really want to try out your converter but I'm having trouble getting started - very new to all this - I have as per the instructions installed ffmpeg (windows 7 user) and configured the path for it - on the c drive - but the next bit I cant seem to get right - I have downloaded and unzipped your converter but no matter what location I use it in when I use open cmd prompt and type cc_converter as per instructions I get 'is not recognised as an interna lor external command etc' error - I reckon its probably something basic that I'm doing wrong but no amount of googling seems to be fixing it!

just add the path where u unzip cc_converter to the path too.
that way should be easy to use it from anywhere.

hope it helps.
 

stdanjo

New member
Dec 19, 2016
3
0
just add the path where u unzip cc_converter to the path too.
that way should be easy to use it from anywhere.

hope it helps.
hi - thanks so much for replying.
I have managed to get to the stage where I can use a cmd line with cc_converter.bat - I eventually worked out I needed to edit the .bat file to show pathway for CLASSPATH (like I said totally new to all this but giving it a go and learning -a lot - as I go!)
so I am now getting from cmd after typing cc_converter.bat
Chromecast Converter - V2.1.0
Input File or Folder cannot be empty
usage: ./cc_converter <opts>
-i,--input <arg> Input file or folder
-o,--output <arg> Output folder (optional)
-q,--quality <arg> Quality: high, normal, low. Default is high (optional)
-s,--speed <arg> Speed: ultrafast, superfast, veryfast, faster, fast,
medium, slow, slower, veryslow. Default is slow (optional)
-f,--force Force conversion (even if input codecs are correct)
-d,--delete Delete the original file upon successful conversion
--DEBUG Debug mode with more logs


I know there must be somewhere to type in the options but I am at a loss. I'm trying to run the following from your list of suggestions but obviously I'm getting something wrong.
•Default values, entire collection to different folder, delete after success conversion
./cc_converter -i ~/Videos/ -o ~/ChromecastVideos -d

if I try (using my locations)
./cc_converter -i ~/cctest/ -o ~/cctest2/ -d
I get '.' is not a recognised command etc - I assume because ./cc_converter is for java rather than windows cmd ?

so I try
cc_converter.bat -i ~/cctest/ -o ~/cctest2/ -d
I get the original
'Input File or Folder cannot be empty' error

so I try
cc_converter.bat -i ~\cctest\ -o ~\cctest2\ -d
same error

so I try cc_converter.bat -i ~c:\cctest\ -o ~c:\cctest2\ -d
same error

I think I'm close but could be a million miles away! I've been through the batch file to see if the settings are there but I cant work out where they would go?

If you get 5 mins to read this and make a suggestion I (and my wife who has had to put up with my swearing) would be very grateful.

just to recap I've installed java (in c:\program files and ffmpeg and cc_converter-2.1.0 in the c:\ the folders I am using to test this with are c:\cctest which has an avi copy of Die Hard - (because its Christmas) and output folder is c:\cctest2

in the meantime I will keep tinkering away and hopefully work it out!

cheers
 

Budius

Senior Member
May 1, 2010
229
58
hi - thanks so much for replying.
I have managed to get to the stage where I can use a cmd line with cc_converter.bat - I eventually worked out I needed to edit the .bat file to show pathway for CLASSPATH (like I said totally new to all this but giving it a go and learning -a lot - as I go!)
so I am now getting from cmd after typing cc_converter.bat
Chromecast Converter - V2.1.0
Input File or Folder cannot be empty
usage: ./cc_converter <opts>
-i,--input <arg> Input file or folder
-o,--output <arg> Output folder (optional)
-q,--quality <arg> Quality: high, normal, low. Default is high (optional)
-s,--speed <arg> Speed: ultrafast, superfast, veryfast, faster, fast,
medium, slow, slower, veryslow. Default is slow (optional)
-f,--force Force conversion (even if input codecs are correct)
-d,--delete Delete the original file upon successful conversion
--DEBUG Debug mode with more logs


I know there must be somewhere to type in the options but I am at a loss. I'm trying to run the following from your list of suggestions but obviously I'm getting something wrong.
•Default values, entire collection to different folder, delete after success conversion
./cc_converter -i ~/Videos/ -o ~/ChromecastVideos -d

if I try (using my locations)
./cc_converter -i ~/cctest/ -o ~/cctest2/ -d
I get '.' is not a recognised command etc - I assume because ./cc_converter is for java rather than windows cmd ?

so I try
cc_converter.bat -i ~/cctest/ -o ~/cctest2/ -d
I get the original
'Input File or Folder cannot be empty' error

so I try
cc_converter.bat -i ~\cctest\ -o ~\cctest2\ -d
same error

so I try cc_converter.bat -i ~c:\cctest\ -o ~c:\cctest2\ -d
same error

I think I'm close but could be a million miles away! I've been through the batch file to see if the settings are there but I cant work out where they would go?

If you get 5 mins to read this and make a suggestion I (and my wife who has had to put up with my swearing) would be very grateful.

just to recap I've installed java (in c:\program files and ffmpeg and cc_converter-2.1.0 in the c:\ the folders I am using to test this with are c:\cctest which has an avi copy of Die Hard - (because its Christmas) and output folder is c:\cctest2

in the meantime I will keep tinkering away and hopefully work it out!

cheers

hi,

it seems you're getting close indeed.
the usage of `~` and `./` symbols is a unix notation (used on Mac and Linux (I use linux)). The `~` is for home folder and `./` is to execute
And you won't find anything on the bat file, it is just an auto-generated file that executes the Java code (the .jar file) and pass those parameters to Java
Windows doesn't use any of it. So for you I believe it would be just:

Code:
cc_converter.bat -i c:/cctest -o c:/cctest2 -d

It might be necessary to wrap the path on windows with quotation marks, like "c:/cctest", but I'm not sure. You test it.
And remember that `-d` will delete the original file after successful conversion. If you don't want that, do not add `-d`
 
Last edited:

stdanjo

New member
Dec 19, 2016
3
0
hi,

it seems you're getting close indeed.
the usage of `~` and `./` symbols is a unix notation (used on Mac and Linux (I use linux)). The `~` is for home folder and `./` is to execute
And you won't find anything on the bat file, it is just an auto-generated file that executes the Java code (the .jar file) and pass those parameters to Java
Windows doesn't use any of it. So for you I believe it would be just:

Code:
cc_converter.bat -i c:/cctest -o c:/cctest2 -d

It might be necessary to wrap the path on windows with quotation marks, like "c:/cctest", but I'm not sure. You test it.
And remember that `-d` will delete the original file after successful conversion. If you don't want that, do not add `-d`

LEGEND !
that's it ! - thank you so much - now just a few hundred files to sort out!
thanks again
 

Budius

Senior Member
May 1, 2010
229
58
LEGEND !
that's it ! - thank you so much - now just a few hundred files to sort out!
thanks again

I'm happy I could help.
Hopefully your few hundread files won't take until next year.

First time I converted several seasons of several series took my i7 gen2 about 3 weeks :p
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Copy/Move feature V2.1.0
    move/copy file to output folder if the file doesn't need conversion

    Minor Bug Fix V2.0.1
    All the command line executions were being reported as seconds, but it was dividing milisecond by 100 instead of 1000

    Major Release V2.0

    Higher quality, faster conversions, more efficient checking, and super important: works with normal FFMPEG, no need to compile it yourself.

    Changes:
    - dropped GUI because aint nobody got time for that
    - major re-write, better structured code all together
    - properly checks available audio codecs and applies accordingly
    - due to the above audio changes, it works fine with FFMPEG static builds
    - yeah, normal builds you can simply download from ffmpeg.org
    - drop 2-pass video because aint nobody got time for that
    - moved code to gradle, all dependencies now come from mavenCentral(), no more downloaded **** on or folder
    - independently handle audio or video conversion or copy (greater efficiency)
    - separate warning and error log files

    Update V1.1.1 (minor crash fix)

    it's with great pleasure that I share with you guys my batch video converter for Chromecast.

    it's made to be a simple as possible, select a file or a whole folder, and Go.

    I did that to convert my terabyte of movies on my DLNA-NAS to be able to cast all of it without problems.
    Because of this main reason the application it DELETES THE ORIGINAL VIDEO FILE AFTER CONVERSION COMPLETION.
    So then the option `-d` can be used to delete the original after successful conversion.

    The app analyses the video stream of your files, compare with what Chromecast accepts and only converts what's necessary, keeping great quality, and avoiding unnecessary encoding.

    I also noticed that A LOT of apps does not play embedded subtitles, so in the process it extracts subtitle files so you can separately inject it into Chromecast.

    changelog:
    - v1.0.0 - initial release
    - v1.1.0 - re-worked FFMPEG script for better quality, new layout with settings for speed, quality, delete file, output folder.
    - v1.1.1 - Fix app not properly closing. Fix crash on subtitle stream without language tag.
    - V2.0 - check above
    - V2.1 - move/copy file to output folder if the file doesn't need conversion


    Downloads:
    - zip installation: Simply unzip the file on the location. Execute with ./cc_converter (linux/mac) or cc_converter (windows) from the command line
    - open source project: GitHub link (contribute!)

    Before starting:
    This tool is just a thin wrapper on FFMPEG, so if your PC doesn't have a working version of FFMPEG, the tool won't work.
    So make sure to download a build (recommended V3.0 or later) and have it available on your PATH
    On the official website you can find all the detailed instructions on how to compile FFMPEG on your PC https://trac.ffmpeg.org/wiki/CompilationGuide

    Yes, unfortunately you have to compile it yourself because, to keep great quality, the tool uses the non-free parts of FFMPEG.
    That means, when compiling, make sure to include libx264 and libfdk-aac and keep the enable-nonfree flag.


    Settings explanations:

    as per request a few explanations on options:

    the speed and quality options are directly related to x264 encoding options found here: https://trac.ffmpeg.org/wiki/x264EncodingGuide

    - the speed is exactly what they explain there. The faster the conversion the crappier the job.
    - the quality uses CRF (constant rate factor) and defaults to good quality for both audio and video.

    high quality = video CRF 18, audio 80kb/s per channel
    normal quality = video CRF 23, audio 64kb/s per channel
    low quality = video CRF 26, audio 48kb/s per channel

    On all my tests I ended up settling with Speed SLOW and quality HIGH as the Default because those will rarely increase the file size much and it will keep same quality.
    Those test were based on both converting 1994 Friends episode (pretty crappy quality) all the way to Full-HD 5.1 movies.

    So unless, you have a really good reason for it, I wouldn't change any of the defaults.
    1
    it's with great pleasure that I share with you guys my batch video converter for Chromecast.

    it's made to be a simple as possible, select a file or a whole folder, and click Go.

    I did that to convert my terabyte of movies on my DLNA-NAS to be able to cast all of it without problems.
    Because of this main reason the application it DELETES THE ORIGINAL VIDEO FILE AFTER CONVERSION COMPLETION.

    The app analyses the video stream of your files, compare with what Chromecast accepts and only converts what's necessary, keeping great quality.

    I also noticed that A LOT of apps does not play embedded subtitles, so in the process it extracts subtitle files so you can separately inject it into Chromecast.

    Downloads:
    - executable jar: Jar file download (execute it with java -jar chromecastconverter.jar)
    - open source project: GitHub link (for whoever feels like contributing)

    Can I run this on a headless Linux server like a Raspberry Pi running Rasbian?
    1
    Can I run this on a headless Linux server like a Raspberry Pi running Rasbian?


    It was build as a Java UI (using JavaFX), so I reckon the code it's not good for a headless server (although the objects in the code are quite modular and should be totally possible with minimum modification to do it)

    BUT,
    I urge anyone to not use it with a RaspberryPi, I have one myself and tried some FFMPEG on it and it's just so painfully slow!!! So so slow!
    Like a 20 seconds video would take 5 min to process.

    ps.: If anyone find a way to build FFMPEG on a raspPi that properly uses the GPU and makes stuff runs at proper speed, please let us know. :laugh:
    1
    First of all, I'm very happy that you got it working :highfive: . ...

    But for correctness the software converts anything that is not exactly as shown in the official website. I mean, I gotta follow the official stuff.

    .

    Well that is your feedback, make it remove re-coding that which actually works on Chromecast, it will save hours of recoding.
    1
    Dear OP,

    I tried converting a mkv file using your converter and at the end of conversion it created a mp4 file but message said that it failed. When i played the converted mp4 file on my PC, it plays video but no audio? any idea whey the audio is not playing back? I did not try on chromecast yet but i assume the audio wont play on it either.
    Thoughts? Thanks

    the conversion uses a two-pass method for best quality.
    1st pass is only processing the video and doesn't even look at the audio. On the 2nd pass the audio is added/processed.

    The video you got without audio is the result of the 1st pass, and the 2nd pass never executed because it failed.

    My guess is that your compilation of FFMPEG does not have libfdk_aac (the audio library used for conversion keeping the best quality possible).
    Unfortunately this library is tagged as "-non-free" so you can't just download from somewhere. It's illegal to do so. You have to follow the guide here https://trac.ffmpeg.org/wiki/CompilationGuide to compile the library yourself on your PC..

    As I said before, I really wished it would be more user-friendly. But that's out of my control.

    Probably in a future version I'll try to detect if this library is available and if it's not use the native one, that renders a not so great quality, but at least works in all cases.