ffmpeg Wrapper and YouTube

Sep 7, 2011 at 1:42 PM

Hello,

We like your wrapper and are looking into using it to convert portions of video files for upload to YouTube.

 

We specify where in the video we want to start encoding as well as how much in seconds we will be encoding from that point.

Our ffmpeg command string looks like this (10 seconds into video, encode 20 seconds):

ffmpeg.exe -i "c:\Videos\sourcevideo.mpg"  -ss 10  -t 20 -target vcd -sameq -y "c:\Videos\convertedvideo.mpg"

 

Would it be possible to pass this custom command string into the wrapper?

 

Also, in your opinion, what is the best video format to upload into YouTube?  We are currently thinking of encoding into mpeg-1

 

Thanks for your time!

 

Jeff

Sep 7, 2011 at 3:52 PM

I was able to use the CustomParameters property to convert only the portion of the video that i wanted.   Audio is messed up, but I'm not too concerned about that for the moment.

 

Is there any way I can modify the source code to allow the conversion of mpeg-1 to mpeg4?  Saving to .mp4 is easy, but not sure how I could allow for mpeg1 conversion.

 

Here is what works for me to convert an mpeg1 file to an abbrieviated file via command line:

ffmpeg.exe -i "c:\Videos\sourcevideo.mpg"  -ss 10  -t 20 -target vcd -sameq -y "c:\Videos\convertedvideo.mpg"

Coordinator
Sep 7, 2011 at 4:32 PM
You may modify the source in any way you wish! Unfortunatly I don't have
a development machine anymore. So the project went pretty stale. I am
glad that the custom params worked out for you. The audio can be fixed
with some modification of the source, If i recall properly i didnt
include measures to parse custom params for audio.. Im not %100 sure
though. If you dont get it figured out let me know, I will load mono on
my linux box and see what i can do.

Greg
Sep 7, 2011 at 4:48 PM
Thanks for the reply,

After talking with my collegue, we think its best to stick with mpeg1 as the output format.

We were successful uploading an mpeg1 to youtube so we are going to stick with that approach.

The trouble is all the possible codec issues and file formats out there from our perspective. We are looking into settling on mpeg1 as our 'universal standard' that works with our app.

If you can remember anything about how to add mpeg1 capability to the dll that would be great.

We can even give you some time on our development machine via gotomeeting. We have visual studio 2010 installed and working in the VB environment.

Let me know if this appeals to you and we can set something up. I'm sure we can make it worth your while with a donation.

Jeff



On Wed, Sep 7, 2011 at 11:32 AM, chumney2000 <notifications@codeplex.com> wrote:

From: chumney2000

You may modify the source in any way you wish! Unfortunatly I don't have
a development machine anymore. So the project went pretty stale. I am
glad that the custom params worked out for you. The audio can be fixed
with some modification of the source, If i recall properly i didnt
include measures to parse custom params for audio.. Im not %100 sure
though. If you dont get it figured out let me know, I will load mono on
my linux box and see what i can do.

Greg

Read the full discussion online.

To add a post to this discussion, reply to this email (VBffmpegWrapper@discussions.codeplex.com)

To start a new discussion for this project, email VBffmpegWrapper@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Sep 7, 2011 at 7:38 PM
no problem, I will do some research tonight on the best options for
youtube and I'll try and create a custom dll that will work good with
you tube. I imagine all you need is basic (file in | output) for your
needs.. and you shouldn't need to many other options to keep a specific
format.. So i should be able to lighten it up for you and the good thing
with working with just one type of output is i can check for bugs easier..
Greg
Sep 7, 2011 at 9:52 PM
That would be awesome - thanks for the help!

Just Mpeg1 in and Mpeg1 out. Audio syncing if possible. Only switches I would need would be time start (-ss x) and length (-t x)

Thanks again,

Jeff

On Wed, Sep 7, 2011 at 2:38 PM, chumney2000 <notifications@codeplex.com> wrote:

From: chumney2000

no problem, I will do some research tonight on the best options for
youtube and I'll try and create a custom dll that will work good with
you tube. I imagine all you need is basic (file in | output) for your
needs.. and you shouldn't need to many other options to keep a specific
format.. So i should be able to lighten it up for you and the good thing
with working with just one type of output is i can check for bugs easier..
Greg

Read the full discussion online.

To add a post to this discussion, reply to this email (VBffmpegWrapper@discussions.codeplex.com)

To start a new discussion for this project, email VBffmpegWrapper@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Sep 12, 2011 at 10:09 PM
I am just writing to say I have not forgotten about this. Things have
been a little hectic around here. .I did have one last question though.
What audio codec were you planing on using? I would assume youtube would
accept mp3 as the audio codec. But i wanted to check with you first.
Greg
Sep 12, 2011 at 10:53 PM

Tx acc or mp3. Audio quality. Is not important as long as it roughly matches video tx!

On Sep 12, 2011 6:09 PM, "chumney2000" <notifications@codeplex.com> wrote:
> From: chumney2000
>
> I am just writing to say I have not forgotten about this. Things have
> been a little hectic around here. .I did have one last question though.
> What audio codec were you planing on using? I would assume youtube would
> accept mp3 as the audio codec. But i wanted to check with you first.
> Greg
>
>
Sep 17, 2011 at 12:22 AM
I send a sample mpeg1 video that we typically use if that is helpful. Just tell me what email to send it to.

J


On Mon, Sep 12, 2011 at 5:53 PM, Jeff Weinmann <jwein.acs@gmail.com> wrote:

Tx acc or mp3. Audio quality. Is not important as long as it roughly matches video tx!

On Sep 12, 2011 6:09 PM, "chumney2000" <notifications@codeplex.com> wrote:
> From: chumney2000
>
> I am just writing to say I have not forgotten about this. Things have
> been a little hectic around here. .I did have one last question though.
> What audio codec were you planing on using? I would assume youtube would
> accept mp3 as the audio codec. But i wanted to check with you first.
> Greg
>
>

Coordinator
Sep 17, 2011 at 1:06 AM
it would be a little helpful, You can email it to
chumney_2000@hotmail.com
Sep 19, 2011 at 6:25 PM
Hey,

I tried implementing your original project and fflib, and it works great so far!

I wouldn't spend any more time on the 'side project' as converting the mpeg1 file to mp4 then uploading to you tube works great

Thanks for all your help and a great library!

J

On Fri, Sep 16, 2011 at 8:06 PM, chumney2000 <notifications@codeplex.com> wrote:

From: chumney2000

it would be a little helpful, You can email it to
chumney_2000@hotmail.com

Read the full discussion online.

To add a post to this discussion, reply to this email (VBffmpegWrapper@discussions.codeplex.com)

To start a new discussion for this project, email VBffmpegWrapper@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Sep 19, 2011 at 6:57 PM
awesome, I am super glad it worked OK for you!
Sep 21, 2011 at 12:13 PM
Another question re the wrapper. Can I modify the 'Custom Parameters' of the wrapper to allow me to encode a target video where the video comes from one file and the audio comes from another? We would like to strip the audio stream out from the source video and dub in our own audio.

Here is an extract from an 'ffmpeg howto' website that indicates how to do it with the command line only:


MULTIPLE SOURCES

One of the pieces of equipment adorning my video rig here at home is a DVD recorder. Almost invariably, I record direct onto a DVD+RW so that I can take the program I'm recording apart, rework the audio track (boost the volume level among other things), put it back together again, archive the modified program onto a DVD±R and put the DVD+RW back into circulation for the next recording.

Once the audio track has been extracted and reworked, I can reassemble the movie in either of two manners:

Also extract the mpeg2video data from the .vob file and then multiplex it and the reworked audio (duly converted to MP2 or AC3) with mplex, or
Ask ffmpeg to pull the video in from the original .vob file and the audio from the reworked .wav audio file and transcode it on-the-fly.
Solution 1 is already the object of another howto page (which needs finishing now that I think of it). This is how we use solution 2:

$ ffmpeg -i oldmovie.vob -i altered_audio.wav -map 0:0 -map 1:0 -target ntsc-dvd \
-b required_video_bit_rate -aspect 16:9 newmovie.mpg
Sep 21, 2011 at 2:41 PM
Regarding a separate audio source I could modify the CommandPass1 to include the audio.
You are doing that for the case of 'no audio', maybe I could have a third case?


If _RateControl = RateControl_VBR Then
'1st of 2 pass, NO audio, output to nul
_CommandPass1 = String.Format("-i {0} {1} {2} {3} {4} {5}{6}", _Source, _CustomParams, "-an", _VideoParamsPass1, "-threads " & _Threads, "-y", "nul")

Else
'single pass only.
_CommandPass1 = String.Format("-i {0} {1} {2} {3} {4} {5}{6}", _Source, _CustomParams, _AudioParams, _VideoParamsPass1, "-threads " & _Threads, """" & _OutputDirectory, _FileName & """")
End If