I'm David and this is my blog.


Friday, March 30, 2007

Using Kino to make YouTube videos

A few days ago, I decided I wanted to make a little demo video of myself using Ubuntu. I wouldn't create anything too complicated but I would use Ubuntu to produce it. I have a Sony digital video camera and a firewire cable so all I needed was some software to help me get the video into a YouTube-acceptable form.

After little research, I found Kino was the best option for me. The first step is to capture the video from the camera to the hard drive. I used DV AVI Type 2, OpenDML AVI, and checked 'Put Timestamp in File Name'. Putting the timestamp in the filename was cool. I actually didn't realize the time and date were encoded into the MiniDV tape so it was neat to see that detail come out during capture.

Now to capture, I just had to plug firewire cable into the camera and computer, click the Capture button on the Capture tab in Kino, and hit play on the camera. I could see that the computer wasn't dropping any frames and I could view the video with sound on the computer as it was captured using the GTK method on the Display tab of Kino's Preferences.

Editing is a serious task but with a little time, you'll be able to do quite a lot. I kept it simple, just adding a title to the end for a few seconds. Finally, comes Export. The first few times I exported I either ran into a 186mb file for 9 minutes of video or the export would quit without producing anything. What finally worked(and what made me want to write this post to tell you about it) was to go to the Other tab in Kino's Export mode and pick XviD MPEG-4 AVI Single Pass(MEncoder) for the Tool and 4:3 Broadband Quality (320x240, 564kb/s) for the Profile.

I then ended up with a 19mb file that looks pretty good. If you'd like to take a look at the result of this process just go here. I hope this helps you to produce your videos in Ubuntu. If you have any suggestions on better ways to do this, I'd love to hear 'em in the comments.

21 Comments:

  • Thank you so much for your tip. It saved me quite a bit of time and frustration.

    By Blogger Kyle, At 5/12/07 11:35 AM  

  • What packages do you need installed for this to work? Currently the export fails for me on both Kubuntu and UbuntuStudio. Unfortunately I don't have the errors with me right now. I was just wondering if you knew off-hand which additional packages you had to install for this export option to work.

    By Anonymous Anonymous, At 5/20/07 9:14 AM  

  • @ anonymous

    I don't think there are any special packages required but if you post the error, I can take a look.

    By Blogger David, At 5/20/07 2:41 PM  

  • Hey David,

    Thanks so much for your reply. Here is the error I receive:

    >>> output rate is 48000, adjusted rate is 48042.1
    [mp3 @ 0x876c7e8]Could not find codec parameters (Audio: mp2, 80 kb/s)
    LAVF_header: av_find_stream_info() failed
    ============ Sorry, this file format is not recognized/supported =============
    === If this file is an AVI, ASF or MPEG stream, please contact the author! ===
    Cannot open demuxer.

    I am exporting with the same parameters you have specified in your post.

    By Anonymous Anonymous, At 5/20/07 4:24 PM  

  • @ anonymous

    Thanks for the error output. It looks to me like the format of the incoming video may be the problem. How did you get the video you're using? You might do a search for Kino or linux and the model of your camera or some identifying information about what created your video.

    I always capture as DV 2 direct from a sony hc-32. Perhaps you'll need to find a decoder for that video. If you post more info on the file, I may be able to help.

    By Blogger David, At 5/21/07 12:39 PM  

  • Kino editing process:

    - Three sources:
    1. Sony DCR-TRV350
    2. JVC GR-D396U
    3. DVD
    - All three sources have the same footage, just different angles
    - Footage from the cameras pulled directly into kino (Capture) via firewire
    - Footage from the DVD extracted using acidrip (video: copy, audio: copy)
    - Editing and chopping was no problem in kino
    - Saved the project: File > Save As > myVid
    - Stored on the filesystem as myVid.avi (kino appended .avi)

    Now when I go to export, I receive the errors mentioned previously.

    By Anonymous Anonymous, At 5/21/07 3:54 PM  

  • @ anonymous

    Hmm, I'm not so sure about that there DVD video. If it's still encrypted, that may be the cause of the problem. I'm not suggesting you do anything illegal but you would want to get dvdshrink to "backup" that dvd's vob files to your hard drive. Then try to work with that video. If that doesn't work, then I'm afraid I'm searching google just as you are.

    Have you determined which of those 3 videos is causing the problem. You should be able to export it with 2 of the 3 videos and can then work on the bad one. Good luck!

    By Blogger David, At 5/21/07 5:00 PM  

  • Did a new test from scratch to see if it is a problem with the DVD alone. I definitely had not considered that to be a potential issue. So:

    - Hooked up JVC to firewire
    - Used Capture feature in kino
    - File stored as jvc-rip001.avi
    - Saved project as jvc-rip-test
    - Then Export > Other
    file: jvc-export-test
    tool: XViD MPEG-4 AVI Single Pass (MEncoder)
    profile: 4:3 Broadband Quality (320x240, 564 kb/s)

    Same error. So while there still may be an issue with the DVD (not tested yet), the issue at this point appears to lie elsewhere.

    By Anonymous Anonymous, At 5/21/07 5:52 PM  

  • Forgot to mention. I also tried the same process, except exporting with a different tool:

    - Hooked up JVC to firewire
    - Used Capture feature in kino
    - File stored as jvc-rip001.avi
    - Saved project as jvc-rip-test
    - Then Export > Other
    file: jvc-export-test
    tool: MPEG-4 AVI Single Pass (FFMPEG)
    profile: 4:3 Broadband Quality (320x240, 564 kb/s)

    From that I received the following error:

    >>> output rate is 32000, adjusted rate is 32000
    /usr/share/kino/scripts/exports/ffmpeg_divx.sh: 56: source: not found
    /usr/share/kino/scripts/exports/ffmpeg_divx.sh: 56: ffmpeg_generate_hq: not found
    FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
    configuration: --enable-gpl --enable-pp --enable-pthreads --enable-vorbis --enable-libogg --enable-a52 --enable-dts --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
    libavutil version: 0d.49.0.0
    libavcodec version: 0d.51.11.0
    libavformat version: 0d.50.5.0
    built on Jan 28 2007 22:48:38, gcc: 4.1.2 20070106 (prerelease) (Ubuntu 4.1.1-21ubuntu7)
    Input #0, dv, from 'pipe:':
    Duration: N/A, start: 0.000000, bitrate: 28771 kb/s
    Stream #0.0: Video: dvvideo, yuv411p, 720x480, 28771 kb/s, 29.97 fps(r)
    Stream #0.1: Audio: pcm_s16le, 32000 Hz, stereo, 1024 kb/s
    PIX_FMT_YUV420P will be used as an intermediate format for rescaling
    Output #0, avi, to '/home/david/Desktop/notacon/jvc/jvc-export-test.avi':
    Stream #0.0: Video: mpeg4, yuv420p, 320x240, q=2-31, 500 kb/s, 29.97 fps(c)
    Stream #0.1: Audio: 0x0000, 32000 Hz, stereo, 64 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1
    Unsupported codec for output stream #0.1

    It appears to have some issue with the sound, and the codec for the audio. I'm not really sure what to do as I've installed pretty much every package I could find using aptitude and searching for mp2, mp3, lame, etc. I've even installed automatix and "commonly needed audio and video codecs" from that.

    By Anonymous Anonymous, At 5/21/07 5:58 PM  

  • Looks to me like you have an older version of ffmpeg than I while the libs ffmpeg is using seem to be the same versions. I don't know if that matters but it could...

    ffmpeg gives me:

    FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
    configuration: --enable-gpl --enable-pp --enable-vorbis --enable-libogg --enable-a52 --enable-dts --enable-dc1394 --enable-libgsm --disable-debug --enable-mp3lame --enable-faad --enable-faac --enable-xvid --enable-pthreads --enable-x264
    libavutil version: 49.0.0
    libavcodec version: 51.11.0
    libavformat version: 50.5.0
    built on Apr 2 2007 00:17:25, gcc: 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)

    By Blogger David, At 5/21/07 9:00 PM  

  • Thank you for the reply. I am new to Ubuntu, so forgive my newb question here. What does your sources.list look like? I am currently running 7.04, and an aptitude udpate/dist-upgrade doesn't yield any new versions of ffmpeg. Do I need to access a different repository?

    By Anonymous Anonymous, At 5/21/07 9:49 PM  

  • Funny thing there...I'm still using Edgy Eft or 6.10. Figure I'll switch about once a year. Here's the line from my dpkg.log when I upgraded ffmpeg:

    2007-04-02 00:20:31 status installed ffmpeg 3:0.cvs20060823-3.1ubuntu2-1

    I'm not sure if I did it as part of a normal upgrade but you should be able to get that version in a .deb somewhere. There's nothing special about my sources.list and I wouldn't recommend adding edgy repositories to do anything on feisty. If you do, keep a fire extinguisher handy and definitely get it on film. ;-)

    By Blogger David, At 5/21/07 10:04 PM  

  • Hello again, long road but I am almost there. I reverted to Edgy Eft (6.10), and could not get anything working, which put me even further away than where I was. So Feisty Fawn (7.04) was installed back with UbuntuStudio, and I found an article on recompiling ffmpeg for LAME support at http://po-ru.com/diary/bleeding-edge-ffmpeg-on-ubuntu-feisty/

    Those steps got me setup such that now I can export with the MP4 AVI (FFMPEG) function, and get a working video without errors. Still no success with the XViD (MENCODER) export, and still receiving the same errors. However, there is now at least one way for the videos to be exported for YouTube.

    Did you by chance have to do any specific recompiling of mencoder or mplayer?

    Thanks again for your help :]

    By Anonymous Anonymous, At 6/2/07 9:57 AM  

  • I can say with confidence that I did not need to compile MEncoder. Looking at my files, it does appear that I compiled ffmpeg-0.cvs20060823 which I probably dowloaded on a tip from the Ubuntu(or some other) forums. The file I actually grabbed to do this was ffmpeg_0.cvs20060823-3.1ubuntu1.diff.gz

    By Blogger David, At 6/3/07 12:15 AM  

  • I was looking for Kino export settings for YouTube. This was super helpful - Thanks!

    By Blogger Manduca, At 8/1/07 1:42 PM  

  • Hello David,

    I am Russell Crowder owner of http://fictionaluniversity.com and I am seeking someone to make short viral type video's for us. To see one of our more recent tv news video's go to youtube and search for Dear Loser Cards. All help greatly appreciated.

    Russell Crowder
    hdsubusiness@aol.com
    (440) 886-2555

    By Anonymous hdsudean, At 8/31/07 11:56 PM  

  • I figured out how to get it to work for me!

    First, Kino would not export anything as I had it setup but I looked at the process list to see what Kino was attempting to do with mencoder and saved that to a file/script and tried running the script. I ran the script on the two saved DV files from Kino, both under the MPEG tab, one MPEG-2 the other DVD. I got video but sound was garbage.

    THEN, I tried saving from the DV tab and selected OpenDML AVI, Update Date and Timecode, Resample Audio. After running the script on this file, it worked.

    Going back to Kino to try exporting as listed in this blog it started to look like it was exporting but then locked Kino up.

    Here is the script I used to convert the OpenDML AVI file to Youtube acceptable format as this blog described:

    #!/bin/bash

    INFILE=$1
    mencoder $INFILE -quiet -cache 8192 \
    -aspect 4:3 -xy 320 -zoom \
    -vf harddup,pp=ci,scale \
    -af-adv force=1 -srate 32000 \
    -ovc xvid -oac mp3lame \
    -lameopts preset=64 \
    -xvidencopts bitrate=500 \
    -o /tmp/outfile.avi

    yup, Kino still locked up...had to kill mencoder process to get it back. Running a 2nd time it looks like it actually finished but no output file was generated. Looking further, I see that when Kino runs export, I get 2 instances of exports/mencoder.sh and 2 instances of mencoder taking STDIO and trying to convert to the file /tmp/outfile.avi.

    So the work-around for me is to export the OpenDML AVI file and run the mencoder script manually.

    By Anonymous Doug, At 10/11/07 9:32 AM  

  • Good going and thanks for posting your results and methods. Hopefully it can help someone out.

    I just read in Linux Journal about KDENLIVE so I may try that out next time I do a little video project.

    By Blogger David, At 10/11/07 12:10 PM  

  • FYI, to go from .dv right to .flv export to OpenSML AVI as mentioned previously and then turn this script for the .flv file:

    #!/bin/bash

    INFILE=$1
    OUTFILE=`basename $1 .dv`.flv
    mencoder $INFILE -o $OUTFILE \
    -of lavf -oac mp3lame \
    -quiet -cache 8192 \
    -lameopts abr:br=56 -srate 44100 \
    -ovc lavc \
    -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 \
    -lavfopts \
    i_certify_that_my_video_stream_does_not_use_b_frames

    note: the last line ends with "_frames". Also, depending on your audio rate in the video, you might want to change -srate appropriately.

    you should now have a Shockwave Flash Video file you can place on a webpage like youtube.com does.

    By Anonymous Doug, At 10/11/07 7:26 PM  

  • Thank you, this worked for me and I the end results remained high quality without being too big.

    By Blogger George Donnelly, At 10/11/08 4:15 PM  

  • This worked for me too, using stock debian. Thank you!

    By Blogger Kristofer, At 7/10/09 10:10 PM  

Post a Comment



<< Home