Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
5th October 2020, 21:57 | #1 | Link |
Registered User
Join Date: Jun 2007
Location: Ann Arbor, MI
Posts: 124
|
Can't create mp4 from avs with ffmpeg
I'm just trying to include a blank slide with a subtitle between clips using same size, fps,audio, etc.. I'm using the following (with and without the tone and audiodub):
Code:
fa=Tone(length=3.0, type="Silence", samplerate=30, channels=2) v=BlankClip(90,1280,720) sld=audiodub(v,fa) sld=Subtitle(sld,"This is a test", align=5, size=24) sld=sld.convertFPS(30) sld=sld.ConvertToRGB32() sld=sld.SSRC(22050, fast = True) sld ffmpeg -i clip.avs clip.mp4 Does anyone know what I'm doing wrong?
__________________
Life is more interesting viewed upside down |
6th October 2020, 15:16 | #2 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,346
|
What does the ffmpeg console output say ?
What format are the clips ? Ideally you'd want to match them. When I run that script and commandline I get AVC YUV444 and AAC audio How are you checking the output video ? Some programs might not be able to play AVC in YUV444 configuration Do you have x86 / x64 mismatch between ffmpeg, avisynth ? You're sending RGB32, but by default ffmpeg will convert to YUV444 unless you use -c:v libx264rgb . Or you can add ConvertToYV12(matrix="rec709") in the script for typical usage 4:2:0 |
6th October 2020, 19:59 | #4 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Last line "sld" == "Last=sld", and implied "Return Last" at end of script, exactly same effect as "Return sld". Think PDR got it all covered in his post.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
6th October 2020, 23:54 | #5 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
"sld" as the final statement in a block is simply defined to mean "return sld" - there is no implied "return last". (It is a myth that "return last" is the default action, and there are some cases when 'last' is not returned, such as when the final expression is not a clip. See here.) |
|
7th October 2020, 10:09 | #6 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
I stand corrected,
tis reassuring but also slightly disconcerting to know that you are constantly on 'my case', waiting to spank me at the 1st opportunity. Nice to see that you are still alive [comment on covid, not your age, but also nice for that too].
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
9th October 2020, 18:35 | #7 | Link |
Registered User
Join Date: Jun 2007
Location: Ann Arbor, MI
Posts: 124
|
Thanks guys, sorry about the delay... out of the office for a while. I started to answer PoisonDeathRay's questions but I thought I'd try to narrow things down first and found something... again that I don't understand. I set up a test to create an .mp4 from a single .avs with that code. I found that if I comment out the line, sld=sld.SSRC(22050, fast = True), it works! That's there to match all the other clips audio. So, why would that stop the subtitle from showing??
__________________
Life is more interesting viewed upside down |
9th October 2020, 20:27 | #8 | Link |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,419
|
It shouldn't, and I couldn't reproduce any of this here. The script as given, with or without the SSRC line commented out, when converted as demonstrated in the OP, still produces a video clip with the subtitle visible.
When it doesn't, is when trying to preview the script using ffplay (or mpv using the default vo=gpu), but that's a known quirk of how the alpha channel is initialized and how libavformat responds to it. BlankClip defaults to generating RGB32 clips, so omit ConvertToRGB32 entirely. You don't need it. You can fix the alpha issue by using RGBAdjust(ab=255). You could also tell BlankClip to generate RGB24 using pixel_type="RGB24" and then follow it with AddAlphaPlane(), which makes it bgra but gives it the correct opacity value so that you can see what the video looks like: Code:
fa=Tone(length=3.0, type="Silence", samplerate=22050, channels=2) v=BlankClip(90,1280,720,pixel_type="RGB24",fps=30).AddAlphaPlane() AudioDub(v,fa).Subtitle("This is a test", align=5, size=24) |
10th October 2020, 13:46 | #11 | Link |
Registered User
Join Date: Jun 2007
Location: Ann Arbor, MI
Posts: 124
|
I'm on 2.6.0... I thought that was the latest official build from http://avisynth.nl/index.php/Main_Page. is that not the right place?
__________________
Life is more interesting viewed upside down |
10th October 2020, 17:41 | #12 | Link |
Registered User
Join Date: Jun 2007
Location: Ann Arbor, MI
Posts: 124
|
Ok, I uninstalled 2.6.0 and installed Avisynth+ 3.6.1, ran the code you posted in a file called gs_10.avs, and double-clicked the .avs, and it displays correctly. Then I used the following:
ffmpeg -i gs_10.avs gs_10.mp4 I have a black, blank screen. gyot27, I know you didn't have any trouble doing this so I'm not sure what I'm doing wrong!
__________________
Life is more interesting viewed upside down |
Tags |
avisynth, subtitle |
Thread Tools | Search this Thread |
Display Modes | |
|
|