VideoHelp Forum
+ Reply to Thread
Page 16 of 16
FirstFirst ... 6 14 15 16
Results 451 to 464 of 464
Thread
  1. Member Ennio's Avatar
    Join Date
    May 2005
    Location
    Netherlands
    Search Comp PM
    Originally Posted by r0lZ View Post
    Note that you can also move up the whole picture of a movie shot in Cinemascope, to enlarge the bottom black bar. That might be useful when the font is too large and the two-lines subtitles do not fit well in the original black border.
    Yes, I already recognized this possibility in case of and prior to video recode.
    As for your answer to my question, there's some things I don't understand:

    Originally Posted by r0lZ View Post
    ...I had the intention to write another tool, that could read the depth values from an XML/PNG subtitle stream produced by BD3D2MK3D during the conversion of a subtitles to 3D.
    First off, to my knowledge BD3D2MK3D creates 3D subtitles according to already retrieved depth information from the offset planes. So why not directly read the depths from those? The answer probably has to do with me not fully understanding what exact info there is in a 3D-plane.

    Originally Posted by r0lZ View Post
    The XML file contains the depth value for all subtitles, and they can easily be edited with a text editor.
    ...and the depth values of the sequence without subtle will be lost.
    I gather BD3D2MK3D uses these XML/PNG-files only internally for creating the proper offsets between left- and right-eye subtitle images.

    But I am curious how in a 3D-plane the different subtitle offsets are "assigned" to the target SUP images. Where I can only make an educated guess that it is done by lead of timings-information.

    Originally Posted by r0lZ View Post
    Have a look at h264Offset3D in the BDTools package by Videofan3D. It might be exactly what you need, but I'm not sure. I have never used it. https://forum.doom9.org/showthread.php?t=174563
    Thanks for the link. I will definitely read on it.
    Quote Quote  
  2. Originally Posted by Ennio View Post
    First off, to my knowledge BD3D2MK3D creates 3D subtitles according to already retrieved depth information from the offset planes. So why not directly read the depths from those? The answer probably has to do with me not fully understanding what exact info there is in a 3D-plane.
    ...
    I gather BD3D2MK3D uses these XML/PNG-files only internally for creating the proper offsets between left- and right-eye subtitle images.
    The XML/PNG file is an intermediate step, that 's right. I need the PNG to convert the PNGs to 3D. But I've decided to write the <depth> tags in the XML for two reasons.
    1. The user may want to modify the PNG images, for example to change their contrast or luminosity. Of course, the PNG/XML must be the source of the new conversion, and it is easier for the user if he doesn't need to specify again the 3D-plane to use.
    2. But the main reason is that it is easy to edit the depth values in the XML to fix some wrong depth values. And in that case, the 3D-plane cannot be used, or it will overwrite the depths modified by the user. Therefore, the depth values must be stored in the XML.
    I agree that it is not obvious that the depths can be modified, as usually, the whole conversion is made in one step, during the preparation of the project. But the XML/PNG stream is not deleted at the end of the conversion, to let the user edit it and convert it again to the final subtitle stream, and remux the final MKV. It's a possibility for a power user, like many other features of BD3D2MK3D. BTW, it's also why there are many comments in the text files of the projects generated by BD3D2MK3D.


    Originally Posted by Ennio View Post
    But I am curious how in a 3D-plane the different subtitle offsets are "assigned" to the target SUP images. Where I can only make an educated guess that it is done by lead of timings-information.
    Not exactly. The MVC video stream is made of GOPs (groups of pictures), just like the AVC stream. The 3D-planes are stored as SEI messages, within the MVC stream. It is divided in as many small parts as they are GOPs in the video, and stored in the message of the corresponding GOP, so that the player can receive the information just when it needs it, to display the frames of the GOP and the 3D subtitle (if any) correctly. So, in each of these parts, there is one depth value per video frame. For example, if a GOP is made of, say, 40 frames, there will be 40 depth values stored in the corresponding part of the 3D-plane. Note that it's always the case, even if there is no subtle to display during the GOP (but in that case, the depth values can be undefined).

    My explanation above takes only one 3D-plane into account, but the BD specs specifies that there can be up to 32 3D-planes, for 32 different subtitle streams (although the same 3D-plane can be assigned to several subtitle streams.) And usually, all 32 3D-planes are specified, but most of them are totally undefined, or contain always the same depth value, and are therefore useless.

    So, what BD3D2MK3D does is just extract the 3D-planes from the MVC (and concatenate the different parts to obtain complete 3D-planes with as many depth values as there are frames in the whole movie), then it analyses the XML of the subtltle stream to know when each subtitle starts and ends, then it converts that timings to frame numbers, and it retrieves the depth values for that frames. The final depth is then selected among the different depth values corresponding to the subtitle (because, often, the depth of the subtitle changes during its display, for example because there is a cut in the video, possibly with an important change of depth of the whole scene). The final depth value is then written in the XML, and finally, the conversion of the XML/PNG to 3D can really begin!

    In the explanation above, I have used the usual term "3D-plane" instead of the correct term "offset sequence". Similarly, "depth" is used instead of "3D offset" or "offset value". But the processing doesn't depend on the terminology!
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  3. Member
    Join Date
    Sep 2005
    Location
    riyadh
    Search Comp PM
    Hi
    I need a way to output the left eye and right eye separately then put them back together again. I'm hoping there is something I can modify in the encode_3D script.
    Quote Quote  
  4. What type of frame do you need ? Full-size, or halved for HSBS or HTAB ? And why do you need to save the two views alone ? How would you like to recombine them ? To do what type of 3D video ?
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  5. Member
    Join Date
    Sep 2005
    Location
    riyadh
    Search Comp PM
    Originally Posted by r0lZ View Post
    What type of frame do you need ? Full-size, or halved for HSBS or HTAB ? And why do you need to save the two views alone ? How would you like to recombine them ? To do what type of 3D video ?
    Full sized TAB. I have a movie with one eye that has raised black levels. I would like to fix that then recombine them. I found a way to split the two eyes after encoding and maybe that's the best option. Although I'm not quite sure how I would re-combine them. I suppose I couldn't just replace:
    left = SelectEven(interleaved)
    right = SelectOdd(interleaved)

    with

    left = left.mkv
    right = right.mkv

    I think I will have to use ffmpeg to recombine them or hopefully I can just use mkvtoolnix.
    Quote Quote  
  6. You can use the two MKV as input, that's right (although the command is not correct) but the problem is that you will need te encode the video three times: the first time to create the two MKV, the second to fix the luminosity, and the third time to join the two parts. That means a significant quality loss! It's because, unfortunately, you cannot use ffmpeg or mkvtoolnix to recombine the two views. They must be re-encoded.

    IMO, the best method would be to edit the original avisynth script to add the command necessary to fix the bad eye, and then encode the full movie directly from the BD3D2MK3D project. You will need only one encoding. You should add a command like this in the script:
    right = Levels (right, parameters)
    (This is just an example. You may need another command, or several commands).

    The difficulty with avisynth is that it is not easy to see the result. Luckilly, AvsPmod comes to the rescue. You can load the two views in two tabs, and add the command(s) necessary to fix the problem in the tab with the bad eye. Then, you can modify the parameters of the command freely, and compare the result with the good view by switching from one tab to the other one. When you have a good result, simply copy the command in the avs script in the project, and encode it normally.

    Note that to load a MKV in an avisynth script, you will need to install the ffmpegsource avisynth plugin and use this command:
    FFMpegSource2("path/to/movie.mkv")
    This will create the default stream called "last". If you need to name it differently, use this:
    left = FFMpegSource2("path/to/movie.mkv")
    There are probably other plugins or commands that can load a MKV, but I know and use only this one.

    I agree that learning how to use avisynth is not easy and requires some time, but you will certainly get a much better result than if you re-encode the movie several times. And there is a lot of knowledgeable peoples able to help you in the avisynth dedicated forums here or at doom9.

    Good luck!
    Last edited by r0lZ; 5th Oct 2023 at 07:52.
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  7. Member
    Join Date
    Sep 2005
    Location
    riyadh
    Search Comp PM
    Originally Posted by r0lZ View Post
    You can use the two MKV as input, that's right (although the command is not correct) but the problem is that you will need te encode the video three times: the first time to create the two MKV, the second to fix the luminosity, and the third time to join the two parts. That means a significant quality loss! It's because, unfortunately, you cannot use ffmpeg or mkvtoolnix to recombine the two views. They must be re-encoded. ...
    Good luck!
    Thanks. I was hoping for a simple solution but the more I read, the more I realized it wasn't going to be so. In the end I used ffmpeg for almost everything. I split the BD3D2MK3D encoded movie into two mkv files, then I changed the levels on the problem eye. I think both of these were effectively lossless because the file sizes were almost identical. Then I used ffmpeg to join and re-encode the two mkv files. Finally I used mkvtoolnix to fix the resolution and re-add the original audio.

    If I have to do this again I might add extra ffmpeg commands to deal with the audio at the same time, or maybe I will remove the audio first then re-combine later. It would have been nice to be able to use the raw files created by BD3D2MK3D so that when complete it could mux them back together but I can't see any obvious way to do that. Thanks again
    Last edited by cdx47; 5th Oct 2023 at 08:00.
    Quote Quote  
  8. If you know already ffmpeg, you can probably use a ffmpeg plugin to insert the ffmpeg command in the avisynth script instead of the Levels () command, like explained in my previous post. That may be easier for you.
    And honestly, I don't think that ffmpeg is able to split the two views without re-encoding them, but I may be wrong. It's possible for JPEG images (with some limitations), but MPEG videos are much more complex.

    If you want to redo (almost) the same processing without using ffmpeg to split the two views, you can simply edit the avs script in the folder, like this:
    Code:
    interleaved = FRIMSource("mvc", "00009.track_4113.264", "00009.track_4114.mvc", layout = "alt", num_frames = 18668, cache = 2, platform = "")
    right = SelectEven(interleaved)
    left  = SelectOdd(interleaved)
    return(left)
    __END__
    (the rest of the script is ignored)
    Encode this script to obtain the left eye h264 stream. Then replace the return command with return(right) to encode the right eye view.
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  9. Member
    Join Date
    Sep 2005
    Location
    riyadh
    Search Comp PM
    Originally Posted by r0lZ View Post
    If you know already ffmpeg, you can probably use a ffmpeg plugin to insert the ffmpeg command in the avisynth script instead of the Levels () command, like explained in my previous post. That may be easier for you.
    And honestly, I don't think that ffmpeg is able to split the two views without re-encoding them, but I may be wrong. It's possible for JPEG images (with some limitations), but MPEG videos are much more complex.

    If you want to redo (almost) the same processing without using ffmpeg to split the two views, you can simply edit the avs script in the folder, like this:
    Code:
    interleaved = FRIMSource("mvc", "00009.track_4113.264", "00009.track_4114.mvc", layout = "alt", num_frames = 18668, cache = 2, platform = "")
    right = SelectEven(interleaved)
    left  = SelectOdd(interleaved)
    return(left)
    __END__
    (the rest of the script is ignored)
    Encode this script to obtain the left eye h264 stream. Then replace the return command with return(right) to encode the right eye view.
    Excellent! This might form the basis of being able to semi-automate it in future. I know very little about ffmpeg lol, but I used the "FFMPEG Filters Document" reference site to work out what the commands I found were doing. Then I modified them for my needs.

    BTW looking at the bit-rates they are definitely lower in the ffmpeg re-encoded movie even though visually it looks pretty much identical on a large screen. But I agree with you about the potential for quality loss. So it occurs to me that if I do need to do anything like this in the future I will try to use the ripped disc as the source with ffmpeg all the way. At least that way I'm starting from the original source.
    Last edited by cdx47; 5th Oct 2023 at 08:26.
    Quote Quote  
  10. Member
    Join Date
    Sep 2005
    Location
    riyadh
    Search Comp PM
    Originally Posted by r0lZ View Post
    You can use the two MKV as input, that's right (although the command is not correct) but the problem is that you will need te encode the video three times: the first time to create the two MKV, the second to fix the luminosity, and the third time to join the two parts. That means a significant quality loss! It's because, unfortunately, you cannot use ffmpeg or mkvtoolnix to recombine the two views. They must be re-encoded.
    I had another look and yes the file is encoded 3 times. The results are fine and looks about the same as the original, but the completist in me is not happy. So I tested creating the left/right eyes from a frame-packed rip using CRF16 which is identical to the version I created with your tool and that works. So I can use that option to at least remove one generation of potential quality loss. But I'm going to try the AVS method to create the left and right eyes and maybe even try to modify the brightness of one eye.

    Edit: I created a test file using the Tweak command in the avs file for the left eye without having to separately export left and right eye files. Seems to work which means everything gets done in one go using a modified version of your script. If you don't hear from me again then it works
    Last edited by cdx47; 13th Oct 2023 at 17:25.
    Quote Quote  
  11. Perfect.
    Have you used AvsPmod to fine-tune the effect?
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  12. Member
    Join Date
    Sep 2005
    Location
    riyadh
    Search Comp PM
    Originally Posted by r0lZ View Post
    Perfect.
    Have you used AvsPmod to fine-tune the effect?
    Nope, never heard of it but I wish I did lol. I just used a previous example you gave me to create very short output files then modded the mux file to only mux the picture. I will download AvsPmod because it could be very useful. I can imagine that I want transform an image or a particular eye in the future.

    I've learned a lot over the last few years looking at your batch and avisynth scripts as well as the json files
    Last edited by cdx47; 5th Oct 2023 at 17:49.
    Quote Quote  
  13. AvsPmod is some kind of GUI for Avisynth. When you know how to use it, it is invaluable!

    Thanks for the positive appreciation about the files generated by BD3D2MK3D. 🙂

    Have fun with your 3D movies!
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  14. Member Ennio's Avatar
    Join Date
    May 2005
    Location
    Netherlands
    Search Comp PM
    Hi r0lZ,
    A short thanks for your crystal clear explanations. The SEI messaging for each GOP took a lot of clouds away.
    I am now reading up on the "h264Offset3D.exe" tool which indeed seems the thing right up my street.
    Will keep it short as I don't intend on further pollution of this thread.
    Quote Quote  



Similar Threads

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