VideoHelp Forum
+ Reply to Thread
Results 1 to 28 of 28
Thread
  1. Hello,

    Kindly suggest which program Avidemux or Vlc, to use to convert .ts files to mp4 that will maintain the quality.

    Thank you in advance.
    Quote Quote  
  2. If the video/audio codecs are mp4 container compatible, then you can simply remux to mp4.
    No recoding occours, no quality loss. Avidemux can do it.
    Quote Quote  
  3. Originally Posted by ProWo View Post
    If the video/audio codecs are mp4 container compatible, then you can simply remux to mp4.
    No recoding occours, no quality loss. Avidemux can do it.
    Thank you for addressing my query..

    Here is the Media Info.. Can you please suggest me if I should use Avidemux..


    Code:
    ID                                       : 1 (0x1)
    Complete name                            : D:\Xilli\Holidays.ts
    Format                                   : MPEG-TS
    File size                                : 5.10 GiB
    Duration                                 : 2 h 54 min
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 4 182 kb/s
    Frame rate                               : 25.000 FPS
    
    Video
    ID                                       : 256 (0x100)
    Menu ID                                  : 1 (0x1)
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.1
    Format settings                          : CABAC / 2 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, Reference frames        : 2 frames
    Codec ID                                 : 27
    Duration                                 : 2 h 54 min
    Bit rate mode                            : Constant
    Nominal bit rate                         : 4 000 kb/s
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 25.000 FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.077
    Writing library                          : x264 core 155
    Encoding settings                        : cabac=1 / ref=2 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=4 / lookahead_threads=1 / sliced_threads=0 / slices=1 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / stitchable=1 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=3 / weightb=0 / open_gop=0 / weightp=1 / keyint=50 / keyint_min=1 / scenecut=0 / intra_refresh=0 / rc_lookahead=50 / rc=cbr / mbtree=1 / bitrate=4000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=4000 / vbv_bufsize=4050 / nal_hrd=cbr / filler=1 / ip_ratio=1.40 / aq=3:1.00
    
    Audio
    ID                                       : 257 (0x101)
    Menu ID                                  : 1 (0x1)
    Format                                   : AAC LC
    Format/Info                              : Advanced Audio Codec Low Complexity
    Format version                           : Version 4
    Muxing mode                              : ADTS
    Codec ID                                 : 15-2
    Duration                                 : 2 h 54 min
    Bit rate mode                            : Variable
    Channel(s)                               : 2 channels
    Channel layout                           : L R
    Sampling rate                            : 48.0 kHz
    Frame rate                               : 46.875 FPS (1024 SPF)
    Compression mode                         : Lossy
    Delay relative to video                  : -40 ms
    Thank you
    Quote Quote  
  4. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Use AVIDemux. Follow this procedure on my website.
    Quote Quote  
  5. To make it easy, you can also use clever FFmpeg-GUI.
    Load your ts, click main, click multiplex, set mp4 as container and click multiplex.
    Done

    There is an automatic compatibility check for the involved codecs.
    Quote Quote  
  6. Originally Posted by Alwyn View Post
    Use AVIDemux. Follow this procedure on my website.
    Thank you... I converted the file to mp4..

    Here is the Media Info.. Does everything look ok?

    Code:
    General
    Complete name                            : D:\Yumm\Holidays.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom (isom/iso2/avc1/mp41)
    File size                                : 4.92 GiB
    Duration                                 : 2 h 54 min
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 4 033 kb/s
    Frame rate                               : 25.000 FPS
    Writing application                      : Lavf58.76.100
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.1
    Format settings                          : CABAC / 2 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, Reference frames        : 2 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 2 h 54 min
    Source duration                          : 2 h 54 min
    Bit rate mode                            : Constant
    Bit rate                                 : 3 965 kb/s
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 25.000 FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.076
    Stream size                              : 4.84 GiB (98%)
    Source stream size                       : 4.84 GiB (98%)
    Writing library                          : x264 core 155
    Encoding settings                        : cabac=1 / ref=2 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=4 / lookahead_threads=1 / sliced_threads=0 / slices=1 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / stitchable=1 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=3 / weightb=0 / open_gop=0 / weightp=1 / keyint=50 / keyint_min=1 / scenecut=0 / intra_refresh=0 / rc_lookahead=50 / rc=cbr / mbtree=1 / bitrate=4000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=4000 / vbv_bufsize=4050 / nal_hrd=cbr / filler=1 / ip_ratio=1.40 / aq=3:1.00
    mdhd_Duration                            : 10476200
    Codec configuration box                  : avcC
    
    Audio
    ID                                       : 2
    Format                                   : AAC LC
    Format/Info                              : Advanced Audio Codec Low Complexity
    Codec ID                                 : mp4a-40-2
    Duration                                 : 2 h 54 min
    Bit rate mode                            : Variable
    Bit rate                                 : 60.6 kb/s
    Maximum bit rate                         : 128 kb/s
    Channel(s)                               : 2 channels
    Channel layout                           : L R
    Sampling rate                            : 48.0 kHz
    Frame rate                               : 46.875 FPS (1024 SPF)
    Compression mode                         : Lossy
    Stream size                              : 75.7 MiB (2%)
    Default                                  : Yes
    Alternate group                          : 1
    Thank you.
    Quote Quote  
  7. Originally Posted by ProWo View Post
    To make it easy, you can also use clever FFmpeg-GUI.
    Load your ts, click main, click multiplex, set mp4 as container and click multiplex.
    Done

    There is an automatic compatibility check for the involved codecs.
    Thank you.. I did give clever ffmpeg a try. Its a good tool. I need to convert 100 videos with each video having an approximate length of 2hrs. So, I thought to ask about Avidemux to save time.

    Here is the Media Info of Mp4 file after using clever ffmpeg

    Code:
    General
    Complete name                            : D:\Completed\Holidays_muxed.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom (isom/iso2/avc1/mp41)
    File size                                : 4.62 GiB
    Duration                                 : 2 h 54 min
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 3 785 kb/s
    Frame rate                               : 25.000 FPS
    Writing application                      : clever FFmpeg-GUI
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4
    Format settings                          : CABAC / 4 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, Reference frames        : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 2 h 54 min
    Bit rate                                 : 3 716 kb/s
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 25.000 FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.072
    Stream size                              : 4.53 GiB (98%)
    Writing library                          : x264 core 164 r3191 4613ac3
    Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    Codec configuration box                  : avcC
    
    Audio
    ID                                       : 2
    Format                                   : AAC LC
    Format/Info                              : Advanced Audio Codec Low Complexity
    Codec ID                                 : mp4a-40-2
    Duration                                 : 2 h 54 min
    Source duration                          : 2 h 54 min
    Bit rate mode                            : Variable
    Bit rate                                 : 60.6 kb/s
    Maximum bit rate                         : 63.2 kb/s
    Channel(s)                               : 2 channels
    Channel layout                           : L R
    Sampling rate                            : 48.0 kHz
    Frame rate                               : 46.875 FPS (1024 SPF)
    Compression mode                         : Lossy
    Stream size                              : 75.7 MiB (2%)
    Source stream size                       : 75.7 MiB (2%)
    Default                                  : Yes
    Alternate group                          : 1
    Thank you.
    Quote Quote  
  8. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    I need to convert 100 videos with each video having an approximate length of 2hrs.
    In that case, AVIDemux isn't the one. It can't easily do batching. But that file looks OK, although the bitrate is different to both the original and @ProWos (Clever FFMPEG). Did it process fairly quickly?

    I'm pretty sure FFMPEG can be set up to do batch processing without recoding; @ProWo will know.
    Quote Quote  
  9. Originally Posted by Alwyn View Post
    I need to convert 100 videos with each video having an approximate length of 2hrs.
    In that case, AVIDemux isn't the one. It can't easily do batching. But that file looks OK, although the bitrate is different to both the original and @ProWos (Clever FFMPEG). Did it process fairly quickly?

    I'm pretty sure FFMPEG can be set up to do batch processing without recoding; @ProWo will know.
    For a 2hr video file, avidemux is taking me 2-3 Mins to convert one and Clever FFMPEG, is taking 2hrs to get one conversion done.

    I am ok with manual conversion.

    Should I opt for avidemux ?

    Thank you.
    Quote Quote  
  10. Originally Posted by Jacobs View Post
    For a 2hr video file, avidemux is taking me 2-3 Mins to convert one and Clever FFMPEG, is taking 2hrs to get one conversion done.
    Then you have recoded the video, not remuxed it.
    As already mentioned above, load your ts video, click main, click multiplex, select mp4 as container and click multiplex at the bottom left.
    After a few seconds this should be done.
    Quote Quote  
  11. Originally Posted by Alwyn View Post
    I'm pretty sure FFMPEG can be set up to do batch processing without recoding; @ProWo will know.
    Batch processing isn't implemented yet in my GUI.
    Quote Quote  
  12. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    For a 2hr video file, avidemux is taking me 2-3 Mins to convert one and Clever FFMPEG, is taking 2hrs to get one conversion done.
    I think then that Clever is recoding/rendering it whereas AVIDemux isn't.

    Should I opt for avidemux ?
    It's doing the job, it's just that it'll require 100 setups. I suggest you wait to hear from the FFMPEG experts about smart rendering in batch. I believe AVIDemux is using FFMPEG under the hood so FFMPEG must do smart-rendering; it's just that AVIDemux won't batch-process using the GUI.

    Depending on your coding ability, I did find these ideas on the web:

    https://www.gaelanlloyd.com/blog/batch-processing-video-files-with-avidemux/

    https://www.reddit.com/r/Avidemux/comments/10eof7b/batchbulk_convert/
    Quote Quote  
  13. Originally Posted by ProWo View Post
    Originally Posted by Jacobs View Post
    For a 2hr video file, avidemux is taking me 2-3 Mins to convert one and Clever FFMPEG, is taking 2hrs to get one conversion done.
    Then you have recoded the video, not remuxed it.
    As already mentioned above, load your ts video, click main, click multiplex, select mp4 as container and click multiplex at the bottom left.
    After a few seconds this should be done.
    Hi,

    I have sent you a pm regarding the steps I took. I have taken a screenshot video of the conversion. I dont know how to send the video.

    Thank you.
    Quote Quote  
  14. You can post it here as attatchment.
    Quote Quote  
  15. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Disclaimer: I have no idea what I am doing!

    I had a play with that Reddit script and it "seems" to work to run batching with AVIDemux. I basically followed the post to convert some VOBs to MPGs.

    It all happened quite quickly so I suspect it was a smart-render process.

    Full Reddit script:
    Code:
    set avidemux="C:\Program Files\Avidemux 2.8 - 64 bits\avidemux.exe"
    
    set videocodec=Copy
    
    set audiocodec=Copy
    
    for %%f in (*.mkv) do %avidemux% --video-codec %videocodec% --audio-codec %audiocodec% --force-alt-h264 --load "%%f" --save "%%f.mp4" --quit
    
    echo.
    
    Pause
    In your case, just change the ".mkv" to ".ts".

    I think I can see what they've done but I don't understand the "force-alt-h264" part, not that it seemed to make any difference in my experiment.

    You just need to make sure that the link to avidemux.exe is correct.

    To create a BAT, just make a TXT file then change the extension to BAT. Edit it with Right-Click>Edit.

    Note, this (Copy, Copy) will only work if your TS files are H264-based.

    It should rip through your hundred files in a flash!

    I normally dislike command lines but this wasn't particularly onerous considering the benefit. CBA=tick.
    Quote Quote  
  16. Originally Posted by Alwyn View Post
    Disclaimer: I have no idea what I am doing!

    I had a play with that Reddit script and it "seems" to work to run batching with AVIDemux. I basically followed the post to convert some VOBs to MPGs.

    It all happened quite quickly so I suspect it was a smart-render process.

    Full Reddit script:
    Code:
    set avidemux="C:\Program Files\Avidemux 2.8 - 64 bits\avidemux.exe"
    
    set videocodec=Copy
    
    set audiocodec=Copy
    
    for %%f in (*.mkv) do %avidemux% --video-codec %videocodec% --audio-codec %audiocodec% --force-alt-h264 --load "%%f" --save "%%f.mp4" --quit
    
    echo.
    
    Pause
    In your case, just change the ".mkv" to ".ts".

    I think I can see what they've done but I don't understand the "force-alt-h264" part, not that it seemed to make any difference in my experiment.

    You just need to make sure that the link to avidemux.exe is correct.

    To create a BAT, just make a TXT file then change the extension to BAT. Edit it with Right-Click>Edit.

    Note, this (Copy, Copy) will only work if your TS files are H264-based.

    It should rip through your hundred files in a flash!

    I normally dislike command lines but this wasn't particularly onerous considering the benefit. CBA=tick.
    Thats a great job mate.. Thank you for the efforts.
    Quote Quote  
  17. You may want to try this simple ffmpeg alternative:
    - Copy the code below into notpad and save it as container_change.cmd to your desktop.
    - Then multiple select (in explorer) and drag and drop all the files you want to convert onto that icon on your desktop. They will be converted one by one.
    Code:
    :next
    if "%~1"=="" goto done
    ffmpeg -i "%~1" -c copy "%~1.mp4"
    shift
    goto next
    :done
    Quote Quote  
  18. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    @Sharc, I don't know how you have your FFMPEG set up; I had to put the full path to ffmpeg.exe in that CMD file. Then it worked. I do have ffmpeg.exe in System32.

    Interesting that both methods (and a VideoRedo test I did) are obviously smart-rendering indicated by the conversion speed but the file sizes come out different to the originals, in one case an original TS 2.1GB, converted MP4 1.8GB.
    Quote Quote  
  19. Originally Posted by Alwyn View Post
    @Sharc, I don't know how you have your FFMPEG set up; I had to put the full path to ffmpeg.exe in that CMD file. Then it worked. I do have ffmpeg.exe in System32.
    I have it in its own folder and put its path into the PATH of windows for convenience.
    If it is not in the PATH one can always specify the full path in the commandline as you did.

    Interesting that both methods (and a VideoRedo test I did) are obviously smart-rendering indicated by the conversion speed but the file sizes come out different to the originals, in one case an original TS 2.1GB, converted MP4 1.8GB.
    .ts and .m2ts are transport streams which have more overhead than .mp4 and .mkv files, hence the difference in filesize.
    The overhead in .ts or .m2ts allows a fast resync when the stream is interrupted during transmission.
    Last edited by Sharc; 23rd Sep 2024 at 03:03.
    Quote Quote  
  20. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    put its path into the PATH of windows for convenience.
    Could you explain that? What is the "path of Windows"?

    .ts and .m2ts are transport streams which have more overhead than .mp4 and .mkv files, hence the difference in filesize.
    OK, good to know.
    Quote Quote  
  21. Originally Posted by Alwyn View Post
    put its path into the PATH of windows for convenience.
    Could you explain that? What is the "path of Windows"?
    Type PATH into windows search, then
    System properties -> Environment variables -> System variables -> Path (add the bin folder of ffmpeg.exe to the list there).

    Details depend on the OS. This may help:
    https://www.computerhope.com/issues/ch000549.htm


    (I wonder why it doesn't work when you put ffmpeg.exe into one of the windows folders as these are already in the PATH....)
    Last edited by Sharc; 23rd Sep 2024 at 03:35.
    Quote Quote  
  22. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    I wonder why it doesn't work when you put ffmpeg.exe into one of the windows folders as these are already in the PATH....
    Dunno, but manually adding it to the path as you described has fixed it. Now I just have to remember to rejig the path variable when I update my ffmpeg folder. I might just stick with pasting in the full path.
    Quote Quote  
  23. Originally Posted by Alwyn View Post
    Now I just have to remember to rejig the path variable when I update my ffmpeg folder.
    Shouldn't be necessary when you update ffmpeg in the same folder.
    Quote Quote  
  24. @Sharc & Alwyn
    You must add -map 0, or only the first stream of any type (video, audio, subtitle) is muxed.
    Quote Quote  
  25. Originally Posted by ProWo View Post
    @Sharc & Alwyn
    You must add -map 0, or only the first stream of any type (video, audio, subtitle) is muxed.
    Yep. Thanks for the hint.
    Quote Quote  
  26. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Thanks @ProWo, where in the string would we put that?
    Quote Quote  
  27. Code:
    ffmpeg -i "%~1" -map 0 -c copy "%~1.mp4"
    Quote Quote  



Similar Threads

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