FORUMS: list search recent posts

How to remove negative timestamp from a media?

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Madadi Smitha
How to remove negative timestamp from a media?
on Apr 9, 2014 at 11:47:21 am

I have media for which the ffprobe -show_streams produces an output as below:(this is a media trimmed using an iPhone)
[STREAM]
index=0
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=unknown
codec_type=audio
codec_time_base=1/8000
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=8000
channels=1
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/8000
start_pts=-80294
start_time=-10.036750
duration_ts=93213
duration=11.651625
bit_rate=48000
nb_frames=95
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:creation_time=2014-04-09 09:03:41
TAG:language=und
TAG:handler_name=Core Media Data Handler
[/STREAM]
[STREAM]
index=1
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=Constrained Baseline
codec_type=video
codec_time_base=1/48
codec_tag_string=avc1
codec_tag=0x31637661
width=480
height=360
has_b_frames=0
sample_aspect_ratio=0:1
display_aspect_ratio=0:1
pix_fmt=yuv420p
level=21
timecode=N/A
id=N/A
r_frame_rate=24/1
avg_frame_rate=24/1
time_base=1/12288
start_pts=-123331
start_time=-10.036702
duration_ts=266752
duration=21.708333
bit_rate=471029
nb_frames=521
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:creation_time=2014-04-09 09:03:41
TAG:language=und
TAG:handler_name=Core Media Data Handler
[/STREAM]

I want to transcode it using ffmpeg and store it on cloud.Below is the command I use to do it:

ffmpeg -i input.mp4 vcodec libx264 -pix_fmt yuv420p -vprofile baseline -preset veryfast -crf 20 -r 24 -s 480x360 -acodec libfdk_aac -ab 50000 -ar 44100 output.mp4

[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=Constrained Baseline
codec_type=video
codec_time_base=1/48
codec_tag_string=avc1
codec_tag=0x31637661
width=480
height=360
has_b_frames=0
sample_aspect_ratio=0:1
display_aspect_ratio=0:1
pix_fmt=yuv420p
level=21
timecode=N/A
id=N/A
r_frame_rate=24/1
avg_frame_rate=24/1
time_base=1/12288
start_pts=0
start_time=0.000000
duration_ts=266752
duration=21.708333
bit_rate=419200
nb_frames=521
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=und
TAG:handler_name=VideoHandler
[/STREAM]
[STREAM]
index=1
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=unknown
codec_type=audio
codec_time_base=1/44100
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=44100
channels=1
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/44100
start_pts=0
start_time=0.000000
duration_ts=957367
duration=21.709002
bit_rate=50108
nb_frames=526
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=und
TAG:handler_name=SoundHandler
[/STREAM]


The new media seems to show the trimmed off content too. ffplay seems to understand the transcoded media and play it fine. But other players like QuickTime or VLC play the trimmed content too. How do I transcode such that the trimmed part is removed in the transcoded video?


Return to posts index

Jim Sustacek
Re: How to remove negative timestamp from a media?
on Apr 10, 2014 at 12:29:05 pm

The iPhone trimming may not actually be trimming the audio/video data, just marking trim points that FFMPEG may not understand.

I would try re-doing the trimming with FFMPEG too. For example, in FFMPEG, "-ss 10" will start the new transcoded file after 10 seconds, and "-t 21" will trim it after 21 seconds. Adjust those values as needed (you may be able to find them in your FFPROBE output, otherwise you may have to view the file and/or experiment with different values).


Return to posts index

Madadi Smitha
Re: How to remove negative timestamp from a media?
on Apr 10, 2014 at 12:54:42 pm

Thanks Jim. I was able to fix this issue by using the trim filter.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]