not looking for suites or bloating tools. just regained 600mb space by removing all .net gunk and only looking for something i can throw .ts files into, bk/fw preview quickly to obtain timecode so i can cut sections out with ffmpeg. need a small filesize, like dgavc, no installations to worry about. thanks in advanced.
+ Reply to Thread
Results 1 to 30 of 34
-
-
i hate to resort to using other peoples tools, i much perfer to create my own of everything, but that is not always possible. anyway. i found two utilities, TSSniper and Smart.Cutter, both are good, except that tssniper does not work on my pc. it won't cut. probably due to lack of dshow selection. too confusing to understand, so i gave that up. i turned to smart.cutter because it was small enough and doesn't take an installation, not to mention when they hide things during that step. anyway. it seems to be good enough for my needs for the time being. the timecodes (to feed into ffmpeg via command line) are pretty accurate so far. actually, i don't need them to be perfect, just close enough for what i want to cut.
the following code snippet below will cut a (lossless) section of video out.
ffmpeg example usage:
Code:ffmpeg -ss 00:39:51.481 -i "h:\video.ts" -vcodec copy -acodec copy -t 00:00:15 -y "h:\new_video.ts"
-
If you are talking time codes like for each frame (00:00:00.000), you can use Avisynth and a player such as Potplayer that has seek and frame by frame advance.
I wrote a little GUI to do this for just that reason but the script is rather simple:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
A = FFAudioSource("C:\Users\Bud\Desktop\VTS_01_1.VOB.1 2.VOB")
V = FFVideoSource("C:\Users\Bud\Desktop\VTS_01_1.VOB.1 2.VOB")
AudioDub(V, A)
Normalize()
Subtitle("VTS_01_1.VOB.12.VOB", font="Arial", size=24, text_color=$ff0000, align=3)
ShowFrameNumber(scroll=true, x=10, y=27, font="Arial", size=24, text_color=$ff0000)
ShowTime(x=72, y=44, font="Arial", size=24, text_color=$ff0000)
ShowSMPTE(fps=29.97, x=68, y=61, font="Arial", size=24, text_color=$ff0000) -
I do it in a similar way to Budman1, only with a simpler script as I'd open it with something like VirtualDub or AvsPmod which can display the timecodes/frame numbers itself and which makes navigating back and forth a little easier.
I use AVISynthesizer a lot. It's a tiny little "utility". Once it's installed you can right click on a video, select SendTo/AviSynthesizer, and a list of AVISynth templates pops up (you can create your own). I use a simple template to open video via ffmsindex quite a bit. AVISynthesizer creates the script, I right click on the script and select SendTo/VirtualDub (I love the SendTo menu), ffmsindex automatically creates the index file if it's not already created, and VirtualDub displays the video. I'm not sure how well ffmsindex works with ts files. I'd probably remux them as MKV first, but it's handy because you don't need to manually create the index file. I'm not sure you can do the same with dgindex.
My ffmsindex template looks like this:
#ASYNTHER FFMS2 - No Audio
LoadPlugin("C:\Program Files\ffms2\ffms2.dll")
[FFVideoSource("%f", threads=1)]
but it could contain the same fun stuff as Budman1's script if you want it to.
It's not as simple as "throwing something into a program", but a simple method using something which isn't a suite of tools seems like fairly conflicting goals to me. Maybe someone else will have a more clever idea. -
these are great ideas. but i already thought of them and dismissed them. why ? because they take too long to parse and finally open. i.e., it takes 2m17s to open a 4gig .ts file. by the time it opened, i forgot why i opened the darn thing. i need something that opens these large files quickly, scroll to the point i'm nearly certain will be at and fine-tune the exact spot, get the timecode and write that to ffmpeg. i would create a gui frontend to this if i could only open these .ts files but my system works today and not tomorrow and just causes me nothing but headacks. so i have to rely on other peoples works unfortunately.
-
I don't have a 4GB .ts file so I can guarantee. Try AviUtl. (It use L-Smash stuff to do the import) and ProjectX.
The AviUtl extra pack posted here is large but a lot of stuff can be deleted if you do not use it for MP4/MKV encoding.
ProjectX is specialized for handling DVB/TS stuff but i am not familiar with it.
No installation is needed for both programs. Just unzip and run the executable. -
Sorry, got no Delphi code, but basically, you would use the 'slave'-mode of mplayer (see: http://www.mplayerhq.hu/DOCS/tech/slave.txt)
and use for example 'edl_mark' to write the position into a file or use 'get_time_pos' to output the current position to std:ut.
(I use this in Hybrid for some visual based chapter creation.)
-
Although I do not have a 4GB file either, The method I use, actually my GUI, creates the Avisynth script and laumches it in Potplayer which will seek and frame by frame ('F' = forward 'D' = Backward). I will have to experiment now that you mention the time but it does create the ffmsindex file so it should not take too long. The Gui just keeps me from having to create the AVS file for each video I drag and drop.
Right now the above is an all encompassing program that also allows entering and executing Command lines (ffmpeg use).
It does not install but uses FFMpeg as well as other tools all incorporated into it so the file size is larger than some simpler utilities. Right now it is for my purposes and includes: DGDecode.dll, DGIndex, ffmpeg, ffms2, FLVcheck, FLVMDI, FLVMeta, MediaInfo andTsmux. This was the reason I just gave the script for your purposes and request.
If the time to load a 4GB file is not excessive, I'll try to offload a version with just the time code use if you can still use it or have not found another way.Last edited by Budman1; 4th Jan 2014 at 21:41. Reason: additional Info
-
the 4gig .ts filesizes takes long because i am still on an amd dual core 3600+ 2gig ram cpu under xp home. i see you have an i7, light years faster than mine. i'm still researching on this but have been busy in other areas of problems. but smart.cutter is pretty quick, just learned that if you drag/drop file onto the caption bar it will load the video into the timeline, however, there is too many icandy obstructing my view but i can live with it for now or until i found a way to create my own preview scrubber. thanks for your suggestions.
i have a utility from another project to give me timecodes based on frame numbers. now i just need to add a player/preview window with bw/fw scrubbing, and i'm done.
http://www.mplayerhq.hu/DOCS/tech/slave.txt
selur, the above link does sound interesting. do i need a specific build and codecs ? i just need this for .ts files put out from my hardware h264 encoders, roxio and hauppauge hdpvr. thanks. -
ok, i have an mplayer version that accepts my .ts files. and they play fine so far.
but i'm having trouble figuing out how to assign the following buttons (via code) to do the following (below) when the video loads and begins playing.
once i load the video, how do i "send" the command to mplayer ?
btn_stop
btn_pause
btn_step_backward one frame
btn_step_forward one frame -
I start MPlayer with something like:
Code:"G:\Hybrid\mplayer.exe" -slave "H:\TESTCL~1\test.avi" -forcedsubsonly -nosub -noautosub -fps 25 -nocache -aid 1 -ao win32 -wid 459660 -vo direct3d -lavdopts threads=1
"H:\TESTCL~1\test.avi" sets the input
"-forcedsubsonly -nosub -noautosub" disables all subtitles
"-aid 1 -ao win32 "selects the audio stream with ID 1 and sends the decoded signal to the win32 system ; when no audio is needed I add "-mc 0 -nosound" instead
" -fps 25" sets the fps
"-lavdopts threads=1" forces only one thread during decoding
"-vo direct3d" uses Direct3D Videorenderer
"-wid 459660" tells mplayer to output the video to the Window I want; if you use a separate Window this is not needed
"-slave" starts MPlayer in slave mode
if I need to capture time codes I also add '-edlout "path to edl file"', which specifies where the edl-output should be written to
Sending signals to MPlayer is simply writing '\n'-terminated commands to MPlayers std::in, in example:
Code:stop\n
the other command available are shown in the txt file.
frame_step allows to step forward one frame and pause the video again.
Argh, problem is that 'btn_step_backward one frame' will not be possible that easy, since mplayer sadly does not support that.
Other than frame_step mplayer only supports seek:
Code:seek <value> [type] Seek to some place in the movie. 0 is a relative seek of +/- <value> seconds (default). 1 is a seek to <value> % in the movie. 2 is a seek to an absolute position of <value> seconds.
(sadly something like 'pausing_keep seek -0.05 0' does not work, from what I remember it only jumps to the previous key frame, and rests if the current frame is a key frame,..)
For frame accurate seeking in transportstreams and similar an additional index would be needed (this is how avidemux does it; they use the libav api to basically write there own player which seeks based on an index file they create upon loading the source).
Alternatively one could write an Avisynth viewer and use the reading and navigation option from Avisynth, downside there is, that you basically would write your own media player.
Oh, I just remembered, I wanted to check out mpv (https://github.com/mpv-player/mpv), which yet another mplayer/mplayer2 fork but they write that one of the differences is 'Precise seeking support' sadly the do not list all available slave mode commands, so not sure if seeking is supported in slave mode atm.
----
-> all in all if you need/want frame accurate forward/backward seeking you probably need to write your own player.Last edited by Selur; 5th Jan 2014 at 00:02.
-
You should actually try the PotPlayer method with AVISynth. You just drop the AVS file into Potplayer and it will show the frame, time of each frame and SMTE time if you wish. Moving backward, forward, stopping and starting are all controlled easily by keystrokes. Although I have a Hex core i7, it only took 5 seconds to play a 7.3 GB MPG file so a dual core shouldn't be that much longer.
I suggest PotPlayer because of several nice features it has for editing like Playing AVS files, Frame by Frame movement, Playing a partially converted file to check appearance while the file is still being converted. I'm sure there are others that play AVISynth files and have frame movement that will work.
It really makes what you want easy. Just drag and drop the avs file and hit 'F' to stop and go forward, 'D' to stop or go backward. Arrow key can be programmed to jump in various time jumps (Arrow, ALT-arrow, SHIFT- Arrow ) all different amount. It's much easier than writing your own media PLayer and works simpler than Mplayer and can show the frame accurate times as well as show interlacing, blending, pulldown, etc.. Writing a GUI that drags and drops a file to create the AVS file is not that hard either.
If you have AVISynth, try the script Above and drop it in Media Player. It works there also except I haven't found a way to step frame by frame but at least you'd know how long it would take to play and display times. -
Okay Understood. I misunderstood that it was just that he was afraid it would take too long indexing due to his computer specs. That's why I suggested trying out before installing too many players.
Then I mistakenly keyed in on other phrases and missed the writing his own parts.
...only looking for something i can throw .ts files into, bk/fw preview quickly to obtain timecode so i can cut sections out with ffmpeg...
... i much perfer to create my own of everything, but that is not always possible...
... so i have to rely on other peoples works unfortunately...
...but i don't know how to code a simple bare-bones player with play/pause, let alone, how to obtain the timecode from it.
a problem though so writing his own is probably best.
Thanks
Budman1 -
Here another 2cents from my mind
If the goal is simply to have a player which:
a. supports m2ts
b. shows time stamps
c. supports frame accurate forward and backward seeking
AviUtl and other NLEs are probably the way to go.
----
If the goal is to have a player that can be incorporated into another application and isn't too large (AviUtl ~125MB), writing your own player is probably the only way to go.
Whether you base your player on Avisynth (Pro: easy to do; Con: Avisynth scripting and depending on the input lots of plugins required) or libav (Pro: should be cross-platform; Con: not so easy to do).
----
From what I see the 'best' way to properly implement frame backward seeking would be to always decoder previous/current/next GOP and cache the whole thing, which would require to have a bunch of frames inside memory. Uncompressed RGB (24bit) would take 1920x1080x3 bytes per frame with a gop size of 250 frames this would be 1920x1080x3x250 bytes = 1555200000 bytes = ~1484 MB which is quite a bit and the reason most tools don't do this.
Note: If your decoder is fast enough you could avoid keeping the uncompressed video inside the RAM.
Problem is with seeking in general is that most formats use (large) group of pictures, so navigation is only possible on key frame boundaries and if your container format does not supply a key frame index seeking get's complicated, which is why most NLE tool either:
a. create their own intermediate format
b. create a meta/index file they use for seeking
c. are slow when it comes to backward seeking
-> sadly I don't know of any 'small' project that:
a. is portable (in example by using libav based decoders&co)
b. can be incorporated into other applications
c. is cross-plattform available -
The Libav looks like a handy way to go. I created a stripped down input GUI that calls ffmpeg and a player to display times. I definitely want to see if I can switch over to Libav for the speed it mentions. It should be fairly easy since My project only calls other programs without having to recreate or recompile them so anything is fair game to be used. Thanks for that link Selur on libav. I'm downloading now.
-
Thanks for that link Selur on libav. I'm downloading now.
for newer avconv builds visit: http://libav.org/download.html
to clearify: When I mentioned libav, I ment the libraries not avconv.
avconv basically is a ffmpeg replacement, not sure if it brings any gains over ffmpeg atm.Last edited by Selur; 5th Jan 2014 at 02:10.
-
MPC-HC with ffdshow decoding and ffdshow's on screen display enabled to show frame numbers and timecodes. You can navigate to a specific frame/timecode using the Navigate/GoTo menu and the Ctrl key in combination with the left/right arrows lets you step backward/forward one frame at a time.
If frame accurate navigation using DirectShow is too funky/slow, the next best "no indexing" option would probably be Avisynth/DirectShowSource2, assuming you have the Haali Splitter installed. You could open the script with a program such as VirtualDub which displays frame numbers/timestamps, or use ffdshow's OSD and MPC-HC etc.
The program Avisynthesizer I linked to earlier will automatically creating the DDS2 script with a few mouse clicks.
LoadPlugin("C:\Program Files\Haali Media Splitter\avss.dll")
dss2("E:\video.ts")
I tried a DirectShow script with VirtualDub (MKV) and after a bit of navigating around, ffdshow's OSD and VirtualDub started drifting apart in respect the the frame numbers and timecodes being displayed. When opening a DDS2 script they remained they same. -
just to recap. i am only looking to create a basic cutter. to do that i need some player/timeline with timecode info displayed somewhere so that i can pass that to an offline cutter that accepts timecodes, like ffmpeg does.
but, rather than go into a lengthy detail response, i just want to say thank you all for your suggestions and tips. lot of good stuff in here worth reading and trying.
labav i'd love to try but have not found any pascal (delphi) code examples to get me started.
ffms, was tried but way too slow, taking several minutes to load up a video.
haali, now after searching around my hdd for the avss.dll, luckly i had it in my plugins folder, gave it a try and it opens the videos slightly faster. i may use it as a guige for enhancing my apps timecode calculations. since i managed to get an old (dspack) project back up and running again, so far my .ts videos are now loading fairly quickly again. not sure how i would incorporate a "cutter" from in the app, so i may just shell out to ffmpeg -- usage in post #2 above. so i discovered the avisynth function, ShowTime() and it shows the exact timecode i want, same as virtualdub, and necessary for ffmpeg to accurately cut within the timecode i specify. it probably won't be GOP/IDR (.ts sources) perfect, but i am ok with that for the time being, unless ffmpeg automatically takes care of that (landing or adjusting for an "I" frame) i don't know how to check that. maybe someone here knows that detail and can explain. if i ever get this thing working well enough i might post a screen shot. i am not competing againt anyone or other tools, this is only a hobby of mine. -
iirc ffmpeg should always cut on I-frames, not sure if it jumps to the next or previous I-frames.
(so yes, cutting H.264 might not be problematic, if an 'open gop'-structure was used)
other than that, how do i go about finding out if my hauppauge hdpvr it creating "open gop" or not ? -
From what I have experienced and understand, if you specify -ss xxx before the -I video (ffmpeg -ss 00:00:05:00 -I videoin videout) it searches to the I frame then if you search after the -I videoin it searches slower but to the exact frame. So if you wish to go to a certain frame specify such as:
ffmpeg -ss 00:02:30 -i Underworld.Awakening.avi -ss 00:00:30 out3.jpg
Found it interesting and demonstrated at http://trac.ffmpeg.org/wiki/Seeking%20with%20FFmpeg .
-
Nice.
I normally use the slow method to specify the time after the input, didn't know one could use too
'-ss' options,... (assumed that using the slow method already worked like using both)
If you use -ss with -c:v copy, the resulting bitstream might end up being choppy, not playable, or out of sync with the audio stream, since ffmpeg is forced to only use/split on i-frames. -
Okay here's the output I tested with. I have an MP4 with key frames at approximately 8.3696 seconds and 15.9363 with in the first 20 seconds. If I use :
ffmpeg -ss 00:00:07.000 -i "C:\Users\Bud\Desktop\mpg test\Wham!Last Christmas.mp4" -ss 00:00:06.697 -vcodec copy -acodec copy both.mp4
The video jumps to the 15.963 (approximately) which is the next I-frame after 6.697 + 7.000 = 13.697. Further testing showed the -ss 07.000 alone causes a cut at the first I-frame after which is the 8.396 one. So it appears that if either seek goes to the NEXT I-frame.
HOWEVER, if I actually re-encode using :
ffmpeg -ss 00:00:07.000 -i "C:\Users\Bud\Desktop\mpg test\Wham!Last Christmas.mp4" -ss 00:00:06.697 -vcodec libx264 -acodec copy both.mp4
It recodes to the 13.963 position unlike when video used copy codec designation.
-
So it works like this:
- -ss X -i .. -ss Y -c:v copy => seeks to first I-Frame after X+Y and starts copying from there
- -ss X -i .. -ss Y -c:v libx264 => seeks to X+Y and starts encoding from there. (!important!: this will only work if there's a gop boundary between X and X+Y)
("It recodes to the 13.963 position" confused me)
What happens if you use:
- -ss X -i .. -c:v copy
- -ss X -i .. -c:v libx264
- -i .. -ss X -c:v copy
- -i .. -ss X -c:v libx264
-
This is only an assumption on my part because I do not know the ffmpeg source code but it makes sense that if you COPY and do not reencode then ffmpeg must cut at its nearest I - frame which has always been the NEXT one after the -ss xxx. This has always been my experience while experimenting.
It also makes sense that if I used a codec, libx264 for example, ffmpeg will reencode at the point of the second -ss (I... -ss xxx) turning that frame into an I frame? I must admit this is beyond my knowledge at the moment but that is what occurs when I analyze the different conversion of an MP4 in your examples.
UPDATE: Looks like the latest FFMpeg has fixed it so the -ss xxx preceding the -I is now frame accurate as well.
when transcoding with ffmpeg (i.e. not streamcopying), -ss is now accurate
even when used as an input option. Previous behavior can be restored with
the -noaccurate_seek option.
Think I'll stay with the old dual -ss xxx method unless I want 3/10 of a second frozen image set to music.Last edited by Budman1; 11th Jan 2014 at 08:55. Reason: additional information
-
so, what would you call a utility that lets you seek through frames to obtain the timecode and/or frame number ? what would be a good term to use to describe it ?
Similar Threads
-
Media player that shows milliseconds?
By fsgroup in forum SubtitleReplies: 3Last Post: 1st Sep 2011, 15:13 -
Converting Media Center Cablecard recorded shows
By pcostanza in forum Newbie / General discussionsReplies: 5Last Post: 19th Apr 2011, 07:44 -
DVD Subrip shows incorrect timecodes !
By Chainsaw_1 in forum SubtitleReplies: 2Last Post: 31st Mar 2010, 18:28 -
Adaware Shows Replay Media Catcher As Malware
By DarrellS in forum ComputerReplies: 3Last Post: 5th Mar 2009, 01:51 -
How to change Mp3 Title which shows in bottom left side of windows media pl
By lostnucleus in forum Newbie / General discussionsReplies: 2Last Post: 10th Feb 2009, 06:43