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. |
|
|
Thread Tools | Search this Thread | Display Modes |
13th June 2016, 21:02 | #1 | Link |
Registered User
Join Date: Jun 2007
Location: Ann Arbor, MI
Posts: 124
|
.jpg + .mp3 one length as .avs another after ffmpeg produces file
I have been putting audio behind .jpg's for years. I just started using .mp3 for the audio and am getting results I don't understand. I produce the .avs file and AVIsynth 2.6 with:
Code:
vd = DirectShowSource("Slide7.mp3", fps = 15, convertfps = True) vd = vd.ssrc(22050) #fv=ImageSource("slide7.jpg",fps=15,start=1,end=ceil(15*AudioLengthF(vd)/AudioRate(vd))).ConvertToRGB32().Lanczos4Resize(800,450) fv=ImageSource("slide7.jpg",fps=15,start=1,end=ceil(15*16.5)).ConvertToRGB32().Lanczos4Resize(800,450) sld7 = AudioDub(fv,vd) sld7 Code:
ffmpeg -async 15 -i Slide7.avs -vcodec flv -r 15 -s 800x450 -b:v 512k -ab 96k -ar 22050 -coder 1 -flags +aic+loop+mv4+naq -mpv_flags +cbp_rd -trellis 1 Slide7.flv
__________________
Life is more interesting viewed upside down |
13th June 2016, 22:26 | #2 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
1) DirectShowSource does not need "fps = 15, convertfps = True"
2) ffmpeg "-async 15", " -flags +aic+loop+mv4+naq" and "-mpv_flags +cbp_rd" do not apply 3) why reencode the audio? mux the original audio, something like this: Code:
## Slide7.avs ImageSource("slide7.jpg").Lanczos4Resize(800,450).Loop(-1).AssumeFPS(15) Code:
ffmpeg -i "Slide7.avs" -i "Slide7.mp3" -vcodec flv -b:v 512k -acodec copy -shortest "Slide7.flv" Last edited by raffriff42; 13th June 2016 at 22:29. |
20th June 2016, 12:14 | #3 | Link |
Registered User
Join Date: Jun 2007
Location: Ann Arbor, MI
Posts: 124
|
Sorry... out of the office all last week. Actually, I do need AviSynth because slide7 is one of many components that will be combined. Each component is different and I'm making them all the same (size, format, fps, etc.) so I can create a single video from all of them: ...slide5 ++ slide6 ++ slide7 ++ slide8 ...
The thing I don't understand is why AudioDuration(vd) or AudioLengthF(vd)/AudioRate(vd) indicate 29 seconds. The .avs plays 16.5 seconds and mediaInfo shows an audio duration of 16.5 seconds. The audio content is 16.5 seconds.
__________________
Life is more interesting viewed upside down |
20th June 2016, 14:39 | #4 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
Why force FPS on an audio-only clip? This may be the cause of the duration change, I don't know. Again, why reencode when you can copy the original audio?
If you really need to process audio in AviSynth, try FFmpegSource or LSMASHSource instead. DirectShowSource could be doing anything, depending on your system's codec (mis)configuration. |
20th June 2016, 18:57 | #5 | Link |
Registered User
Join Date: Jun 2007
Location: Ann Arbor, MI
Posts: 124
|
In order to create a single video from a varying number of dissimilar audio/video components, they must be of the same frame rate (format, size, channels, etc. too). So when the .jpg and .mp3 are combined, they need to match all the other components. I'll give FFmpegSource and LSMASHSource a go and see if there is any difference there. In the mean time, I've used audioTrim to force the .avs output to the duration I want and that seems to work.
__________________
Life is more interesting viewed upside down |
Tags |
audio encoding, avisynth, ffmpeg |
Thread Tools | Search this Thread |
Display Modes | |
|
|