Converting MPEG-TS to MKV with hard coded subtitles produces error message
Hello, I want to convert an MPEG-TS from a Humax PVR to a MKV with H.264 encoded video with hard coded DVB subtitles. Unfortunately, having downloaded a build from ffmpeg.zeranoe.com, instead of hard coded subtitles I am getting "sub2video: rectangle overflowing" messages. I've tweaked ffmpeg.c to display the parameters causing the message and built a cut down ffmpeg. (I have built a toolchain using Zeranoe's build script and built libogg, libvorbis, libx264 and pthreads-win32 from source). The message is output because the video stream is 704x576 but the subtitle rectangles are 720 wide. If I tweak function sub2video_prepare in ffmpeg_filter.c to hard code the canvas width and height to be 720 and 576 respectively then I can produce an MKV with hard coded DVB subtitles with the command: ffmpeg -i in.TS -filter_complex "[0:v]pad=720:576[main];[main][0:s]overlay" -sn out.MKV I've tried cropping the subtitle stream before overlaying but still get the "sub2video: rectangle overflowing" messages with the Zeranoe build. I've also tried scaling the video stream and padding the video stream. I think the canvas size is assigned equal to the video stream size before applying the filters. Hence, scaling or padding the video stream doesn't increase the canvas size to match the subtitle rectangle dimensions. Is there a filter sequence that would accommodate the subtitle rectangle dimensions being larger than the video stream dimensions? Or does the sub2video "hack" not cater for this situation? Many thanks, Stu
Le sextidi 26 pluviôse, an CCXXI, Stuart a écrit :
I've tried cropping the subtitle stream before overlaying but still get the "sub2video: rectangle overflowing" messages with the Zeranoe build. I've also tried scaling the video stream and padding the video stream. I think the canvas size is assigned equal to the video stream size before applying the filters. Hence, scaling or padding the video stream doesn't increase the canvas size to match the subtitle rectangle dimensions.
That is exactly that. Except if the resolution of the canvas for the subtitles is known, which can happen for vobsub or pgssub. Normally, you should be able to specify the resolution using the -s option: "-s:s 720x576" should do the trick. Regards, -- Nicolas George
Hello Nicolas, Thank you for the reply. I've now tried adding the "-s:s 720x576" option as you suggested but the result has not changed. Is the position significant? The command is now: ffmpeg -i Suburgatory-20121110-1024.TS -s:s 720x576 -filter_complex "[0:v][0:s]overlay" -sn sub.mkv The canvas does not appear to have changed size and I still get the "sub2video: rectangle overflowing" messages. The output contains: [mpegts @ 000000000068fa60] sub2video: using 704x576 canvas Having found the "-s" option in the documentation I wonder if the optiononly applies to video streams? Many thanks, Stuart
Le septidi 27 pluviôse, an CCXXI, Stuart a écrit :
Thank you for the reply. I've now tried adding the "-s:s 720x576" option as you suggested but the result has not changed. Is the position significant? The command is now:
ffmpeg -i Suburgatory-20121110-1024.TS -s:s 720x576 -filter_complex "[0:v][0:s]overlay" -sn sub.mkv
The canvas does not appear to have changed size and I still get the "sub2video: rectangle overflowing" messages. The output contains:
The -s:s option should have been before the -i option, but it would not have worked, I remembered wrong how it applies. There is right now no way of setting the canvas size so that it will work like that. I will try to think of something not too ugly. In the meantime, you can try to remux your input file with an additional video stream with resolution 720x576 that will only just be used to set the canvas size. Regards, -- Nicolas George
Hello Nicolas, Thanks again for the suggestions. I had tried adding the "-s:s 720x576" before the "-i" option but that caused the message "Option video_size not found". I jumped to the wrong conclusion that I needed to put the option after the "-i". Now I know better. While you're thinking of beautiful solutions, I'll try the remux work-around. Many thanks, Stuart
How about trying Handbrake? It support customize output V&A resolution parameters before conversion. -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Converting-MPEG-TS-to-MKV-with-hard... Sent from the FFmpeg-users mailing list archive at Nabble.com.
participants (3)
-
Nepheler -
Nicolas George -
Stuart