Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: avconv, trouble extracting clip

  1. #1
    Join Date
    Mar 2009
    Location
    UK
    Beans
    278
    Distro
    Kubuntu

    avconv, trouble extracting clip

    I wish to extract a clip from a dv file.
    This should work but doesn't.
    Code:
    avconv -i /home/bill/1.dv -ss 100 -t 100  acodec /home/bill/aa1.dv
    this is the output:-
    avconv version 9.20-6:9.20-0ubuntu0.14.04.2+fdkaac, Copyright (c) 2000-2014 the Libav developers
    built on Feb 13 2017 12:16:45 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
    [dv @ 0x100e720] Estimating duration from bitrate, this may be inaccurate
    Input #0, dv, from '/home/bill/1.dv':
    Duration: 00:04:51.24, start: 0.000000, bitrate: 28800 kb/s
    Stream #0.0: Video: dvvideo, yuv420p, 720x576, 28800 kb/s, PAR 16:15 DAR 4:3, 25 tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Stream #0.2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Unable to find a suitable output format for 'acodec'

    Have read a lot of posts on this but am still stuck.

    Any ideas would be welcome

  2. #2
    Join Date
    Oct 2007
    Beans
    149

    Re: avconv, trouble extracting clip

    I suggest you remove "acodec" from the command. If you want to change the audio codec, it should be "-acodec <new codec>". If you want to leave it the same, then just omit it.

  3. #3
    Join Date
    Mar 2009
    Location
    UK
    Beans
    278
    Distro
    Kubuntu

    Re: avconv, trouble extracting clip

    Thanks for the response, tried,
    Code:
    avconv -i /home/bill/1.dv -ss 100 -t 100 /home/bill/aa1.dv
    Got:
    avconv version 9.20-6:9.20-0ubuntu0.14.04.2+fdkaac, Copyright (c) 2000-2014 the Libav developers
    built on Feb 13 2017 12:16:45 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
    [dv @ 0x16ef020] Estimating duration from bitrate, this may be inaccurate
    Input #0, dv, from '/home/bill/1.dv':
    Duration: 00:04:51.24, start: 0.000000, bitrate: 28800 kb/s
    Stream #0.0: Video: dvvideo, yuv420p, 720x576, 28800 kb/s, PAR 16:15 DAR 4:3, 25 tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Stream #0.2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    File '/home/bill/aa1.dv' already exists. Overwrite ? [y/N] y
    [dv @ 0x16f6f80] Can't initialize DV format!
    Make sure that you supply exactly two streams:
    video: 25fps or 29.97fps, audio: 2ch/48kHz/PCM
    (50Mbps allows an optional second audio stream)
    Output #0, dv, to '/home/bill/aa1.dv':
    Metadata:
    encoder : Lavf54.20.4
    Stream #0.0: Video: dvvideo, yuv420p, 720x576 [PAR 16:15 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Stream mapping:
    Stream #0:0 -> #0:0 (dvvideo -> dvvideo)
    Stream #0:1 -> #0:1 (pcm_s16le -> pcm_s16le)
    Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted

  4. #4
    Join Date
    Oct 2007
    Beans
    149

    Re: avconv, trouble extracting clip

    It looks like the input file is not a standard dv format (audio is 32khz instead of 48khz).

    You might try adding -c:a copy after the -t 100. avconv might still complain though. If so, you will have to convert the audio. I think that would be -c:a pcm.

  5. #5
    Join Date
    Mar 2009
    Location
    UK
    Beans
    278
    Distro
    Kubuntu

    Re: avconv, trouble extracting clip

    Thanks again!
    Converted the .dv file to .mp4 and could split it easily.
    The dv files are from Sony video camera tapes.
    I'll start looking at the best format to convert to (perhaps mp4 isn't best).
    Also, perhaps there's a way to correct whatever is wrong with the original dv files

  6. #6
    Join Date
    Mar 2009
    Location
    UK
    Beans
    278
    Distro
    Kubuntu

    Re: avconv, trouble extracting clip

    Should have posted this:-
    Code:
    avconv -i /home/bill/1.dv -ss 100 -t 100 -c:a copy /home/bill/x1.dv
    gives:-
    avconv version 9.20-6:9.20-0ubuntu0.14.04.2+fdkaac, Copyright (c) 2000-2014 the Libav developers
    built on Feb 13 2017 12:16:45 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
    [dv @ 0xa58fe0] Estimating duration from bitrate, this may be inaccurate
    Input #0, dv, from '/home/bill/1.dv':
    Duration: 00:04:51.24, start: 0.000000, bitrate: 28800 kb/s
    Stream #0.0: Video: dvvideo, yuv420p, 720x576, 28800 kb/s, PAR 16:15 DAR 4:3, 25 tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Stream #0.2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    [dv @ 0xa61020] Can't initialize DV format!
    Make sure that you supply exactly two streams:
    video: 25fps or 29.97fps, audio: 2ch/48kHz/PCM
    (50Mbps allows an optional second audio stream)
    Output #0, dv, to '/home/bill/x1.dv':
    Metadata:
    encoder : Lavf54.20.4
    Stream #0.0: Video: dvvideo, yuv420p, 720x576 [PAR 16:15 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 32000 Hz, stereo, 1024 kb/s
    Stream mapping:
    Stream #0:0 -> #0:0 (dvvideo -> dvvideo)
    Stream #0:1 -> #0:1 (copy)
    Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted

    And,
    Code:
    avconv -i /home/bill/1.dv -ss 100 -t 100 -c:a -c:a pcm copy /home/bill/x1.dv
    gives

    avconv version 9.20-6:9.20-0ubuntu0.14.04.2+fdkaac, Copyright (c) 2000-2014 the Libav developers
    built on Feb 13 2017 12:16:45 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
    [dv @ 0x1024e20] Estimating duration from bitrate, this may be inaccurate
    Input #0, dv, from '/home/bill/1.dv':
    Duration: 00:04:51.24, start: 0.000000, bitrate: 28800 kb/s
    Stream #0.0: Video: dvvideo, yuv420p, 720x576, 28800 kb/s, PAR 16:15 DAR 4:3, 25 tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Stream #0.2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Unable to find a suitable output format for 'pcm'

  7. #7
    Join Date
    Oct 2007
    Beans
    149

    Re: avconv, trouble extracting clip

    Quote Originally Posted by bill-lancaster View Post
    Make sure that you supply exactly two streams:
    video: 25fps or 29.97fps, audio: 2ch/48kHz/PCM
    (50Mbps allows an optional second audio stream)
    According to the error message, dv expect audio to be 48khz pcm

    You could try:

    avconv -i /home/bill/1.dv -ss 100 -t 100 -c:a pcm_s16le -r:a 48000 /home/bill/x1.dv

    If that doesn't work, I'm at a bit of a loss as I'm not much of an expert of dv format. You could check avconv -codecs to list available codecs.

  8. #8
    Join Date
    Mar 2009
    Location
    UK
    Beans
    278
    Distro
    Kubuntu

    Re: avconv, trouble extracting clip

    Oh well! Thanks so much for trying.
    Code:
    avconv -i /home/bill/1.dv -ss 100 -t 100 -c:a pcm_s16le -r:a 48000 /home/bill/x1.dv
    Gives:-

    built on Feb 13 2017 12:16:45 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
    [dv @ 0x1003000] Estimating duration from bitrate, this may be inaccurate
    Input #0, dv, from '/home/bill/1.dv':
    Duration: 00:04:51.24, start: 0.000000, bitrate: 28800 kb/s
    Stream #0.0: Video: dvvideo, yuv420p, 720x576, 28800 kb/s, PAR 16:15 DAR 4:3, 25 tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Stream #0.2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    [dv @ 0x100b120] Can't initialize DV format!
    Make sure that you supply exactly two streams:
    video: 25fps or 29.97fps, audio: 2ch/48kHz/PCM
    (50Mbps allows an optional second audio stream)
    Output #0, dv, to '/home/bill/xx1.dv':
    Metadata:
    encoder : Lavf54.20.4
    Stream #0.0: Video: dvvideo, yuv420p, 720x576 [PAR 16:15 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Stream mapping:
    Stream #0:0 -> #0:0 (dvvideo -> dvvideo)
    Stream #0:1 -> #0:1 (pcm_s16le -> pcm_s16le)
    Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted

  9. #9
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: avconv, trouble extracting clip

    Quote Originally Posted by bill-lancaster View Post
    I'll start looking at the best format to convert to (perhaps mp4 isn't best).
    I usually choose Matroska as the output container if the devices I'm using support it. The mkvtoolnix package has a nice array of applications to extract, merge, etc., tracks to or from an .mkv file, too.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  10. #10
    Join Date
    Jun 2007
    Beans
    17,337

    Re: avconv, trouble extracting clip

    Most of the commands you tried were poorly/improperly written and orig. not copying (i.e. "extracting).
    couple of ex.
    red wrong, encodes a & v
    Code:
    avconv -i /home/bill/1.dv -ss 100 -t 100  acodec /home/bill/aa1.dv
    red encode & copy?, blue does nothing
    Code:
    avconv -i /home/bill/1.dv -ss 100 -t 100 -c:a -c:a pcm copy /home/bill/x1.dv
    Not sure what red was going to do
    Code:
    avconv -i /home/bill/1.dv -ss 100 -t 100 -c:a pcm_s16le -r:a 48000 /home/bill/x1.dv
    In any event that version of avconv wouldn't deal with 32kHz pcm so didn't matter commands were wrong.

    FFmpeg would handle that audio (which is apparently allowed), if you had that version of avconv from ppa you could just install ppa's ffmpeg for use of the binaries.
    For 'extracting' you'd could use a stream copy parameter, period
    -c copy
    avconv -i /home/bill/1.dv -ss 100 -t 100 -c copy /home/bill/x1.dv

    For ffmpeg you could of copied the video, re-encoded audio, ex.
    Code:
    ffmpeg  -i /home/bill/1.dv -ss 100 -t 100 -c:v copy -c:a pcm_s16le -ar 48000 /home/bill/x1.dv
    or
    Code:
    ffmpeg -ss 100  -i /home/bill/1.dv  -t 100 -c:v copy -c:a pcm_s16le -ar 48000 /home/bill/x1.dv
    You should read here about placement of -ss & some possible codec copy issues
    https://trac.ffmpeg.org/wiki/Seeking

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •