CODE to control IMAGE SAVE AS MP4 . . .
2020-12-21-164021
All --
I have a ROUTINE (below) which will save an IMAGE SEQUENCE into an MP4 VIDEO FILE.
I opened the MP4 VIDEO FILE using VLC, I can see that the CODEC used to save this file is H264 as shown below.

This matches the COMPRESSION setting in the IMAGE-PRO SAVE AS DIALOG BOX as shown below.

When working with JPG IMAGE FILES recently, I provided with the following CODE to adjust the COMPRESSION QUALITY ATTRIBUTE during a FILE SAVE AS JPG IMAGE.
Public Sub SaveJpg
Dim image1 As McImage
With Application.DocumentCommands.ActiveImage(Nothing)
.Run(image1)
End With
image1.File.Format="jpg"
image1.File.Attributes("CompressionQuality") = 50
image1.SaveAs(ThisApplication.Path(mcPathType.mcptWritableImages) & "test.jpg")
End Sub
Dim image1 As McImage
With Application.DocumentCommands.ActiveImage(Nothing)
.Run(image1)
End With
image1.File.Format="jpg"
image1.File.Attributes("CompressionQuality") = 50
image1.SaveAs(ThisApplication.Path(mcPathType.mcptWritableImages) & "test.jpg")
End Sub
I would like to know what the ATTRIBUTES are that I can modify in the FILE SAVE AS MP4 MOVE FILE so that I can fine-tune the MOVIE for the users of the IMAGE-PRO APP that I am writing. If I can adjust FRAMES PER SECOND on PLAYBACK and LOOPING AT END or REVERS AT END, that would be super.
I have poked around in IMAGE-PRO HELP FILES and on the INTERNET and I am unable to find guidance on this.
I did find a reference that pointed me to a list of the CODECs that I as a USER can see within WINDOWS but this list does not match the list in IMAGE-PRO.


I have attached a TEST SEQUENCE to hopefully simplify providing info on this.
Thanks in advance.
-- Matt
Public Function Tester 'SAVE THE IMAGE SEQUENCE AS MP4 MOVIE Dim imageAA As McImage With Application.DocumentCommands.ActiveImage(Nothing) .Run(imageAA) End With imageAA.File.Format="mp4" imageAA.SaveAs _ ( _ textBox_SourceFolder.Text & _ "\Annotated Images and Video" & _ "\" & _ textBox_SampleInfo.Text & _ ".mp4" _ ) End Function
0
Answers
-
2020-12-21-171849All --I did also manage to find a page on the internet that gave directions on getting a list of CODECs on a given WINDOWS computer via the WINDOWS MEDIA PLAYER.The article is atAccording to that, the CODECs on my WINDOWS 10 COMPUTER areI hope this information is helpful.Thanks.-- Matt
0 -
Hi Matt,
You can set "Frames per second" in the sequence toolbar:
or using the macro:Public Sub SetImageFPS Dim win As McWindow=ThisApplication.ActiveWindow Dim view As Mediacy.IQL.Display.Viewer.McView=win.ImageView Dim fps As Double=10'set frames per second 'set to View view.SequenceFrameRate=fps 'set to image view.ImageToDisplay.Properties(MediaCy.IQL.Engine.mcImageLibPropertyIDs.ID_IMcImage_FramesPerSecond)=fps End Sub
After that the image can be saved to MP4 with the given rate. The LOOPING AT END or REVERS AT END are not image properties and should be set in the player, where you play the movie.
Yuri0 -
2020-12-22-090316Yuri --Thanks for the CODE to modify the FRAMES PER SECOND.It has been a long time since I have done a project with a movie but back in the days of AVI FILES I thought that the END OPTIONS of-- STOP-- LOOP-- REVERSEwere embedded in the MOVIE FILE. I expect these can be over-ridden by the MOVIE PLAYER. This is the first time I have really dug into using an MP4 FILE so I don't know what its FEATURES and OPTIONS are.Is there CODE that will allow the SAVE MOVIE ROUTINE in my APP to:-- List the CODECS that are options-- Set the CODEC that will be usedduring the SAVE AS MP4 FILE?Thanks again.-- Matt0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions