A következő címkéjű bejegyzések mutatása: video. Összes bejegyzés megjelenítése
A következő címkéjű bejegyzések mutatása: video. Összes bejegyzés megjelenítése

2021. február 23.

How to split a video without rerendering it

To slice out a part of a video file, we can use this ffmpeg command:

ffmpeg -ss <position> -i input.mp4 -c copy -t <duration> output.mp4

-c copy Copy is a special value for the codec option on the output to indicate that the stream is not to be re-encoded.

-ss <position> When used as an input option (before -i), seeks in this input file to position. Note that in most formats it is not possible to seek exactly, so ffmpeg will seek to the closest seek point before position. When doing stream copy or when -noaccurate_seek is used, this extra segment between the seek point and position will be preserved.

-t <duration> When used as an output option (before an output url), stop writing the output after its duration reaches duration.

position/duration can be in either the [-][HH:]MM:SS[.m...] or the [-]S+[.m...][s|ms|us] format

2013. november 8.

Video playback is lagging

Tips I've read some places:

What solved it:

using -vo gl2 option in mplayer
lie:
$mplayer myvideo.avi -vo gl2


Does not help:
  • changing the refresh rate of the laptop display and the vga monitor to the same amount (75 or 60 Hz)
  • installing mga_vid, or at least trying to install it.

2013. november 2.

Media file video stream showing nothing (black screen)

From one day to the other, video media files I could play fine earlier, stopped showing video output, and instead of that they put out a black screen, which held frozen any movement that was done in front of it (window openings, etc, like, when a software freezes...)

Solution came from this thread:
https://answers.launchpad.net/ubuntu/+source/vlc/+question/166706
pietrino (pietrino) said :#13
Thanks Eliah and sorry for the confusion I generated.
I manged to view video correctly in totem by alt+F2, typing "gstreamer-properties" and in the video tab selecting X window system (no Xv). This looks like a pretty general hint that might serve different people. In the case of vlc, others hinted at setting the X11 display in the video properties of the program, though haven't tried that yet.
Sorry once more

2011. április 22.

NOTE: Making movies from image files using mencoder / ffmpeg

Here's a site. It describes something I wanted to do / did half a year ago but made no blog-post of it.

What I originally wanted to do was to have a single image as a video, and put some music to it and post it on youtube.

I somehow managed it, but I have no idea anymore how.
And I also found mp3tube, so I don't really need this anymore, if I don't care to have a special picture for my music.

MPlayer error messages

I get this when I open anything in MPlayer:
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
MPlayer SVN-r1.0~rc3+svn20090426-4.4.3 (C) 2000-2009 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing Movie.mp4.
libavformat file format detected.
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
VIDEO: [avc1] 800x440 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: Permission denied.
[VO_3DFX] Unable to open /dev/3dfx.


To get rid of all of this, do the following:
1.)Turn bluetooth on.
2.) Disable LIRC support.: ~$ sudo gedit /etc/mplayer/mplayer.conf and add the line: nolirc=yes
3.) Define X11 as default video output: in ~$ sudo gedit /etc/mplayer/mplayer.conf search for the line: # vo=xv,x11 -> uncomment (remove # from the beginning of the line), change to vo=x11, or whatever is the best.

2011. április 21.

Editing, manipulating Subtitles

I used Subtitle Processor under Windows XP.

Under Ubuntu:
1.) Subtitle Editor (from Synaptic): something is wrong with the input methods and I cannot type in anything, and I don't like the environment either, so Subtitle Editor is DROPPED.

2.) AegiSub: nope, it didn't play the sounds, and I didn't like the environment.

3.) Gnome Subtitles: LIKE :-) Can do shifting easily.

2011. április 20.

DVD ripping with MEncoder

From where I learned:
MEncoder DVD to MPEG-4
Making a high quality MPEG-4 (divx) rip of a DVD movie (mplayerhq manual)
HOWTO: rip DVDs in MPEG-4 (ubuntuforums)

And this turned out to be the most useful:
SimpleRip: Ripping / Encoding DVD-s to Xvid with MEncoder

An automated way should be AcidRip, but it somehow got the code messed-up, when shell-script exported, and I had to correct it manually. What I learned from it is how to handle frameno.avi and divx2pass.log:
#!/bin/sh
echo "***********************************************************"
echo "Automated script created by AcidRip - http://acidrip.sf.net"
echo "***********************************************************"

unlink frameno.avi 2> /dev/null
mencoder dvd://1 -dvd-device /dev/dvd  -aid 129 -oac mp3lame -lameopts mode=2:cbr:br=128  -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=740:vhq:v4mv:vqmin=3:vpass=1 -vf crop=672:432:24:22    -o "/dev/null"
mencoder dvd://1 -dvd-device /dev/dvd  -aid 129 -oac mp3lame -lameopts mode=2:cbr:br=128  -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=740:vhq:v4mv:vqmin=3:vpass=2 -vf crop=672:432:24:22    -o "/home/user/movie.avi"
unlink divx2pass.log  2> /dev/null
As for the subtitle (.idx + .sub = VOBSUB format):
I want to convert them to SRT.
--> I used AVIDEMUX (downloaded from Synaptic) It worked fine.

2010. november 18.

OGM to AVI with hardcoded subtitles

I was trying to hardcode a subtitle while "-ovc copy". How silly of me. It is only possible to hardcode a subtitle if mencoder has to process the video file frame by frame, as it modifies the pictures when hardcoding.

For whatever reason MEncoder didn't want to work for me recoding a Vorbis audio stream to mp3 with Lame, so two steps were added in between.

#1. Demuxing OGM to separate stream-files
ogmdemux input.ogm

#2. Converting audio track to mp3
soundconverter -b -m audio/mpeg -s .mp3 input.ogm-a1.ogg

#3. Muxing video, audio and subtitle into an avi
mencoder input.ogm-v1.avi -o output.avi -audiofile input.ogm-a1.mp3 -oac copy -ovc lavc -lavcopts vcodec=mpeg4 -sub input.ogm-t1.str

#1-3. Of course at the end I managed to do steps 1-3 in a single step:
mencoder input.ogm -aid 1 -sub input.srt -o output.avi -oac mp3lame -lameopts cbr=128 -ovc lavc -lavcopts vcodec=mpeg4


I guess to achieve the all inclusive #1-3, I had to install some stuff and make mplayer for myself...
sudo apt-get install libasound2-dev libfreetype6-dev zlib1g-dev libmp3lame-dev libfontconfig1-dev libexpat1-dev ogmtools
./configure --enable-theora --enable-libdv --enable-mp3lame --enable-mp3lame-lavc --enable-mp3lib --enable-debug
But of course I don't know what exactly did the trick.

For a better quality it's possible to use extra options, like -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=5000:mbd=2:trell
To get needed value of vbitrate do a mencoder -ovc frameno -o frameno.avi -oac copy input.avi and read your value in the terminal window.

Sources:
Gentoo Forums
MemoryLeak