VideoHelp Forum




+ Reply to Thread
Results 1 to 12 of 12
  1. Member
    Join Date
    Jun 2008
    Location
    United Kingdom
    Search Comp PM
    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
    Quote Quote  
  2. 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)
    Quote Quote  
  3. Member
    Join Date
    Jun 2008
    Location
    United Kingdom
    Search Comp PM
    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
    Quote Quote  
  4. Member
    Join Date
    Jun 2008
    Location
    United Kingdom
    Search Comp PM
    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.
    Quote Quote  
  5. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Try add -vcodec copy to just copy the video track.
    Quote Quote  
  6. Member
    Join Date
    Jan 2003
    Location
    India
    Search Comp PM
    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)
    Quote Quote  
  7. the vbsf parameter is required when converting from mp4 to m2ts (or ts)
    shouldn't it be always required when remuxing or extracting h.264 content?
    Quote Quote  
  8. Member
    Join Date
    Jun 2008
    Location
    United Kingdom
    Search Comp PM
    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.
    Quote Quote  
  9. Member
    Join Date
    Jan 2003
    Location
    India
    Search Comp PM
    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
    Quote Quote  
  10. Member
    Join Date
    Jun 2008
    Location
    United Kingdom
    Search Comp PM
    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?
    Quote Quote  
  11. Member
    Join Date
    Jan 2003
    Location
    India
    Search Comp PM
    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.
    Quote Quote  



Similar Threads

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