2

I have tried using openshot, pitivi, kdenlive, videolan to cut an audio/video file but they all seem to freeze. So I am now trying to use the following command:

avconv -i input.MP4 -vcodec copy -acodec copy -ss 01:25:00 -t 01:26:00 output.MP4

This creates a file on my computer but when I open it in vlc, I can only hear sound and the length is 37.04 minutes. It was supposed to be 1 minute long.

Also, just tried this:

ffmpeg -ss 01:24:30 -t 01:25:00 -i orginalfile -vcodec copy -acodec copy newfile

This doesn't cut the av file at all, it ends up being full length but only the audio is available, no video.

What am I doing wrong?

I have also tried:

avconv -i input.MP4 -ss 01:25:00 -t 01:26:00 -c:a copy -c:v copy output.MP4

and it gives me the same result as above.


Full output from both commands can be see here:

oshiro@home-desktop:~/Desktop$ avconv -i SDV_1195.MP4 -vcodec copy -acodec copy -ss 01:24:00 -t 01:25:30 2.MP4
avconv version 0.8.13-4:0.8.13-0ubuntu0.12.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Jul 15 2014 12:56:47 with gcc 4.6.3
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1e8c7a0] max_analyze_duration reached
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'SDV_1195.MP4':
  Metadata:
    major_brand     : avc1
    minor_version   : 0
    compatible_brands: avc1isom
    creation_time   : 1947-02-10 00:03:08
  Duration: 02:01:04.29, start: 0.000000, bitrate: 2137 kb/s
    Stream #0.0(eng): Video: h264 (Main), yuv420p, 720x576, 2000 kb/s, PAR 64:45 DAR 16:9, 50 fps, 50 tbr, 90k tbn, 180k tbc
    Metadata:
      creation_time   : 1947-02-10 00:03:08
    Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 127 kb/s
    Metadata:
      creation_time   : 1947-02-10 00:03:08
Output #0, mp4, to '2.MP4':
  Metadata:
    major_brand     : avc1
    minor_version   : 0
    compatible_brands: avc1isom
    creation_time   : 1947-02-10 00:03:08
    encoder         : Lavf53.21.1
    Stream #0.0(eng): Video: ![0][0][0] / 0x0021, yuv420p, 720x576 [PAR 64:45 DAR 16:9], q=2-31, 2000 kb/s, 90k tbn, 90k tbc
    Metadata:
      creation_time   : 1947-02-10 00:03:08
    Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, 127 kb/s
    Metadata:
      creation_time   : 1947-02-10 00:03:08
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press ctrl-c to stop encoding
frame=    0 fps=  0 q=-1.0 Lsize=   35570kB time=2224.30 bitrate= 131.0kbits/s    /s    
video:0kB audio:34755kB global headers:0kB muxing overhead 2.345804%
oshiro@home-desktop:~/Desktop$ avconv -i SDV_1195.MP4 -ss 01:24:00 -t 01:25:30 -c:a copy -c:v copy output-clip.mp4
avconv version 0.8.13-4:0.8.13-0ubuntu0.12.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Jul 15 2014 12:56:47 with gcc 4.6.3
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xd307a0] max_analyze_duration reached
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'SDV_1195.MP4':
  Metadata:
    major_brand     : avc1
    minor_version   : 0
    compatible_brands: avc1isom
    creation_time   : 1947-02-10 00:03:08
  Duration: 02:01:04.29, start: 0.000000, bitrate: 2137 kb/s
    Stream #0.0(eng): Video: h264 (Main), yuv420p, 720x576, 2000 kb/s, PAR 64:45 DAR 16:9, 50 fps, 50 tbr, 90k tbn, 180k tbc
    Metadata:
      creation_time   : 1947-02-10 00:03:08
    Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 127 kb/s
    Metadata:
      creation_time   : 1947-02-10 00:03:08
Output #0, mp4, to 'output-clip.mp4':
  Metadata:
    major_brand     : avc1
    minor_version   : 0
    compatible_brands: avc1isom
    creation_time   : 1947-02-10 00:03:08
    encoder         : Lavf53.21.1
    Stream #0.0(eng): Video: ![0][0][0] / 0x0021, yuv420p, 720x576 [PAR 64:45 DAR 16:9], q=2-31, 2000 kb/s, 90k tbn, 90k tbc
    Metadata:
      creation_time   : 1947-02-10 00:03:08
    Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, 127 kb/s
    Metadata:
      creation_time   : 1947-02-10 00:03:08
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press ctrl-c to stop encoding
frame=    0 fps=  0 q=-1.0 Lsize=   35570kB time=2224.30 bitrate= 131.0kbits/s    /s    
video:0kB audio:34755kB global headers:0kB muxing overhead 2.345804%
oshiro@home-desktop:~/Desktop$ 
  • Seems you can use ffmpeg. Check this answer. askubuntu.com/a/318132 – Ramesh Jul 21 '14 at 17:30
  • @Ramesh, I just tried that, and it just seems to strip the video out and doesn't extract the clip I want. – oshirowanen Jul 21 '14 at 17:35
  • oh, let's wait for some other answer then. Unfortunately, I could not test it in the machine. – Ramesh Jul 21 '14 at 17:39
1

I've cut videos both on Linux and Windows using Avidemux. It has an easy to use GUI.

  • load the video
  • select start and end points
  • select output format (use Copy to avoid video recoding)
  • save your cut file

Install it in Ubuntu with:

sudo apt-get install avidemux
  • This worked perfectly. – oshirowanen Jul 21 '14 at 21:23
0

The -t takes a duration, not end-time.

So change to -t 60 or -t 0:01:00

From libav doc:

‘-t duration (output)’
    Stop writing the output after its duration reaches duration.
    duration may be a number in seconds, or in hh:mm:ss[.xxx] form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.