Hello
My current Sony Bravia TV set allows only m2ts (video=avc, audio=ac3) playback through a usb storage [hard disk or pen drive]. It does not play mp4 files(video=avc, audio=aac)
I have got about 700 mp4 files (video=avc, audio=aac)
Using avidemux I open the mp4 file e.g file1.mp4, convert its audio from aac to ac3 and save it as file1.ac3
Using tsmuxer, I open the same mp4 file e.g file1.mp4, delete its audio aac track and add the new audio file (file1.ac3), then remuxing to m2ts. the resulting file e.g file1.m2ts plays perfectly on my tv.
On my core i7 pc, each file will take about one to two minutes to convert from mp4 to m2ts.
Now is there a chance to do these steps by using a batch file to convert all of my files?
Many thanks
+ Reply to Thread
Results 1 to 12 of 12
-
-
Can it play .ts ?
You can use ffcoder to batch process a folder (file=> add folder, file format=> ts , video=> copy , audio=> ac3) . Try it out on 1 or 2 test files to see if your TV likes it
If not, another option might be ffmpeg batch file (ffcoder is a GUI for ffmpeg , mencoder, and other programs) -
Pl see Baldrick's suggestion in
https://forum.videohelp.com/threads/323448-Need-help-with-ffmpeg-batch-file -
Thanks Poisondeathray
I downloaded and installed ffcoder ( under windows 7). It asked to download and install Haali media Splitter which I did, added a test file, format=ts, video=copy, audio=ac3 but the programmed failed to produce any output. When I exit the program and tried it again it kept asking me to install Haali which is already installed. I gave up.
I will have a go at ffmpeg later on -
I downloaded and installed the latest 64 bit version of ffmpeg, read through command lines and came up with this script:
ffmpeg -i input_file1.mp4 -sameq -acodec ac3 output_file1.m2ts
I fired a way this bat file and the hell broke out in my pc: very loud noise [either from the hard disk or the fans] started as the program was doing its job [as I could see the black window with various frame numbers and times details] and the noise continued until the program finished with the production of the expected m2ts file. My assumption was that the program was encoding / muxing with increased disk or fans activity.
I was relieved when the noise stopped. I checked the m2ts file and it was there and worked ok, but it was twice bigger than the input file size and it took about three minutes for the conversion to complete. [with avidemux / tsmuxer the operation was noiseless and took about a minute]
Is it possible to modify this script so the program works faster and without excessive noise? and could you explain to me the reason behind the excessive pc noise?
Thanks. Any comment would be much appreciated. -
use this in a batch file to convert all .mp4 files to .m2ts
for %%a in ("*.mp4") do ffmpeg -i %%a -vcodec copy -vbsf h264_mp4toannexb -acodec ac3 -ab 192k %%~na.m2ts
change the 192k (192 kbps) to whatever you want to use for the ac3 audio.
for a single file
ffmpeg -i input_file1.mp4 -vcodec copy -vbsf h264_mp4toannexb -acodec ac3 -ab 192k output_file1.m2ts
the vbsf parameter is required when converting from mp4 to m2ts (or ts) -
the vbsf parameter is required when converting from mp4 to m2ts (or ts)
-
Baldrick:
Thanks for the advice, when I added (-vcodec copy) the program run for a few seconds and ended suddenly with zero output and no error messages.
mgh:
Thanks for your input, the addition of (-vbsf h264_mp4toannexb) to (-vcodec copy) did the trick and the program run fast and noisless! could you tell me what did this option actually do as we are only copying the video?
Now I will try to see it can do all of my files
Thanks to all. -
something to do with the differences in h264 streams in mp4 and m2ts(ts) containers, apparently it is not a straightforward remuxing
you do not need it going from mp4 to mkv, for example.
you always need it going from mp4 to ts or m2ts.
it is a bit of trial and error for other cases -
mgh:
Thanks for the explanation.
When I converted my files one by one the conversion was perfect, however, using the batch (for %%...etc) all of the files were converted, but most of the output files were smaller in size and shorter in duration compared to the original, suggesting some data loss. e.g if the original file was 400 MB and 15 minutes long, the output would be 100 MB and 3 minutes long. Only one or two from about 10 files were converted without loss. Any comments? -
I tried the batch script as well as the one by one script before posting. Results were identical. Why you are getting different results, I don't know.
The m2ts files should be bigger than the mp4 files.
Similar Threads
-
tsMuxer and joining m2ts files
By fkasparek in forum Blu-ray RippingReplies: 13Last Post: 12th Jun 2014, 12:07 -
Editing M2TS file with AviDemux 2.6 (r8164)
By Kerry56 in forum EditingReplies: 1Last Post: 2nd Sep 2012, 11:02 -
I can not add .m2ts files into TSMuxer
By yaoyao0204 in forum Blu-ray RippingReplies: 2Last Post: 25th Nov 2011, 20:00 -
MKV to M2TS w/ TSMuxer
By averageschmoe in forum Video ConversionReplies: 2Last Post: 22nd May 2011, 00:21 -
How to Batch Process Using Avidemux? Or Batch Processing H264 .m2ts or .ts?
By forgotpassword in forum Video ConversionReplies: 0Last Post: 14th Apr 2009, 00:00