VideoHelp Forum
+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 57 of 57
Thread
  1. Originally Posted by jagabo View Post
    Originally Posted by matalog View Post
    I am now at the stage that I plan to use individual half height images to create an interlaced video that I only want to burn to DVD - absolutely maintaining the interlaced format, as individual Top and Bottom fields - in 576i (25i) format. I will be creating the images that I want for each field, and then encoding them like this: Top1.bmp,Bottom1.bmp,Top2.bmp,Bottom2.bmp.... etc. Those images will each become a field in the interlaced video.
    Something like this with leading zeros (eg, top00005.bmp):
    Code:
    t = ImageSource("top%05d.bmp", start=0, end=14)
    b = ImageSource("bottom%05d.bmp", start=0, end=14)
    Interleave(t, b)
    AssumeFieldBased()
    AssumeTFF()
    Weave()
    AssumeFPS(25000, 1000) # or 30000, 1001
    Is there any way to do this same thing with FFMpeg? I haven't used AVISynth before and I'm not really getting on well with VirtualDub 2.
    Quote Quote  
  2. Is there any way to do this same thing with FFMpeg?
    Try this, it should produce an interlaced mpeg2 .vob file from your field images.
    Code:
    ffmpeg -f image2 -i "top%%5d.png" -i "bottom%%5d.png" -c:v mpeg2video -b:v 5000k -maxrate 8000k -bf 2 -b_strategy 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -mpv_flags qp_rd -flags +ilme+ildct -filter_complex vstack,il=l=i:c=i,framerate=25,scale=interl=1,setfield=tff,setdar=4/3  "output.vob"
    Last edited by Sharc; 8th Sep 2024 at 18:09.
    Quote Quote  
  3. Originally Posted by Sharc View Post
    Is there any way to do this same thing with FFMpeg?
    Try this, it should produce an interlaced mpeg2 .vob file from your field images.
    Code:
    ffmpeg -f image2 -i "top%%5d.png" -i "bottom%%5d.png" -c:v mpeg2video -b:v 5000k -maxrate 8000k -bf 2 -b_strategy 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -mpv_flags qp_rd -flags +ilme+ildct -filter_complex vstack,il=l=i:c=i,framerate=25,scale=interl=1,setfield=tff,setdar=4/3  "output.vob"
    Yes that seems to be working fine, just had to remove a % from each filename. Thanks. Can I tell ffmpeg to put the bottom field first?
    Quote Quote  
  4. Originally Posted by matalog View Post
    Can I tell ffmpeg to put the bottom field first?
    Yes. See the blue change in the commandline (setfield=bff).
    Code:
    ffmpeg -f image2 -i "top%%5d.png" -i "bottom%%5d.png" -c:v mpeg2video -b:v 5000k -maxrate 8000k -bf 2 -b_strategy 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -mpv_flags qp_rd -flags +ilme+ildct -filter_complex vstack,il=l=i:c=i,framerate=25,scale=interl=1,setfield=bff,setdar=4/3  "output.vob"
    P.S. You can eventually load such .vob(s) into DVDStyler to create and burn DVD compliant discs with navigation menus etc.
    Last edited by Sharc; 9th Sep 2024 at 04:38.
    Quote Quote  
  5. deleted, obsolete
    Last edited by Sharc; 9th Sep 2024 at 05:55.
    Quote Quote  
  6. Originally Posted by matalog View Post
    Yes that seems to be working fine, just had to remove a % from each filename.
    My scripts for the fields extraction:
    Code:
    ffmpeg -i "%~1" -an -sn -vf field=top -frames:v 20 top%%05d.png
    ffmpeg -i "%~1" -an -sn -vf field=bottom -frames:v 20 bottom%%05d.png
    The -frames:v xx defines how many fields will be extracted (for testing).
    Quote Quote  
  7. Originally Posted by Sharc View Post
    Originally Posted by matalog View Post
    Can I tell ffmpeg to put the bottom field first?
    Yes. See the blue change in the commandline (setfield=bff).
    Code:
    ffmpeg -f image2 -i "top%%5d.png" -i "bottom%%5d.png" -c:v mpeg2video -b:v 5000k -maxrate 8000k -bf 2 -b_strategy 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -mpv_flags qp_rd -flags +ilme+ildct -filter_complex vstack,il=l=i:c=i,framerate=25,scale=interl=1,setfield=bff,setdar=4/3  "output.vob"
    P.S. You can eventually load such .vob(s) into DVDStyler to create and burn DVD compliant discs with navigation menus etc.
    Thanks, although, i'm not sure that setfield=bff does actually make sure that the bottom field is put first, at least not with playback with

    Code:
    ffplay -i "%~1" -loop 1 -an -sn -vf "setfield=tff,separatefields" -vf "setfield=bff,separatefields"
    I seem to have been able to change the field order using:

    Code:
    ffmpeg -f image2 -i "bottom%5d.png" -i "top%5d.png" -c:v mpeg2video -b:v 5000k -maxrate 8000k -bf 2 -b_strategy 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -mpv_flags qp_rd -flags +ilme+ildct -filter_complex vstack,il=l=i:c=i,framerate=25,scale=interl=1,setfield=bff,setdar=4/3  "output.vob"
    Quote Quote  
  8. Yes, for changing the order you have to change the input sequence as well not just the flag. If you have doubts upload a short sample so I can check what it is. Flag and field order should be consistent.
    Last edited by Sharc; 9th Sep 2024 at 16:31.
    Quote Quote  
  9. Here are 2 clips from the final output, nothing much to see, but they seem to be encoded correctly - to be decoded by the method used in the 1980's description.

    All I changed in them was to have setfield=bff or setfield=tff. Can you see any difference that a PAL DVD player will discern?

    Code:
    ffmpeg -f image2 -i "bottom%4d.bmp" -i "top%4d.bmp" -c:v mpeg2video -b:v 5000k -maxrate 8000k -bf 2 -b_strategy 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -mpv_flags qp_rd -flags +ilme+ildct -filter_complex vstack,il=l=i:c=i,framerate=25,scale=interl=1,setfield=tff,setdar=4/3  "outputTEST2_TF.vob"


    https://forum.videohelp.com/attachment.php?attachmentid=82107&stc=1&d=1725918201

    https://forum.videohelp.com/attachment.php?attachmentid=82108&stc=1&d=1725918201
    Image Attached Files
    Quote Quote  
  10. Pretty sure the original poster is trying to do this specifically:
    https://www.youtube.com/watch?v=VRcs_TUpQ6g

    Essentially the photodiode is collecting binary data that was transmitted from an old broadcast transmission.

    In the original video, it probably didn't work because the original interlacing was not preserved at all conversion steps.



    Here are a few possibilities that I don't think were considered in the above video to get that to read correctly:

    1. Display the native data on a PAL-capable CRT (this is how it was originally transmitted and expected to be read) - As far as how to get that digital file into a format that the CRT can read, easiest thing would be to burn your archival copy onto a DVD and play it via composite to the CRT (in this case, it'd need to be a PAL-capable CRT). The DVD authoring software needs to know that you are making a PAL DVD though, or it will mess with the framerate.

    2. "Line double" the interlaced footage and you'll be left with a progressive file that can be played on any LCD monitor with the original aspect ratio and the field rate then becomes the frame rate. (50i becomes 50p). This can also be done in hardware using something like the Retrotink 2x and a DVD interlaced source and you can then play that to any LCD monitor or TV via HDMI as 576p50fps

    3. Separate each field into a progressive frame and just be ok with the half-height result which will still be plenty large enough for the photodiode to read from on a large LCD screen.
    Last edited by aramkolt; 9th Sep 2024 at 17:07.
    Quote Quote  
  11. Originally Posted by matalog View Post
    Here are 2 clips from the final output, nothing much to see, but they seem to be encoded correctly - to be decoded by the method used in the 1980's description.

    All I changed in them was to have setfield=bff or setfield=tff. Can you see any difference that a PAL DVD player will discern?

    Code:
    ffmpeg -f image2 -i "bottom%4d.bmp" -i "top%4d.bmp" -c:v mpeg2video -b:v 5000k -maxrate 8000k -bf 2 -b_strategy 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -mpv_flags qp_rd -flags +ilme+ildct -filter_complex vstack,il=l=i:c=i,framerate=25,scale=interl=1,setfield=tff,setdar=4/3  "outputTEST2_TF.vob"


    https://forum.videohelp.com/attachment.php?attachmentid=82107&stc=1&d=1725918201

    https://forum.videohelp.com/attachment.php?attachmentid=82108&stc=1&d=1725918201
    Quick check only: The flags are consistent with the file name, but the squares sequence of the fields seems to be different for the 2..... The BF file seems to be conflicting flag vs true order. I need to take a closer look tomorrow .....
    Last edited by Sharc; 9th Sep 2024 at 17:18.
    Quote Quote  
  12. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    Originally Posted by aramkolt View Post
    Pretty sure the original poster is trying to do this specifically:
    https://www.youtube.com/watch?v=VRcs_TUpQ6g

    Essentially the photodiode is collecting binary data that was transmitted from an old broadcast transmission.
    Interestingly, I watched that video 2 weeks ago, not sure why it was on my suggestion list. Yeah not sure why the OP doesn't state what he is doing, this doesn't look like an intelligence project.
    Quote Quote  
  13. Originally Posted by aramkolt View Post
    Pretty sure the original poster is trying to do this specifically:
    https://www.youtube.com/watch?v=VRcs_TUpQ6g

    Essentially the photodiode is collecting binary data that was transmitted from an old broadcast transmission.

    In the original video, it probably didn't work because the original interlacing was not preserved at all conversion steps.



    Here are a few possibilities that I don't think were considered in the above video to get that to read correctly:

    1. Display the native data on a PAL-capable CRT (this is how it was originally transmitted and expected to be read) - As far as how to get that digital file into a format that the CRT can read, easiest thing would be to burn your archival copy onto a DVD and play it via composite to the CRT (in this case, it'd need to be a PAL-capable CRT). The DVD authoring software needs to know that you are making a PAL DVD though, or it will mess with the framerate.

    2. "Line double" the interlaced footage and you'll be left with a progressive file that can be played on any LCD monitor with the original aspect ratio and the field rate then becomes the frame rate. (50i becomes 50p). This can also be done in hardware using something like the Retrotink 2x and a DVD interlaced source and you can then play that to any LCD monitor or TV via HDMI as 576p50fps

    3. Separate each field into a progressive frame and just be ok with the half-height result which will still be plenty large enough for the photodiode to read from on a large LCD screen.
    Good post. As I understand the OP's problem he doesn't just want to decode the data but he wants to substitute these by his own data which he provides as a series of images to be eventually inserted into the original (or a new) interlaced video.
    Quote Quote  
  14. Originally Posted by matalog View Post
    Here are 2 clips from the final output, nothing much to see, but they seem to be encoded correctly - to be decoded by the method used in the 1980's description.

    All I changed in them was to have setfield=bff or setfield=tff. Can you see any difference that a PAL DVD player will discern?

    Code:
    ffmpeg -f image2 -i "bottom%4d.bmp" -i "top%4d.bmp" -c:v mpeg2video -b:v 5000k -maxrate 8000k -bf 2 -b_strategy 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -mpv_flags qp_rd -flags +ilme+ildct -filter_complex vstack,il=l=i:c=i,framerate=25,scale=interl=1,setfield=tff,setdar=4/3  "outputTEST2_TF.vob"


    https://forum.videohelp.com/attachment.php?attachmentid=82107&stc=1&d=1725918201

    https://forum.videohelp.com/attachment.php?attachmentid=82108&stc=1&d=1725918201
    Attached the patterns for fields view (CRT or bob deinterlaced) and woven frames view (progressive LCD monitor) for the first 76 fields. Only you know which one is correct and what you need. The fields order should also be looked at together with the underlying natural interlaced video. If the order is wrong one would get jerky playback for motion scenes on a progressive monitor after deinterlacing.
    Image Attached Thumbnails patterns.pdf  

    Last edited by Sharc; 10th Sep 2024 at 05:40. Reason: typos
    Quote Quote  
  15. Attached the patterns for fields view (CRT or bob deinterlaced) and woven frames view (progressive LCD monitor) for the first 76 fields. Only you know which one is correct and what you need. The fields order should also be looked at together with the underlying natural interlaced video. If the order is wrong one would get jerky playback for motion scenes on a progressive monitor after deinterlacing.
    Thanks, that PDF is a very useful way to look at the output for this project. Was that output from a program you wrote, or something that you can share?
    Quote Quote  
  16. It's what you will see as output from this Avisynth script, manually put into a table as you are not familiar with Avisynth
    Code:
    v1=LWLibavVideoSource("outputTEST1_BF.vob").subtitle("BF")
    v2=LWLIbavVideoSource("outputTEST2_TF.vob").subtitle("TF")
    v1=v1.assumeBFF()
    v2=v2.assumeTFF()
    
    v1sep=v1.separatefields()
    v2sep=v2.separatefields()
    
    
    #---------display options-----------------
    stacked=stackhorizontal(v1,v2) #frames view
    stackedsep=stackhorizontal(v1sep,v2sep) #fields view
    
    return stacked  #or stackedsep
    Example (left is your BF file, right is your TF file)
    Frame#15 (gray/gray in the table)
    Image
    [Attachment 82124 - Click to enlarge]


    Field#30 (black/white in the table)
    Image
    [Attachment 82125 - Click to enlarge]

    Field#31 (white/black in the table)
    Image
    [Attachment 82126 - Click to enlarge]
    Last edited by Sharc; 10th Sep 2024 at 07:05.
    Quote Quote  
  17. Originally Posted by Sharc View Post
    Originally Posted by matalog View Post
    Here are 2 clips from the final output, nothing much to see, but they seem to be encoded correctly - to be decoded by the method used in the 1980's description.

    All I changed in them was to have setfield=bff or setfield=tff. Can you see any difference that a PAL DVD player will discern?

    Code:
    ffmpeg -f image2 -i "bottom%4d.bmp" -i "top%4d.bmp" -c:v mpeg2video -b:v 5000k -maxrate 8000k -bf 2 -b_strategy 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -mpv_flags qp_rd -flags +ilme+ildct -filter_complex vstack,il=l=i:c=i,framerate=25,scale=interl=1,setfield=tff,setdar=4/3  "outputTEST2_TF.vob"


    https://forum.videohelp.com/attachment.php?attachmentid=82107&stc=1&d=1725918201

    https://forum.videohelp.com/attachment.php?attachmentid=82108&stc=1&d=1725918201
    Attached the patterns for fields view (CRT or bob deinterlaced) and woven frames view (progressive LCD monitor) for the first 76 fields. Only you know which one is correct and what you need. The fields order should also be looked at together with the underlying natural interlaced video. If the order is wrong one would get jerky playback for motion scenes on a progressive monitor after deinterlacing.
    I've just been testing ffplay vs your results, and they are not the same. Using:

    Code:
    ffplay -i "outputTEST1_BF.vob" -loop 1 -an -sn -vf "setfield=tff,separatefields" -vf "setfield=bff,separatefields"
    and

    Code:
    ffplay -i "outputTEST2_TF.vob" -loop 1 -an -sn -vf "setfield=tff,separatefields" -vf "setfield=bff,separatefields"
    The fields show in the same order as eachother.

    What would be causing the difference to what you expected? And which would I expect a DVD player to do?
    Quote Quote  
  18. The Avisynth/.pdf is more trustful I'd assume. Avisynth's LWLibavVideoSource filter decodes the stream like a DVD player.
    The ffplay commandline switches the field playback order with the w key (requires a few frames for adjusting) and there might then be discrepancies between the flag and the true field order as well as issues with random seeking. Not sure.
    I am away from home for a few days now with no access to my desktop.....
    Last edited by Sharc; 10th Sep 2024 at 09:48.
    Quote Quote  
  19. I have burned some files to a dvd and now that i'm using the phototransistor to read the consecutive fields, I don't seem to be getting any of the expected results. When I say expected results, I mean that I am not reading 0 and 1 fields from the phototransistor, the same as I encoded them to the box on screen with ffmpeg - nor are they what ffmpeg suggested they would be, nor the results from the pdf that Sharc shared.

    I'm pretty sure that the phototransistor is mainly reliable, because when I play a file on the DVD that was 0,1,0,1,0,1,0,1 etc for each field, the result from the phototransistor is 0,1,0,1,0,1,0,1 etc.

    Is there a way to forget about top and bottom, and just definitely make a video from field1.bmp,field2.bmp,field3.bmp,field4.bmp etc?
    Quote Quote  
  20. Are you playing on an interlaced CRT or a progressive LCD? The only way to get 60 fields per second from a DVD is to encode interlaced; DVD doesn't support 60p mpg. Even then you may not get 60 fields on an LCD display since the video has to be deinterlaced.

    What do you get with other patterns? Like 0,0,1,0,0,1,0,0,1 or 0, 1, 1, 0, 1, 1, 0, 1, 1 or 0, 0, 1, 1, 0, 0, 1, 1? A progressive LCD will attempt to deinterlace and produce unreliable output. What you get from patterns like that may give hints about what the player/TV are doing.
    Last edited by jagabo; 13th Sep 2024 at 19:11.
    Quote Quote  
  21. Originally Posted by jagabo View Post
    Are you playing on an interlaced CRT or a progressive LCD? The only way to get 60 fields per second from a DVD is to encode interlaced; DVD doesn't support 60p mpg. Even then you may not get 60 fields on an LCD display since the video has to be deinterlaced.

    What do you get with other patterns? Like 0,0,1,0,0,1,0,0,1 or 0, 1, 1, 0, 1, 1, 0, 1, 1 or 0, 0, 1, 1, 0, 0, 1, 1? A progressive LCD will attempt to deinterlace and produce unreliable output. What you get from patterns like that may give hints about what the player/TV are doing.
    I'm playing videos made with ffmpeg for viewing at 25i played back on a PAL DVD player on a PAL CRT. I set each field individually either a black square or a white square, and now that I am actually using the DVD, they don't seem to be playing back in the expected order - apart from the 0,1,0,1,0,1,0,1,0,1 video.

    I have not made other short patterns yet. I'm at work all day now.
    Quote Quote  
  22. Check the field order of the DVD. The wrong field order with 0,1,0,1,0,1... will play back with a pairwise reversed pattern of 1,0,1,0,1,0... which looks the same. But most other patterns will be scrambled.
    Quote Quote  
  23. Originally Posted by jagabo View Post
    Check the field order of the DVD. The wrong field order with 0,1,0,1,0,1... will play back with a pairwise reversed pattern of 1,0,1,0,1,0... which looks the same. But most other patterns will be scrambled.
    How could I check the field order of the DVD?
    Quote Quote  
  24. Use MediaInfo on the VOB file. You can also check experimentally: write the pattern 11110100 and see if it comes back as 11111000.
    Quote Quote  
  25. Originally Posted by Sharc View Post
    Originally Posted by matalog View Post
    Here are 2 clips from the final output, nothing much to see, but they seem to be encoded correctly - to be decoded by the method used in the 1980's description.

    All I changed in them was to have setfield=bff or setfield=tff. Can you see any difference that a PAL DVD player will discern?

    Code:
    ffmpeg -f image2 -i "bottom%4d.bmp" -i "top%4d.bmp" -c:v mpeg2video -b:v 5000k -maxrate 8000k -bf 2 -b_strategy 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -mpv_flags qp_rd -flags +ilme+ildct -filter_complex vstack,il=l=i:c=i,framerate=25,scale=interl=1,setfield=tff,setdar=4/3  "outputTEST2_TF.vob"


    https://forum.videohelp.com/attachment.php?attachmentid=82107&stc=1&d=1725918201

    https://forum.videohelp.com/attachment.php?attachmentid=82108&stc=1&d=1725918201
    Attached the patterns for fields view (CRT or bob deinterlaced) and woven frames view (progressive LCD monitor) for the first 76 fields. Only you know which one is correct and what you need. The fields order should also be looked at together with the underlying natural interlaced video. If the order is wrong one would get jerky playback for motion scenes on a progressive monitor after deinterlacing.
    I have tested burning these 2 files to DVD using DVD Styler and they both playback on my PAL CRT like Test1BFF in your PDF, whereas the way that I want them to playback is your result for Test2TFF. Any ideas how to get them to play the way that I want?
    Quote Quote  
  26. Originally Posted by matalog View Post
    Originally Posted by Sharc View Post
    Originally Posted by matalog View Post
    Here are 2 clips from the final output, nothing much to see, but they seem to be encoded correctly - to be decoded by the method used in the 1980's description.

    All I changed in them was to have setfield=bff or setfield=tff. Can you see any difference that a PAL DVD player will discern?

    Code:
    ffmpeg -f image2 -i "bottom%4d.bmp" -i "top%4d.bmp" -c:v mpeg2video -b:v 5000k -maxrate 8000k -bf 2 -b_strategy 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -mpv_flags qp_rd -flags +ilme+ildct -filter_complex vstack,il=l=i:c=i,framerate=25,scale=interl=1,setfield=tff,setdar=4/3  "outputTEST2_TF.vob"


    https://forum.videohelp.com/attachment.php?attachmentid=82107&stc=1&d=1725918201

    https://forum.videohelp.com/attachment.php?attachmentid=82108&stc=1&d=1725918201
    Attached the patterns for fields view (CRT or bob deinterlaced) and woven frames view (progressive LCD monitor) for the first 76 fields. Only you know which one is correct and what you need. The fields order should also be looked at together with the underlying natural interlaced video. If the order is wrong one would get jerky playback for motion scenes on a progressive monitor after deinterlacing.
    I have tested burning these 2 files to DVD using DVD Styler and they both playback on my PAL CRT like Test1BFF in your PDF, whereas the way that I want them to playback is your result for Test2TFF. Any ideas how to get them to play the way that I want?
    Change the field order setting in dvdstyler. I am away from home a few days so I cannot verify.
    Quote Quote  
  27. I was able to just change the frames I used as images to put the first one as the one I wanted and encode the same way.

    Thanks for all the help in this thread, I got what I needed to done.
    Quote Quote  



Similar Threads

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