trim 165 MB video clip with ffmpeg (only last 3 minutes)


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users trim 165 MB video clip with ffmpeg (only last 3 minutes)
# 1  
Old 11-18-2011
trim 165 MB video clip with ffmpeg (only last 3 minutes)

Hi

original video clip

Code:
> ls -alh reallynotpr0n.flv 
-rw-r--r--  1 jonny  staff   165M Nov 18 19:57 reallynotpr0n.flv

trying to cut only last 3 minutes of the clip out.

Code:
> ffmpeg -i reallynotpr0n.flv -vcodec copy -acodec copy -ss 00:52:00 -t 00:03:48 trimmed_video.avi
ffmpeg version 0.7.7, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov  6 2011 05:05:03 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
  configuration: --prefix=/opt/local --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libopenjpeg --enable-libxvid --enable-libx264 --enable-libvpx --enable-libspeex --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64 --enable-yasm
  libavutil    50. 43. 0 / 50. 43. 0
  libavcodec   52.122. 0 / 52.122. 0
  libavformat  52.110. 0 / 52.110. 0
  libavdevice  52.  5. 0 / 52.  5. 0
  libavfilter   1. 80. 0 /  1. 80. 0
  libswscale    0. 14. 1 /  0. 14. 1
  libpostproc  51.  2. 0 / 51.  2. 0
[flv @ 0x7fa2aa84ac00] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'reallynotpr0n.flv':
  Duration: 00:55:48.67, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: flv, yuv420p, 480x400, 1k tbr, 1k tbn, 1k tbc
    Stream #0.1: Audio: nellymoser, 8000 Hz, mono, s16
Output #0, avi, to 'trimmed_video.avi':
  Metadata:
    encoder         : Lavf52.110.0
    Stream #0.0: Video: flv, yuv420p, 480x400, q=2-31, 1k tbn, 1k tbc
    Stream #0.1: Audio: nellymoser, 8000 Hz, mono
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Could not write header for output file #0 (incorrect codec parameters ?)

specs abut *.flv file

Code:
> ffmpeg -i reallynotpr0n.flv 
ffmpeg version 0.7.7, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov  6 2011 05:05:03 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
  configuration: --prefix=/opt/local --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libopenjpeg --enable-libxvid --enable-libx264 --enable-libvpx --enable-libspeex --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64 --enable-yasm
  libavutil    50. 43. 0 / 50. 43. 0
  libavcodec   52.122. 0 / 52.122. 0
  libavformat  52.110. 0 / 52.110. 0
  libavdevice  52.  5. 0 / 52.  5. 0
  libavfilter   1. 80. 0 /  1. 80. 0
  libswscale    0. 14. 1 /  0. 14. 1
  libpostproc  51.  2. 0 / 51.  2. 0
[flv @ 0x7fe6ba04ac00] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'reallynotpr0n.flv':
  Duration: 00:55:48.67, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: flv, yuv420p, 480x400, 1k tbr, 1k tbn, 1k tbc
    Stream #0.1: Audio: nellymoser, 8000 Hz, mono, s16
At least one output file must be specified

the resulting (trimmed) clip has size zero.

Code:
> ls -al trimmed_video.avi 
-rw-r--r--  1 jonny  staff  0 Nov 18 20:25 trimmed_video.avi

# 2  
Old 11-21-2011
Maybe because of this?

Code:
[flv @ 0x7fa2aa84ac00] Estimating duration from bitrate, this may be inaccurate

# 3  
Old 11-21-2011
Quote:
Originally Posted by mirni
Maybe because of this?

Code:
[flv @ 0x7fa2aa84ac00] Estimating duration from bitrate, this may be inaccurate

what do you recommend me to fix it?

is my CLI syntax correct?
# 4  
Old 11-22-2011
I was able to trim a test video on my machine with the syntax you provided, so I think it is correct. What I meant in the previous post was to double check the duration of the video (launch it in mplayer or some other player and skip to the end, see what is the duration). It may be that the video is shorter than 52 minutes, in which case you are telling ffmpeg to skip beyond the end of file.
Is it working, if you are trying to trim the first 3 minutes? or the 3 minutes somewhere in the middle of file?
Is it working with some other .flv file?
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Length of video file in minutes

I need to extract the length of a video file in minutes, not seconds or hours. How do I get the amount of minutes exclusively? (2 Replies)
Discussion started by: locoroco
2 Replies

2. Shell Programming and Scripting

Grep a log file for the last 5 minutes of contents every 5 minutes

Hi all, System Ubuntu 16.04.3 LTS i have the following log INFO 2019-02-07 15:13:31,099 module.py:700] default: "POST /join/8550614e-3e94-4fa5-9ab2-135eefa69c1b HTTP/1.0" 500 2042 INFO 2019-02-07 15:13:31,569 module.py:700] default: "POST /join/6cb9c452-dcb1-45f3-bcca-e33f5d450105... (15 Replies)
Discussion started by: charli1
15 Replies

3. UNIX for Beginners Questions & Answers

How to convert days hours minutes seconds to minutes?

Hi, please help with below time conversion to minutes. one column values: 2 minutes 16 seconds 420 msec 43 seconds 750 msec 0 days 3 hours 29 minutes 58 seconds 480 msec 11 seconds 150 msec I need output in minutes(total elapsed time in minutes) (2 Replies)
Discussion started by: ramu.badugula
2 Replies

4. Shell Programming and Scripting

Recursive (Into subdirectories) ffmpeg generate jpg from video

My question is how to modify my existing script to generate from videos (mp4,avi,mkv etc...) jpegs via ffmpeg and keep folder name of generated jpg file? So if i have video in /home/videos/MyParty2009/SOmeDirR/VideoSomeTitle.mp4 and it will generate jpg with name of MyParty2009.jpg so the... (2 Replies)
Discussion started by: ZerO13
2 Replies

5. UNIX for Advanced & Expert Users

Ffmpeg (avconv) + crtmpserver Linux streaming video, no player to play it

Hello Linux experts, I'm working on live video streaming project, and my job is to create video streaming server using Ubuntu 13.04 Here is what I've done so far: 1. Installed crtmpserver from Ubuntu's repositories. 2. Installed ffmpeg To test the server i use webcam as source of video,... (0 Replies)
Discussion started by: +Yan
0 Replies

6. OS X (Apple)

Video grab using ffmpeg?

Does anyone know how to grab video (screen) on Terminal using ffmpeg (not X11). I have written a unix library and I'd like to make a short movie (demo) of it. Tried: I already own SNapz Pro2 but it hangs the system (I have an old Powerbook 15" PPC). I guess my system is too slow for version... (0 Replies)
Discussion started by: sentinel
0 Replies
Login or Register to Ask a Question