VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. but same codec without getting artifacts?.

    I used to encode my videos using h.265 8bit (default Handbrake h.265 option) then merge them with ffmpeg or avidmux.. 2 weeks ago I found out that h.265 10bit is better so I started encoding my videos using that, the thing is when I try to concatenate my previous videos (h.265 8bit) with my new videos (h.265 10bit) then they become artifact-ed. I can't just re-encode hundreds of hours of videos again it would take me ages with my 6-core CPU and the quality would suffer since I use CRF 23/24.. if there's no solution then the only thing I can do is to stop merging my videos which would be really inconvenient ( and I put everything in one folder and now I can't even know which videos are 8bit and which are 10bit) and wait some years for AV1 to be reliable and then re-encode everything with finding a way to minimize the loss of quality and hoping that I'd have a better CPU by then..

    Thanks.
    Quote Quote  
  2. Transport streams support switching pretty much everything on the fly.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    Transport streams support switching pretty much everything on the fly.
    Could you elaborate how to do that?.
    Quote Quote  
  4. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Re-encoding doesn't necessarily mean you'll get artifacts.

    While re-encoding should be avoided when possible, sometimes it's best to just re-encode.
    This is one of those times.

    To verify this is a good idea, where is a sample of both sources?
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  5. Originally Posted by lordsmurf View Post
    Re-encoding doesn't necessarily mean you'll get artifacts.

    While re-encoding should be avoided when possible, sometimes it's best to just re-encode.
    This is one of those times.

    To verify this is a good idea, where is a sample of both sources?

    I know that but I'm not sure you understood me correctly since I'm trying to avoid re-encoding. Here are 3 samples one is encoded using HEVC 8bit and the other HEVC 10bit with HandBrake and the final one is both videos merged with avidemux without re-encoding pay attention to the second half of the latter to understand my problem.

    https://drive.google.com/open?id=1SxJCgLKqtXm6_uFgnIraKFfiQx9ilpMm
    Last edited by Felow; 2nd Jan 2020 at 15:55.
    Quote Quote  
  6. Here are the two source files remuxed to TS and concatenated to a new TS using ffmpeg:

    Code:
    ffmpeg -y -i HandBrakeDefaultHEVC8Bit.mkv -codec copy cat1.ts
    ffmpeg -y -i HandBrakeHEVC10Bit.mkv -codec copy cat2.ts
    ffmpeg -y -i "concat:cat1.ts|cat2.ts" -c copy output.ts
    It plays fine in several players I tried. The file won't work properly in some editors.
    Image Attached Files
    Quote Quote  
  7. Originally Posted by jagabo View Post
    Here are the two source files remuxed to TS and concatenated to a new TS using ffmpeg:

    Code:
    ffmpeg -y -i HandBrakeDefaultHEVC8Bit.mkv -codec copy cat1.ts
    ffmpeg -y -i HandBrakeHEVC10Bit.mkv -codec copy cat2.ts
    ffmpeg -y -i "concat:cat1.ts|cat2.ts" -c copy output.ts
    It plays fine in several players I tried. The file won't work properly in some editors.
    Is there an ffmpeg command to do this with all the files inside a folder? similar to the commands "
    Code:
        (for %i in (*.mkv) do @echo file '%i') > mylist.txt ffmpeg -f concat -i mylist.txt -c copy output.mkv
    I have never remuxed files, is there a quality loss? (because I noticed that the merged files using TS have a size of 28,610kb and the original merged files are 26,418kb) finally can mkv be used instead of TS ?.

    Edit: VLC has trouble reading your file.
    Last edited by Felow; 12th Nov 2020 at 23:43. Reason: Important edit.
    Quote Quote  
  8. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Remuxing a video file won't mess with the quality, it simply puts it in a new container without re-encoding.
    Quote Quote  
  9. Originally Posted by Felow View Post
    Originally Posted by jagabo View Post
    Here are the two source files remuxed to TS and concatenated to a new TS using ffmpeg:

    Code:
    ffmpeg -y -i HandBrakeDefaultHEVC8Bit.mkv -codec copy cat1.ts
    ffmpeg -y -i HandBrakeHEVC10Bit.mkv -codec copy cat2.ts
    ffmpeg -y -i "concat:cat1.ts|cat2.ts" -c copy output.ts
    It plays fine in several players I tried. The file won't work properly in some editors.
    Is there an ffmpeg command to do this with all the files inside a folder? similar to the commands "
    Code:
        (for %i in (*.mkv) do @echo file '%i') > mylist.txt ffmpeg -f concat -i mylist.txt -c copy output.mkv
    You can do that in steps. First remux all the source files to TS, then concat all the TS files.

    Code:
    del mylist.txt
    for %%F in (*.mkv) do (
        echo file '%%~nF.ts' >>mylist.txt
        ffmpeg -y -i "%%~nxF" -codec copy "%%~nF.TS"
    )
    
    ffmpeg -y -f concat -safe 0 -i mylist.txt -c copy output.ts
    But I wouldn't do this routinely. Only when specifically needed. As noted, some editors will have problems handling the mixed content. They assume all the video in a file is the same. And you don't have control over the order of the files (you could sort the list after building it and before concatenating).

    Originally Posted by Felow View Post
    I have never remuxed files, is there a quality loss? (because I noticed that the merged files using TS have a size of 28,610kb and the original merged files are 26,418kb) finally can mkv be used instead of TS ?.
    There is no loss when remuxing. It's like taking a cake out of one box and putting it in another box. The cake is unchanged.
    Quote Quote  
  10. Originally Posted by KarMa View Post
    Remuxing a video file won't mess with the quality, it simply puts it in a new container without re-encoding.
    I see.. but how did changing the container from mkv to ts solve the problem?.
    Quote Quote  
  11. Originally Posted by Felow View Post
    Originally Posted by KarMa View Post
    Remuxing a video file won't mess with the quality, it simply puts it in a new container without re-encoding.
    I see.. but how did changing the container from mkv to ts solve the problem?.
    Transport streams are expected to switch properties. For example, a satellite TV station may broadcast the main show as 1080i but some ads at 720p or lower.
    Quote Quote  
  12. Originally Posted by jagabo View Post
    Originally Posted by Felow View Post
    Originally Posted by jagabo View Post
    Here are the two source files remuxed to TS and concatenated to a new TS using ffmpeg:

    Code:
    ffmpeg -y -i HandBrakeDefaultHEVC8Bit.mkv -codec copy cat1.ts
    ffmpeg -y -i HandBrakeHEVC10Bit.mkv -codec copy cat2.ts
    ffmpeg -y -i "concat:cat1.ts|cat2.ts" -c copy output.ts
    It plays fine in several players I tried. The file won't work properly in some editors.
    Is there an ffmpeg command to do this with all the files inside a folder? similar to the commands "
    Code:
        (for %i in (*.mkv) do @echo file '%i') > mylist.txt ffmpeg -f concat -i mylist.txt -c copy output.mkv
    You can do that in steps. First remux all the source files to TS, then concat all the TS files.

    Code:
    del mylist.txt
    for %%F in (*.mkv) do (
        echo file '%%~nF.ts' >>mylist.txt
        ffmpeg -y -i "%%~nxF" -codec copy "%%~nF.TS"
    )
    
    ffmpeg -y -f concat -safe 0 -i mylist.txt -c copy output.ts
    But I wouldn't do this routinely. Only when specifically needed. As noted, some editors will have problems handling the mixed content. They assume all the video in a file is the same. And you don't have control over the order of the files (you could sort the list after building it and before concatenating).

    Originally Posted by Felow View Post
    I have never remuxed files, is there a quality loss? (because I noticed that the merged files using TS have a size of 28,610kb and the original merged files are 26,418kb) finally can mkv be used instead of TS ?.
    There is no loss when remuxing. It's like taking a cake out of one box and putting it in another box. The cake is unchanged.
    You're right, I should avoid doing this since my main video player VLC has trouble reading the ts file but it works on windows 10 movies& Tv app. Now is there a way to know the bit depth of a video that was encoded with handbrake? all my videos are in one folder and I don't know which is which anymore.
    Last edited by Felow; 12th Nov 2020 at 23:44.
    Quote Quote  
  13. MediaInfo can show if the video is 8bit or 10bit. The command line version should let you automate the detection. I would guess ffprobe can do that too.
    Quote Quote  
  14. Originally Posted by jagabo View Post
    MediaInfo can show if the video is 8bit or 10bit. The command line version should let you automate the detection. I would guess ffprobe can do that too.
    Great! MediaInfo works fine but it doesn't show multiple Bit depths if files are merged https://imgur.com/a/SUWnp62 but that isn't a problem.

    So to summarize if someone in the future wanted to do what I asked for in the thread: The only way to do it without re-encoding is by remuxing the files into a TS container then concatenating them and this is best to be avoided since some video players have trouble handling mixed content (VLC does at the time of writing this).

    Thanks for the help.
    Quote Quote  
  15. It plays fine in several players I tried.
    ... and they will probably fail if you jump back from the 10bit to the 8bit part of the video and most tools for reencoding will also have problems with the content switching between 8bit and 10bit,... Yes, there are lots of things you can do with transport streams and even .avi files, but not everything that is possible should be done for compatibility reasons,..
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  16. Originally Posted by Felow View Post
    So to summarize if someone in the future wanted to do what I asked for in the thread: The only way to do it without re-encoding is by remuxing the files into a TS container then concatenating them …….
    Also don't forget the audio: Concatenation can badly fail and cause playback issues when the audio format is different between the files (codec, sampling rate …).
    Quote Quote  



Similar Threads

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